/* =====================================================================
   Sarasota Networks — Info Portal Stylesheet
   Dark professional theme
   ===================================================================== */

/* --- Variables -------------------------------------------------------- */
:root {
  --bg:           #0f1117;
  --sidebar:      #13161f;
  --surface:      #1a1d27;
  --surface-2:    #1f2335;
  --border:       #252840;
  --border-lt:    #2e3250;

  --text:         #e2e5f0;
  --text-muted:   #8b8fa8;
  --text-subtle:  #4e5270;

  --blue:         #185FA5;
  --blue-lt:      #378ADD;
  --blue-dim:     rgba(55, 138, 221, 0.12);

  --teal:         #1D9E75;
  --teal-lt:      #25c490;
  --teal-dim:     rgba(29, 158, 117, 0.12);

  --red:          #c94444;
  --red-lt:       #e05252;
  --red-dim:      rgba(224, 82, 82, 0.12);

  --amber:        #d4882a;
  --amber-lt:     #eaa048;
  --amber-dim:    rgba(212, 136, 42, 0.12);

  --violet:       #8b5cf6;
  --violet-lt:    #a78bfa;
  --violet-dim:   rgba(139, 92, 246, 0.12);

  --olive:        #a8a537;
  --olive-lt:     #c6c24a;
  --olive-dim:    rgba(168, 165, 55, 0.12);

  --green:        #1D9E75;
  --green-lt:     #25c490;
  --green-dim:    rgba(29, 158, 117, 0.12);

  --radius:       8px;
  --radius-sm:    4px;
  --radius-lg:    14px;
  --shadow:       0 2px 12px rgba(0, 0, 0, .45);
  --shadow-lg:    0 8px 40px rgba(0, 0, 0, .65);
  --nav-h:        62px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
}

/* --- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--blue-lt); text-decoration: none; }
a:hover { color: var(--text); }
button, input, select, textarea { font-family: var(--font); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-lt); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }


/* =====================================================================
   LOGIN PAGE
   ===================================================================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-lg);
  padding: 48px 44px 44px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.25px;
}

.login-tagline {
  margin-top: 7px;
  font-size: .78rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.login-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}


/* =====================================================================
   TOP NAVIGATION BAR
   ===================================================================== */
.app-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 100;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  letter-spacing: -.2px;
  white-space: nowrap;
  text-decoration: none;
}

.nav-brand:hover { color: var(--text); }
.nav-brand svg { flex-shrink: 0; }

.nav-spacer { flex: 1; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-username {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-muted);
  padding: 6px 13px;
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  text-decoration: none;
}

.nav-logout:hover {
  color: var(--text);
  border-color: var(--text-muted);
}


/* =====================================================================
   APP BODY & CONTENT
   ===================================================================== */
.app-body {
  margin-top: var(--nav-h);
}

.app-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 32px;
}


/* =====================================================================
   ADMIN LAYOUT  (sidebar + main, used on admin pages)
   ===================================================================== */
.admin-wrap {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

.admin-sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 28px 0 20px;
}

.admin-sidebar-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-subtle);
  padding: 0 20px 10px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  font-size: .86rem;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  text-decoration: none;
}

.admin-nav-link svg { flex-shrink: 0; opacity: .7; }

.admin-nav-link:hover {
  background: var(--blue-dim);
  color: var(--text);
}

.admin-nav-link:hover svg { opacity: 1; }

.admin-nav-link.active {
  background: var(--blue-dim);
  color: var(--blue-lt);
}

.admin-nav-link.active svg { opacity: 1; }

.admin-main {
  flex: 1;
  padding: 40px 36px;
  overflow: auto;
  min-width: 0;
}


/* =====================================================================
   PAGE HEADER
   ===================================================================== */
.page-header {
  margin-bottom: 40px;
}

.page-greeting {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.2;
}

.page-greeting em {
  font-style: normal;
  color: var(--blue-lt);
}

.page-greeting.teal em {
  color: var(--teal-lt);
}

.page-subtitle {
  margin-top: 6px;
  font-size: .925rem;
  color: var(--text-muted);
}

.section-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-subtle);
  margin-bottom: 14px;
}


/* =====================================================================
   TOOL / RESOURCE TILES
   ===================================================================== */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  text-decoration: none;
  color: var(--text);
}

.tile:hover {
  border-color: var(--blue-lt);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(55, 138, 221, .14);
  color: var(--text);
}

.tile.teal:hover {
  border-color: var(--teal-lt);
  box-shadow: 0 6px 24px rgba(29, 158, 117, .14);
}

.tile-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.tile-icon.blue   { background: var(--blue-dim);   color: var(--blue-lt);   }
.tile-icon.teal   { background: var(--teal-dim);   color: var(--teal-lt);   }
.tile-icon.green  { background: var(--green-dim);  color: var(--green-lt);  }
.tile-icon.amber  { background: var(--amber-dim);  color: var(--amber-lt);  }
.tile-icon.red    { background: var(--red-dim);    color: var(--red-lt);    }
.tile-icon.violet { background: var(--violet-dim); color: var(--violet-lt); }
.tile-icon.olive  { background: var(--olive-dim);  color: var(--olive-lt);  }

.tile-title {
  font-size: .96rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.tile-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.tile-arrow {
  margin-top: 14px;
  color: var(--text-subtle);
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .2s, gap .2s;
}

.tile:hover .tile-arrow { color: var(--blue-lt); gap: 7px; }
.tile.teal:hover .tile-arrow { color: var(--teal-lt); }


/* =====================================================================
   CARDS  (general surface + coming-soon dashed)
   ===================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card-dashed {
  border: 2px dashed var(--border-lt);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  min-height: 170px;
  opacity: .6;
}

.card-dashed .cd-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.card-dashed .cd-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cd-soon {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  background: var(--border);
  color: var(--text-subtle);
  padding: 3px 9px;
  border-radius: 999px;
}


/* =====================================================================
   ADMIN SECTION  (on portal.php)
   ===================================================================== */
.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 8px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-section-title {
  font-size: 1rem;
  font-weight: 600;
}

.pill-admin {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--blue-lt);
  background: var(--blue-dim);
  padding: 3px 9px;
  border-radius: 999px;
}

.admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text-muted);
  transition: border-color .2s, background .2s, color .2s;
  text-decoration: none;
}

.admin-link svg { opacity: .6; transition: opacity .2s; }

.admin-link:hover {
  border-color: var(--blue-lt);
  background: var(--blue-dim);
  color: var(--text);
}

.admin-link:hover svg { opacity: 1; }


/* =====================================================================
   TABLE
   ===================================================================== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.table-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .865rem;
}

thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .65px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--sidebar);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .022); }

tbody td {
  padding: 13px 16px;
  vertical-align: middle;
}

.td-name   { font-weight: 500; line-height: 1.3; }
.td-email  { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.td-muted  { color: var(--text-muted); font-size: .82rem; }

.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}


/* =====================================================================
   BADGES
   ===================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-admin      { background: var(--blue-dim);  color: var(--blue-lt);   }
.badge-technician { background: var(--blue-dim);  color: #7ec8f5;          }
.badge-client     { background: var(--teal-dim);  color: var(--teal-lt);   }
.badge-active     { background: var(--teal-dim);  color: var(--teal-lt);   }
.badge-inactive   { background: var(--red-dim);   color: var(--red-lt);    }
.badge-readonly   { background: var(--border);    color: var(--text-muted);}
.badge-none       { background: var(--border);    color: var(--text-subtle);}


/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary   { background: var(--blue);  color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-lt); border-color: var(--blue-lt); color: #fff; }

.btn-teal      { background: var(--teal);  color: #fff; border-color: var(--teal); }
.btn-teal:hover { background: var(--teal-lt); border-color: var(--teal-lt); color: #fff; }

.btn-secondary { background: transparent; color: var(--text-muted); border-color: var(--border-lt); }
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }

.btn-danger    { background: transparent; color: var(--red-lt); border-color: var(--red-dim); }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red-lt); }

.btn-ghost     { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }

.btn-sm        { padding: 5px 12px; font-size: .8rem; }
.btn-full      { width: 100%; justify-content: center; }

.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }


/* =====================================================================
   FORMS
   ===================================================================== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-label .req { color: var(--red-lt); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--blue-lt);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b8fa8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.form-input::placeholder { color: var(--text-subtle); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-hint {
  font-size: .78rem;
  color: var(--text-subtle);
  margin-top: 5px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.form-section-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-subtle);
  margin-bottom: 14px;
}


/* =====================================================================
   ALERT / FLASH
   ===================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-error   { background: var(--red-dim);   border-color: var(--red-lt);  color: #f4a3a3; }
.alert-success { background: var(--teal-dim);  border-color: var(--teal-lt); color: #7eecc9; }
.alert-warning { background: var(--amber-dim); border-color: var(--amber);   color: #f7cc82; }


/* =====================================================================
   MODALS
   ===================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .16s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1);   }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  line-height: 1;
  transition: color .15s, background .15s;
}

.modal-close:hover { color: var(--text); background: rgba(255,255,255,.06); }

.modal-body   { padding: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
}


/* =====================================================================
   MISC
   ===================================================================== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.text-muted  { color: var(--text-muted) !important; }
.text-subtle { color: var(--text-subtle) !important; }
.text-sm     { font-size: .875rem; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-24       { margin-top: 24px; }
.mb-24       { margin-bottom: 24px; }


/* =====================================================================
   PORTAL — ALERT BANNER
   ===================================================================== */
.portal-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
  background: var(--amber-dim);
  border: 1px solid rgba(212, 136, 42, .45);
  border-radius: var(--radius);
}
.portal-alert-icon {
  color: var(--amber);
  flex-shrink: 0;
  margin-top: 1px;
}
.portal-alert-body { flex: 1; min-width: 0; }
.portal-alert-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--amber);
  margin-bottom: 6px;
}
.portal-alert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.portal-alert-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: .88rem;
  color: #f7cc82;
}
.portal-alert-list a {
  color: var(--amber);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.portal-alert-list a:hover { color: #ffdca0; }
.portal-alert-close {
  background: none;
  border: none;
  color: var(--amber);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity .15s;
}
.portal-alert-close:hover { opacity: 1; }


/* =====================================================================
   PORTAL — TILES COMPACT (single row on wide screens)
   ===================================================================== */
.tiles-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.tiles-grid-compact .tile {
  padding: 20px 18px;
  border-radius: var(--radius);
}
.tiles-grid-compact .tile-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
}
.tiles-grid-compact .tile-icon svg { width: 18px; height: 18px; }
.tiles-grid-compact .tile-title { font-size: .9rem; }
.tiles-grid-compact .tile-desc  { font-size: .76rem; }
.tiles-grid-compact .tile-arrow { margin-top: 10px; font-size: .75rem; }
.tiles-grid-compact .tile:hover {
  border-color: rgba(55, 138, 221, .35);
}


/* =====================================================================
   PORTAL — SPLIT (Quick links + Recent activity)
   ===================================================================== */
.portal-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
.portal-split-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.portal-split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.quicklinks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quicklink-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-lt);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.quicklink-pill:hover {
  color: var(--text);
  border-color: var(--blue-lt);
  background: var(--blue-dim);
}
.quicklink-pill svg { opacity: .7; }


/* =====================================================================
   PORTAL — ACTIVITY LIST
   ===================================================================== */
.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.activity-row:hover { background: var(--surface-2); }
.activity-list a.activity-row:last-child { border-bottom: none; }
.activity-row:last-child { border-bottom: none; }
.activity-app {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 1px;
}
.activity-app-blue  { background: var(--blue-dim);  color: var(--blue-lt);  }
.activity-app-teal  { background: var(--teal-dim);  color: var(--teal-lt);  }
.activity-app-amber { background: var(--amber-dim); color: var(--amber);    }
.activity-viewall {
  font-size: .76rem;
  color: var(--text-subtle);
  text-decoration: none;
  transition: color .12s;
}
.activity-viewall:hover { color: var(--blue-lt); }
.activity-main { flex: 1; min-width: 0; }
.activity-summary {
  font-size: .85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-meta {
  font-size: .74rem;
  color: var(--text-subtle);
  margin-top: 2px;
}


/* =====================================================================
   PORTAL — ADMIN ROW (compact)
   ===================================================================== */
.admin-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 8px;
}
.admin-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-row-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-row-links .admin-link {
  padding: 7px 12px;
  font-size: .82rem;
}


/* =====================================================================
   ACCOUNT PAGE
   ===================================================================== */
.account-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.account-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}
.account-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: var(--blue-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .5px;
  flex-shrink: 0;
  border: 1px solid rgba(55, 138, 221, .25);
}
.account-head-meta { flex: 1; min-width: 0; }
.account-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1.2;
  margin-bottom: 2px;
}
.account-email {
  color: var(--text-muted);
  font-size: .9rem;
}
.account-head-tags {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.account-since {
  font-size: .78rem;
  color: var(--text-subtle);
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.account-card-padded { padding: 22px 24px; }

.account-row {
  border-bottom: 1px solid var(--border);
}
.account-row:last-child { border-bottom: none; }
.account-row-view {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}
.account-row-main { flex: 1; min-width: 0; }
.account-row-label {
  font-size: .74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-subtle);
  margin-bottom: 3px;
}
.account-row-value {
  font-size: .92rem;
  color: var(--text);
}
.account-row-edit {
  display: none;
  padding: 4px 20px 20px;
  border-top: 1px dashed var(--border);
}
.account-row.editing .account-row-view { display: none; }
.account-row.editing .account-row-edit { display: block; padding-top: 18px; border-top: none; }
.account-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.account-2fa-state {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.account-2fa-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-2fa-icon.on  { background: var(--teal-dim); color: var(--teal-lt); }
.account-2fa-icon.off { background: var(--surface-2); color: var(--text-subtle); }

.session-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.login-history-table {
  width: 100%;
  border-collapse: collapse;
}
.login-history-table th,
.login-history-table td {
  text-align: left;
  padding: 11px 20px;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
}
.login-history-table th {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-subtle);
  background: var(--surface-2);
}
.login-history-table tr:last-child td { border-bottom: none; }


/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .admin-wrap { flex-direction: column; }

  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }

  .admin-sidebar-label { display: none; }
  .admin-nav-link { flex: 0 0 auto; padding: 8px 16px; }
  .admin-main { padding: 24px 20px; }
}

/* =====================================================================
   SEARCH BAR  (matches inventory app styling)
   ===================================================================== */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 13px 9px 38px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--blue-lt);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.search-input::placeholder { color: var(--text-subtle); }

.filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* =====================================================================
   EMPTY STATE
   ===================================================================== */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.empty-state svg   { color: var(--text-subtle); margin-bottom: 12px; }
.empty-state p     { margin: 0; font-size: .9rem; }

@media (max-width: 768px) {
  .app-inner { padding: 28px 18px; }
  .tiles-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .form-row   { grid-template-columns: 1fr; }
  .nav-username { display: none; }
  .app-nav { padding: 0 18px; }
  .table-toolbar { flex-direction: column; align-items: flex-start; }
  .search-wrap { max-width: 100%; }
  .portal-split { grid-template-columns: 1fr; }
  .account-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .account-row-view { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .tiles-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px 28px; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }
}

/* ========================================================================
   Customers app — sidebar layout
   ======================================================================== */
.cust-shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  min-height: calc(100vh - 120px);
}

.cust-sidebar {
  padding: 24px 14px 24px 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cust-sidebar .sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.cust-sidebar .sidebar-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.cust-sidebar .sidebar-link.active {
  background: rgba(55, 138, 221, 0.10);
  color: var(--blue-lt);
}
.cust-sidebar .sidebar-link svg { flex-shrink: 0; }

.cust-sidebar .sidebar-back {
  color: var(--text-subtle);
  font-size: .8rem;
  margin-bottom: 6px;
}

.cust-sidebar hr.sidebar-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.cust-sidebar .sidebar-section-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-subtle);
  padding: 4px 12px 6px;
}

.cust-main {
  padding: 28px 32px 40px;
  min-width: 0;
}

@media (max-width: 880px) {
  .cust-shell { grid-template-columns: 1fr; }
  .cust-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px 18px;
  }
  .cust-main { padding: 24px 18px 32px; }
}
