:root {
  --brand-blue: #007aff;
  --brand-blue-hover: #006ae6;
}

/* ---------- App Layout ---------- */

.app-layout {
    margin-left: 220px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Base UI ---------- */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #ffffff;
    color: #333;
}

main {
    padding: 30px;
    padding-bottom: 86px;
    display: flex;
    justify-content: center;
}

.content-wrapper {
    width: 100%;
    max-width: 1100px;
}

/* ---------- App Header / Breadcrumb ---------- */

.app-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.app-header {
    background: #fafafa;
    border-bottom: 1px solid #e1e1e1;
    height: 57px;
    padding: 0 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    line-height: 1;
    justify-content: space-between;
}

.separator {
    color: #888;
    font-size: 16px;
}

.breadcrumb {
    font-size: 16px;
    color: #222;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Email */
.email,
.logout-btn {
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}


/* Logout button */
.logout-btn {
    background: transparent;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: 6px 12px;
    color: #555;
    cursor: pointer;
}

.logout-btn:hover {
    background: #f2f2f2;
}

/* ---------- Normalize header elements ---------- */

.app-header a,
.app-header span,
.app-header button {
    font-size: 15px;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.app-header button {
    padding: 6px 12px;   /* controlled button size */
    line-height: 1;
}

/* ---------- Page Breadcrumb ---------- */

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 16px;
    color: #555;
}

.page-breadcrumb a {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 500;
}

.page-breadcrumb a:hover {
    text-decoration: underline;
}

.page-breadcrumb .separator {
    color: #888;
}

/* ---------- Style Table ---------- */

.styled-table {
    width: 100%;
    max-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 2px 10px rgba(0,0,0,0.08),
        0 1px 3px rgba(0,0,0,0.12);
}

/* Header */
.styled-table thead {
    background: #fafafa;
}

.styled-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #dcdcdc;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Rows */
.styled-table td {
    padding: 14px 16px;
    font-size: 15px;
    color: #444;
    border-bottom: 1px solid #e6e6e6;
}

/* Row Hover */
.styled-table tbody tr:hover td {
    background: #f5faff;
}

/* Link styling (ID) */
.link-id {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 600;
}

.link-id:hover {
    text-decoration: underline;
}

/* ---------- Sidebar ---------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #f9f9f9;
    border-right: 1px solid #e1e1e1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.sidebar-logo {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e1e1e1;
}

.sidebar-logo img {
    max-height: 28px;
    max-width: 140px;
}

.sidebar-nav {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.nav-item:hover {
    background: #ececec;
}

.nav-item.active {
    background: var(--brand-blue);
    color: #ffffff;
}

/* ---------- Status Badges ---------- */

.status-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.status-online {
    background: #d1f7ce;
    color: #2f9e44;
}

.status-idle {
    background: #fff3bf;
    color: #ad8b00;
}

.status-offline {
    background: #ffd5d5;
    color: #c92a2a;
}

/* Remove last row border */
.styled-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- Toolbar ---------- */

.toolbar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.batch-btn {
    height: 52px;
    margin-left: auto;
    padding: 14px 20px;
    border-radius: 10px;
    border: none;
    background: var(--brand-blue);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        0 2px 6px rgba(0,0,0,0.15);
}

/* ---------- Search Bar ---------- */

.search-container {
    width: 100%;
    margin-bottom: 18px;
}

#search-input {
    width: 280px;
    box-sizing: border-box;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #cfcfcf;
    font-size: 16px;
    outline: none;
    background: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
    transition: 0.15s ease;
    height: 52px;
}

#search-input:focus {
    border-color: var(--brand-blue);
    background: #ffffff;
    box-shadow:
        0 0 0 3px rgba(0,122,255,0.2),
        inset 0 1px 3px rgba(0,0,0,0.1);
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    align-items: center;
    margin-top: 16px;
    gap: 12px;
}

.pagination-info {
    font-size: 16px;
    color: #6b7280;
    white-space: nowrap;
}

.pagination-buttons {
    display: flex;
    gap: 6px;
    margin-left: auto;
}


.pagination button {
    min-width: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    background: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.pagination button:hover:not(.disabled):not(.active) {
    background: #f2f2f2;
}

.pagination button.active {
    background: var(--brand-blue);
    color: white;
    border-color: var(--brand-blue);
}

.pagination button.disabled {
    opacity: 0.4;
    cursor: default;
}

/* ---------- Details Page ---------- */

.details-card,
.actions-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow:
        0 2px 10px rgba(0,0,0,0.08),
        0 1px 3px rgba(0,0,0,0.12);
}

.details-card h2 {
    margin-top: 0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.label {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.log-block {
  background: #0f172a;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  max-height: 260px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  white-space: pre-wrap;
}


/* ---------- Warnings ---------- */

.warning-list {
    margin: 0;
    padding-left: 18px;
}

.warning-list li {
    color: #c92a2a;
    font-size: 14px;
    margin-bottom: 6px;
}

.no-warnings {
    color: #000000;
    font-size: 14px;
}

/* ---------- Action Buttons ---------- */

.action-btn {
    padding: 14px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.update {
    background: var(--brand-blue);
    color: white;
}

.restart {
    background: #fdcb6e;
}

.logs {
    background: #74b9ff;
    color: white;
}

/* ---------- Login ---------- */

.login-card {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border-radius: 14px;
    padding: 28px;
    box-shadow:
        0 10px 30px rgba(0,0,0,0.12),
        0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
}

.login-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid #cfcfcf;
    font-size: 15px;
}

.login-card input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.2);
}

.login-btn {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--brand-blue);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.login-btn:hover {
    opacity: 0.9;
}

.login-hint {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
}

.login-logo img {
    max-height: 30px;
    max-width: 140px;
    padding-bottom: 20px;
}

/* Add User button */
.add-user-btn {
    height: 52px;
    margin-left: auto;
    padding: 14px 20px;
    border-radius: 10px;
    border: none;
    background: var(--brand-blue);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        0 2px 6px rgba(0,0,0,0.15);
}

/* Users page header */
.page-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}

.page-title {
  font-size: 16px;
  color: #222;
}

.permission-message {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff4f4;
  color: #b42318;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  font-size: 14px;
}

/* ---------- MODAL ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  padding: 28px;
  width: 380px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ---------- FORM ---------- */

.modal-title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 600;
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand-blue);
}

/* ---------- ACTION BUTTONS ---------- */

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.btn-primary {
  padding: 10px 18px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  background: var(--brand-blue);
  color: white;
  cursor: pointer;
}

.btn-primary:hover,
.batch-btn:hover,
.add-user-btn:hover {
  background: var(--brand-blue-hover);
}

.btn-secondary {
  padding: 10px 18px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.action-icon {
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.action-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.action-icon.delete:hover {
  filter: brightness(0.8);
}

