*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f5f7fb;color:#172033}a{text-decoration:none;color:inherit}button,input,select,textarea{font:inherit}.app-shell{display:grid;grid-template-columns:250px 1fr;min-height:100vh}.sidebar{height:100vh;position:sticky;top:0;background:#fff;border-right:1px solid #e5eaf2;padding:20px 14px;display:flex;flex-direction:column;z-index:30}.brand,.auth-brand{display:flex;gap:12px;align-items:center}.brand{padding:4px 8px 22px}.brand-mark{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:#2563eb;color:#fff;font-weight:900}.brand strong,.brand span,.sidebar-user strong,.sidebar-user span{display:block}.brand span,.sidebar-user span{font-size:12px;color:#8490a4;margin-top:2px}.sidebar nav{display:grid;gap:5px}.sidebar nav a{display:flex;align-items:center;gap:11px;padding:12px 13px;border-radius:11px;color:#5f6c82;font-weight:700}.sidebar nav a.active{background:#edf4ff;color:#1f5bd5}.sidebar nav a:hover:not(.disabled){background:#f4f7fb}.sidebar nav a small{margin-left:auto;font-size:10px}.disabled{opacity:.5;pointer-events:none}.sidebar-user{margin-top:auto;border-top:1px solid #edf0f5;padding:16px 8px 0;display:flex;gap:10px;align-items:center}.avatar{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:#e7efff;color:#2458c6;font-weight:800}.workspace{min-width:0}.topbar{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);border-bottom:1px solid #e6ebf3;padding:17px 28px;display:flex;justify-content:space-between;align-items:center}.title-row{display:flex;align-items:center;gap:12px}.topbar h1{font-size:22px;margin:0 0 4px}.topbar p{margin:0;color:#7a8799;font-size:13px}.menu-button{display:none;border:0;background:#edf3ff;color:#2458c6;border-radius:10px;padding:9px 11px}.content{padding:26px 28px 45px}.button{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:11px;padding:11px 15px;font-weight:800;cursor:pointer}.button.primary{background:#2563eb;color:#fff}.button.secondary{background:#edf3ff;color:#2158c9}.button.ghost{background:#fff}.button.danger{color:#be123c}.button.small{padding:7px 10px;font-size:12px}.wide{width:100%}.quick-actions,.toolbar{display:flex;justify-content:space-between;gap:12px;margin-bottom:18px}.quick-actions{justify-content:flex-end}.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}.metric-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.metric-card,.panel{background:#fff;border:1px solid #e5eaf2;border-radius:17px;box-shadow:0 7px 24px rgba(28,45,80,.05)}.metric-card{padding:20px}.metric-card span{display:block;color:#718096;font-size:13px;margin-bottom:9px}.metric-card strong{display:block;font-size:27px;margin-bottom:7px}.metric-card small{color:#9aa5b5}.panel{padding:20px;margin-bottom:18px}.panel h2{font-size:17px;margin:0 0 16px}.panel-header{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:16px}.panel-header h2{margin:0 0 4px}.panel-header p{margin:0;color:#8792a3;font-size:13px}.panel-header a{color:#2563eb;font-weight:800}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:780px}th,td{text-align:left;padding:13px 12px;border-bottom:1px solid #edf0f5;font-size:13px}th{color:#7c8799;background:#fafbfd}td small{display:block;color:#8792a3;margin-top:4px}.empty{text-align:center;color:#98a2b3;padding:30px}.badge{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:900}.badge.success{background:#e8f8ef;color:#18794e}.badge.warning{background:#fff4db;color:#9a6700}.badge.danger{background:#fff0f1;color:#b42318}.badge.neutral{background:#eef2f6;color:#526071}.actions{display:flex;gap:6px}.filters{display:flex;gap:10px;flex-wrap:wrap}.filters input,.filters select,.form-grid input,.form-grid select,.form-grid textarea,.auth-form input{border:1px solid #d8e0eb;border-radius:10px;padding:11px 12px;background:#fff;outline:none}.filters input:focus,.filters select:focus,.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus,.auth-form input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.1)}.form-panel{max-width:850px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.form-grid label,.auth-form label{display:grid;gap:7px;font-size:13px;font-weight:750;color:#4b5870}.span-2{grid-column:span 2}.form-actions{display:flex;justify-content:flex-end;gap:10px}.alert{padding:13px 15px;border-radius:12px;margin-bottom:16px}.alert.success{background:#e8f8ef;color:#18794e}.alert.danger{background:#fff0f1;color:#b42318}.two-column{display:grid;grid-template-columns:1fr 1fr;gap:18px}.details{display:grid;gap:0}.details div{display:flex;justify-content:space-between;gap:15px;padding:12px 0;border-bottom:1px solid #edf0f5}.details span{color:#7c8799}.notes{background:#f8fafc;padding:15px;border-radius:12px;color:#536077;min-height:120px}.auth-body{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#eef4ff,#f8fbff 55%,#eef2ff)}.auth-card{width:min(430px,100%);background:#fff;border:1px solid #e5eaf3;border-radius:24px;padding:32px;box-shadow:0 24px 70px rgba(36,58,105,.13)}.install-card{width:min(700px,100%)}.auth-brand{margin-bottom:28px}.auth-brand h1{margin:0 0 4px;font-size:22px}.auth-brand p{margin:0;color:#738098}.auth-form{display:grid;gap:18px}.help-text{font-size:12px;color:#7c8799;text-align:center;margin:18px 0 0}@media(max-width:1000px){.metric-grid{grid-template-columns:repeat(2,1fr)}.two-column{grid-template-columns:1fr}}@media(max-width:760px){.app-shell{grid-template-columns:1fr}.sidebar{position:fixed;left:-270px;width:250px;transition:left .2s;box-shadow:15px 0 35px rgba(0,0,0,.12)}.sidebar.open{left:0}.menu-button{display:inline-block}.topbar{padding:15px 16px}.content{padding:18px 14px 35px}.metric-grid,.metric-grid.three{grid-template-columns:1fr}.toolbar,.quick-actions{flex-direction:column}.filters>*{width:100%}.form-grid{grid-template-columns:1fr}.span-2{grid-column:span 1}.auth-card{padding:24px}.actions{flex-direction:column}}

.schedule-list{display:grid}.schedule-row{display:flex;justify-content:space-between;gap:15px;align-items:center;padding:13px 0;border-bottom:1px solid #edf0f5}.schedule-row:last-child{border-bottom:0}.schedule-row strong,.schedule-row small{display:block}.schedule-row small{margin-top:4px;color:#8792a3}.schedule-row>span{background:#eef4ff;color:#2158c9;padding:8px 10px;border-radius:10px;font-weight:900}
.form-grid label small{font-weight:500;color:#8792a3}


/* Updated appointment form */
.appointment-form-panel{max-width:980px}.form-section{border:1px solid #e5eaf2;border-radius:15px;padding:17px;background:#fbfcfe}.section-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:14px}.section-heading h2{margin:0 0 4px;font-size:16px}.section-heading p{margin:0;color:#8792a3;font-size:12px}.nested-grid{gap:13px}.search-control,.password-control{display:flex;gap:9px;align-items:stretch}.search-control input,.password-control input{min-width:0;flex:1}.client-search-results{display:grid;border:1px solid #d8e0eb;border-radius:12px;overflow:hidden;background:#fff}.client-result{border:0;border-bottom:1px solid #edf0f5;background:#fff;text-align:left;padding:13px 14px;cursor:pointer;display:grid;gap:5px;color:#4b5870}.client-result:last-child{border-bottom:0}.client-result:hover{background:#f1f6ff}.client-result span{font-size:13px}.client-result-message{padding:13px 14px;color:#667085;font-size:13px}.client-result-message.error{color:#b42318}.schedule-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.schedule-preview-card{border:1px solid #dce4ef;border-radius:13px;background:#fff;padding:15px;display:grid;gap:6px}.schedule-preview-card strong{font-size:14px;margin-bottom:5px}.schedule-preview-card span{font-size:12px;color:#7c8799;margin-top:4px}.schedule-preview-card b{font-size:16px;color:#1f4fa8}@media(max-width:760px){.search-control,.password-control{flex-direction:column}.schedule-preview-grid{grid-template-columns:1fr}.section-heading{flex-direction:column}}



/* Single-box dropdown styling used throughout the full application */
select {
  width: 100%;
  min-height: 42px;
  appearance: auto;
  -webkit-appearance: menulist;
  cursor: pointer;
  background-color: #fff;
}

.form-grid select,
.filters select,
.auth-form select {
  display: block;
  width: 100%;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  padding: 10px 12px;
  color: #172033;
  background-color: #fff;
}

.form-grid select:focus,
.filters select:focus,
.auth-form select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}

.form-grid label > select,
.nested-grid label > select {
  max-width: 100%;
}

@media (max-width:760px) {
  select {
    width: 100%;
  }
}


/* Compact appointment form used when GED Pretest is selected */
.compact-form-notice {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}
.ged-pretest-mode #appointment-form {
  max-width: 920px;
}


/* Automatic payment status and balance fields */
#payment_status_display,
#balance_due_display {
  font-weight: 700;
  background: #f8fafc;
  cursor: default;
}

#payment_status_display[data-status="paid"] {
  color: #166534;
  background: #f0fdf4;
  border-color: #86efac;
}

#payment_status_display[data-status="partial"] {
  color: #92400e;
  background: #fffbeb;
  border-color: #fcd34d;
}

#payment_status_display[data-status="unpaid"] {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fca5a5;
}


/* Clickable dashboard metrics and payment alerts */
.metric-link {
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.metric-link:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(15,23,42,.09);
}
.dashboard-payment-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid #fdba74;
  border-radius: 12px;
  background: #fff7ed;
  color: #7c2d12;
  text-decoration: none;
}
.dashboard-payment-alert div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dashboard-payment-alert.all-clear {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.page-filter-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}
.page-filter-banner.alert-banner {
  border-color: #fdba74;
  background: #fff7ed;
}
.inline-confirm-form {
  margin: 0;
}
.muted {
  color: #64748b;
  font-size: .9rem;
}


/* Version 2.0 database compatibility checker */
.system-check-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 12px;
}
.system-check-summary.success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #86efac;
}
.system-check-summary.danger {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

.two-column{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:18px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid .full{grid-column:1/-1}
.inline-form{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.stack-actions{display:grid;gap:10px}
.notice{padding:13px 15px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:10px;margin-top:14px}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.button-group{display:flex;gap:7px;flex-wrap:wrap}
.metrics-grid.compact{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.simple-bars{display:grid;gap:12px}.bar-row{display:grid;grid-template-columns:100px 1fr 100px;gap:10px;align-items:center}.bar-row div{height:10px;background:#e2e8f0;border-radius:99px;overflow:hidden}.bar-row i{display:block;height:100%;background:#2563eb;border-radius:99px}
.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:#cbd5e1;border:1px solid #cbd5e1;border-radius:12px;overflow:hidden}.calendar-head{padding:10px;background:#e2e8f0;font-weight:700;text-align:center}.calendar-day{min-height:120px;padding:8px;background:#fff}.calendar-day.empty{background:#f8fafc}.calendar-day.today{box-shadow:inset 0 0 0 2px #2563eb}.calendar-day>a{display:block;margin-top:5px;padding:6px;border-radius:7px;background:#eff6ff;font-size:.78rem;text-decoration:none;color:#1e3a8a}.calendar-day>a span{font-weight:700;margin-right:4px}
.quick-tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.quick-tool-grid a{display:flex;flex-direction:column;gap:5px;padding:15px;border:1px solid #dbe3ef;border-radius:11px;text-decoration:none;color:inherit}.quick-tool-grid a:hover{border-color:#93c5fd;background:#f8fbff}
@media(max-width:900px){.two-column{grid-template-columns:1fr}.quick-tool-grid{grid-template-columns:1fr 1fr}.calendar-grid{display:block;background:transparent;border:0}.calendar-head,.calendar-day.empty{display:none}.calendar-day{min-height:auto;border:1px solid #e2e8f0;margin-bottom:8px;border-radius:10px}.form-grid{grid-template-columns:1fr}.bar-row{grid-template-columns:80px 1fr 80px}}
@media(max-width:560px){.quick-tool-grid{grid-template-columns:1fr}.content{padding:14px}.panel{padding:14px}.metrics-grid{grid-template-columns:1fr}.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.topbar{padding:12px}.button{min-height:42px}.sidebar{max-width:88vw}}

.export-filter-section h3 {
  margin: 8px 0 0;
  font-size: 1rem;
}
.export-filter[hidden],
.export-filter-section[hidden] {
  display: none !important;
}


/* Mobile bottom navigation inspired by native iOS apps */
.mobile-bottom-nav,
.mobile-more-sheet,
.mobile-more-backdrop {
  display: none;
}

@media (max-width:760px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .sidebar {
    display: none;
  }

  .menu-button {
    display: none;
  }

  .topbar {
    padding: 13px 16px;
  }

  .topbar .button.ghost.danger {
    display: none;
  }

  .content {
    padding-bottom: 115px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
    align-items: end;
    min-height: 82px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    border-top: 1px solid rgba(203,213,225,.8);
    box-shadow: 0 -12px 35px rgba(15,23,42,.10);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav > a,
  .mobile-bottom-nav > button {
    position: relative;
    border: 0;
    background: transparent;
    color: #667085;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    padding: 7px 2px 2px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
  }

  .mobile-bottom-nav svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-bottom-nav svg .inner {
    stroke-width: 1.4;
  }

  .mobile-bottom-nav > .active {
    color: #5b21d2;
  }

  .mobile-bottom-nav > .active::after {
    content: "";
    position: absolute;
    top: 1px;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: #6d28d9;
  }

  .mobile-bottom-nav .mobile-add-button {
    align-self: stretch;
    justify-content: flex-start;
    margin-top: -36px;
    color: #6d28d9;
  }

  .mobile-add-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg,#7c3aed,#5b21d2);
    color: #fff;
    font-size: 48px;
    font-weight: 500;
    line-height: 1;
    box-shadow:
      0 14px 30px rgba(109,40,217,.33),
      0 0 0 8px rgba(255,255,255,.92);
  }

  .mobile-add-label {
    margin-top: 5px;
    font-size: 11px;
    color: #5b21d2;
  }

  .mobile-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(15,23,42,.34);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .mobile-more-backdrop.open {
    display: block;
  }

  .mobile-more-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 110;
    display: block;
    max-height: min(76vh, 650px);
    overflow-y: auto;
    padding: 10px 16px 20px;
    border: 1px solid rgba(203,213,225,.85);
    border-radius: 26px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 25px 70px rgba(15,23,42,.26);
    transform: translateY(calc(100% + 30px));
    opacity: 0;
    pointer-events: none;
    transition: transform .24s ease, opacity .2s ease;
  }

  .mobile-more-sheet.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-handle {
    width: 42px;
    height: 5px;
    margin: 0 auto 13px;
    border-radius: 999px;
    background: #d5d9e2;
  }

  .mobile-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .mobile-more-header div {
    display: grid;
    gap: 2px;
  }

  .mobile-more-header strong {
    font-size: 20px;
  }

  .mobile-more-header span {
    color: #8490a4;
    font-size: 12px;
  }

  .mobile-more-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 25px;
    cursor: pointer;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
  }

  .mobile-more-grid a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    background: #fff;
    color: #475569;
  }

  .mobile-more-grid a span {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    font-size: 18px;
  }

  .mobile-more-grid a strong {
    font-size: 13px;
  }

  .mobile-more-grid a.active {
    border-color: #c4b5fd;
    background: #f5f3ff;
    color: #5b21b6;
  }

  .mobile-more-grid a.danger {
    color: #b42318;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }
}

@media (max-width:390px) {
  .mobile-bottom-nav > a,
  .mobile-bottom-nav > button {
    font-size: 10px;
  }

  .mobile-add-circle {
    width: 64px;
    height: 64px;
  }

  .mobile-more-grid {
    grid-template-columns: 1fr;
  }
}


/* Profiles, settings and notifications */
.sidebar-user { text-decoration:none; color:inherit; }
.avatar-image, .topbar-profile img, .message-avatar img {
  width:100%; height:100%; object-fit:cover; border-radius:50%;
}
.topbar-actions { display:flex; align-items:center; gap:10px; }
.notification-button {
  position:relative; width:42px; height:42px; display:grid; place-items:center;
  border:1px solid #dbe3ef; border-radius:12px; background:#fff; text-decoration:none;
}
.notification-button b {
  position:absolute; top:-5px; right:-5px; min-width:19px; height:19px; padding:0 4px;
  display:grid; place-items:center; border-radius:999px; background:#dc2626; color:#fff;
  font-size:10px; border:2px solid #fff;
}
.topbar-profile {
  width:42px; height:42px; display:grid; place-items:center; overflow:hidden;
  border-radius:50%; background:#ede9fe; color:#5b21b6; font-weight:800; text-decoration:none;
}
.profile-photo-editor { display:flex; align-items:center; gap:18px; }
.profile-photo-editor > img, .profile-photo-editor > div {
  width:96px; height:96px; border-radius:50%; object-fit:cover;
  display:grid; place-items:center; background:#ede9fe; color:#5b21b6; font-size:30px; font-weight:800;
}
.checkbox-label { display:flex!important; flex-direction:row!important; align-items:center; gap:8px; }

.notification-list { padding:0; overflow:hidden; }
.notification-item {
  display:flex; align-items:flex-start; gap:14px; padding:17px 20px;
  border-bottom:1px solid #edf0f5; color:inherit; text-decoration:none;
}
.notification-item:hover { background:#f8fafc; }
.notification-icon {
  width:42px; height:42px; display:grid; place-items:center; border-radius:12px; background:#f1f5f9;
}
.notification-item div:last-child { display:grid; gap:4px; }
.notification-item span { color:#7a8699; font-size:12px; }

/* Company chat */
.chat-layout { max-width:1000px; margin:0 auto; }
.chat-panel { padding-bottom:0; }
.chat-feed {
  min-height:420px; max-height:65vh; overflow-y:auto; padding:12px 4px 22px;
  display:flex; flex-direction:column; gap:16px;
}
.chat-message, .appointment-comment { display:flex; align-items:flex-start; gap:11px; }
.chat-message.mine { flex-direction:row-reverse; }
.message-avatar {
  width:40px; height:40px; flex:0 0 40px; border-radius:50%;
  display:grid; place-items:center; overflow:hidden; background:#e0e7ff; color:#3730a3; font-weight:800;
}
.message-content, .comment-content { min-width:0; max-width:min(75%,680px); }
.chat-message.mine .message-content { display:flex; flex-direction:column; align-items:flex-end; }
.message-meta { display:flex; gap:8px; align-items:center; margin:0 4px 5px; }
.message-meta span { color:#8a94a6; font-size:11px; }
.message-bubble {
  padding:11px 13px; border-radius:16px 16px 16px 4px; background:#f1f5f9;
}
.chat-message.mine .message-bubble {
  background:#6d28d9; color:#fff; border-radius:16px 16px 4px 16px;
}
.message-bubble p, .comment-content p { margin:0; }
.chat-upload-image, .comment-image {
  display:block; max-width:100%; max-height:420px; margin-top:8px; border-radius:12px; object-fit:cover;
}
.chat-composer, .comment-composer {
  position:sticky; bottom:0; display:grid; grid-template-columns:1fr auto auto;
  gap:9px; align-items:end; padding:14px 0; background:#fff; border-top:1px solid #e5eaf0;
}
.chat-composer textarea, .comment-composer textarea { min-height:48px; max-height:140px; resize:vertical; }
.chat-image-button {
  width:46px; height:46px; display:grid!important; place-items:center; border-radius:12px;
  border:1px solid #dbe3ef; background:#f8fafc; cursor:pointer; font-size:20px;
}
.chat-image-button input { display:none; }
.reaction-row { display:flex; align-items:center; gap:5px; flex-wrap:wrap; margin-top:6px; }
.reaction-row > span { padding:3px 7px; border-radius:999px; background:#f1f5f9; font-size:12px; }
.reaction-picker { display:flex; gap:2px; }
.reaction-picker button {
  border:0; background:transparent; padding:3px; cursor:pointer; border-radius:6px;
}
.reaction-picker button:hover { background:#eef2ff; }

/* Appointment details, tags and comments */
.appointment-row-link { color:inherit; text-decoration:none; }
.appointment-row-link:hover { color:#5b21d2; }
.row-actions { display:flex; gap:6px; flex-wrap:wrap; }
.appointment-detail-header {
  display:flex; align-items:center; justify-content:space-between; gap:15px;
  margin-bottom:18px; padding:20px; border-radius:16px; background:linear-gradient(135deg,#f5f3ff,#eff6ff);
}
.appointment-detail-header h2 { margin:8px 0 3px; }
.appointment-detail-header p { margin:0; color:#667085; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.detail-list { display:grid; gap:0; margin:0; }
.detail-list div { display:grid; grid-template-columns:145px 1fr; gap:12px; padding:11px 0; border-bottom:1px solid #edf0f5; }
.detail-list dt { color:#778195; }
.detail-list dd { margin:0; font-weight:600; }
.appointment-tags { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:13px; }
.tag-chip {
  display:inline-flex; align-items:center; gap:6px; padding:6px 8px 6px 11px;
  border-radius:999px; background:#ede9fe; color:#5b21b6;
}
.tag-chip button { border:0; background:transparent; color:inherit; cursor:pointer; font-size:18px; line-height:1; }
.comment-feed { display:grid; gap:18px; }
.appointment-comment { padding-bottom:16px; border-bottom:1px solid #edf0f5; }
.comment-content { max-width:850px; }

/* Mobile */
@media(max-width:760px) {
  .topbar-actions .button.danger { display:none; }
  .topbar-profile { display:none; }
  .detail-grid { grid-template-columns:1fr; }
  .appointment-detail-header { align-items:flex-start; flex-direction:column; }
  .detail-list div { grid-template-columns:110px 1fr; }
  .message-content, .comment-content { max-width:calc(100% - 52px); }
  .chat-composer, .comment-composer { grid-template-columns:1fr auto; }
  .chat-composer .button, .comment-composer .button { grid-column:1/-1; }
  .profile-photo-editor { align-items:flex-start; flex-direction:column; }
}

.activity-filters{margin-bottom:18px;}


/* Mobile cleanup: New Appointment is already available in the bottom menu */
@media (max-width:760px) {
  .mobile-hide-appointment-create {
    display: none !important;
  }

  .appointment-search-bar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 16px;
  }
}

@media (max-width:520px) {
  .appointment-search-bar {
    grid-template-columns: 1fr;
  }
}


/* Appointment search: Amazon-style desktop bar */
.appointments-toolbar {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}

.desktop-amazon-search {
  flex:1;
  display:grid;
  gap:10px;
}

.amazon-search-bar {
  display:grid;
  grid-template-columns:auto minmax(220px,1fr) 56px;
  width:100%;
  min-height:48px;
  border:2px solid #f0a847;
  border-radius:10px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 4px 16px rgba(15,23,42,.06);
}

.amazon-search-bar:focus-within {
  border-color:#e88914;
  box-shadow:0 0 0 3px rgba(240,168,71,.20);
}

.amazon-search-bar select {
  width:auto;
  min-width:120px;
  padding:0 34px 0 13px;
  border:0;
  border-right:1px solid #d9dde5;
  border-radius:0;
  background:#f3f4f6;
  font-weight:700;
}

.amazon-search-bar input {
  min-width:0;
  border:0;
  border-radius:0;
  padding:0 16px;
  font-size:15px;
  box-shadow:none;
}

.amazon-search-bar select:focus,
.amazon-search-bar input:focus {
  outline:0;
  box-shadow:none;
}

.amazon-search-button {
  display:grid;
  place-items:center;
  border:0;
  background:#f3a847;
  color:#111827;
  cursor:pointer;
}

.amazon-search-button:hover {
  background:#ed9228;
}

.amazon-search-button svg {
  width:24px;
  height:24px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
}

.desktop-advanced-filters {
  display:flex;
  align-items:end;
  gap:9px;
  flex-wrap:wrap;
}

.desktop-advanced-filters label {
  min-width:145px;
  display:grid;
  gap:4px;
  color:#64748b;
  font-size:12px;
  font-weight:700;
}

.desktop-advanced-filters select,
.desktop-advanced-filters input {
  min-height:40px;
  background:#fff;
}

/* Mobile filter button and bottom sheet */
.mobile-filter-trigger,
.mobile-filter-sheet,
.mobile-filter-backdrop {
  display:none;
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

@media (max-width:760px) {
  .appointments-toolbar {
    align-items:center;
    justify-content:flex-end;
    margin-bottom:14px;
  }

  .desktop-amazon-search {
    display:none;
  }

  .mobile-filter-trigger {
    display:grid;
    place-items:center;
    width:58px;
    height:46px;
    border:2px solid #8b8b8b;
    border-radius:15px;
    background:#fff;
    color:#111;
    cursor:pointer;
    box-shadow:0 3px 10px rgba(15,23,42,.05);
  }

  .mobile-filter-trigger svg {
    width:29px;
    height:29px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.7;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .mobile-filter-backdrop {
    position:fixed;
    inset:0;
    z-index:119;
    background:rgba(15,23,42,.36);
    backdrop-filter:blur(2px);
    -webkit-backdrop-filter:blur(2px);
  }

  .mobile-filter-backdrop.open {
    display:block;
  }

  .mobile-filter-sheet {
    position:fixed;
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    z-index:120;
    display:block;
    max-height:84vh;
    overflow-y:auto;
    padding:10px 17px 20px;
    border:1px solid #dbe1ea;
    border-radius:25px;
    background:#fff;
    box-shadow:0 28px 80px rgba(15,23,42,.30);
    transform:translateY(calc(100% + 30px));
    opacity:0;
    pointer-events:none;
    transition:transform .24s ease, opacity .2s ease;
  }

  .mobile-filter-sheet.open {
    transform:translateY(0);
    opacity:1;
    pointer-events:auto;
  }

  .mobile-filter-handle {
    width:42px;
    height:5px;
    margin:0 auto 13px;
    border-radius:999px;
    background:#d5d9e2;
  }

  .mobile-filter-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:16px;
  }

  .mobile-filter-header > div {
    display:grid;
    gap:2px;
  }

  .mobile-filter-header strong {
    font-size:20px;
  }

  .mobile-filter-header span {
    color:#7c879a;
    font-size:12px;
  }

  .mobile-filter-header button {
    width:38px;
    height:38px;
    border:0;
    border-radius:50%;
    background:#f1f5f9;
    color:#475569;
    font-size:25px;
    cursor:pointer;
  }

  .mobile-filter-form {
    display:grid;
    gap:13px;
  }

  .mobile-filter-form label {
    display:grid;
    gap:6px;
    font-weight:700;
  }

  .mobile-date-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .mobile-filter-actions {
    display:grid;
    grid-template-columns:1fr 1.4fr;
    gap:9px;
    margin-top:5px;
  }

  .mobile-filter-actions .button {
    justify-content:center;
    min-height:46px;
  }

  body.appointment-filter-open {
    overflow:hidden;
  }
}

@media (max-width:390px) {
  .mobile-date-grid,
  .mobile-filter-actions {
    grid-template-columns:1fr;
  }
}

.dashboard-card-link{text-decoration:none;color:inherit;display:block;width:100%;height:100%}.dashboard-card-link:hover{text-decoration:underline;}


/* =========================================================
   Exam Manager V1 — Modern SaaS Design System
   ========================================================= */

:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f5f7fb;
  --bg-elevated: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #eef2f7;
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255,255,255,.82);
  --text: #182235;
  --text-strong: #0f172a;
  --text-muted: #738095;
  --border: #e3e8f0;
  --border-strong: #d6dce7;
  --primary: #6d3df5;
  --primary-strong: #5b21d2;
  --primary-soft: #f0ebff;
  --secondary: #2563eb;
  --success: #13a36f;
  --success-soft: #eafaf3;
  --warning: #e88914;
  --warning-soft: #fff6e8;
  --danger: #dc3f4b;
  --danger-soft: #fff0f2;
  --info: #3182f6;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 8px 24px rgba(31,42,68,.07);
  --shadow-lg: 0 18px 50px rgba(31,42,68,.11);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --chart-grid: #e8ecf3;
}

html[data-theme="dark"] {
  --bg: #090f1d;
  --bg-elevated: #111a2d;
  --bg-soft: #0e1728;
  --bg-muted: #182238;
  --sidebar-bg: #0d1526;
  --topbar-bg: rgba(9,15,29,.82);
  --text: #dce5f5;
  --text-strong: #f8fbff;
  --text-muted: #8d9ab1;
  --border: #202c43;
  --border-strong: #2b3851;
  --primary: #8b5cf6;
  --primary-strong: #a78bfa;
  --primary-soft: #251a48;
  --secondary: #60a5fa;
  --success: #32d296;
  --success-soft: #11382f;
  --warning: #f6b44b;
  --warning-soft: #3a2c14;
  --danger: #fb7185;
  --danger-soft: #3c1721;
  --info: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.18);
  --shadow-md: 0 10px 28px rgba(0,0,0,.23);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.34);
  --chart-grid: #26334c;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 12% 0%, rgba(109,61,245,.06), transparent 28%),
    var(--bg);
  color: var(--text);
  transition: background-color .22s ease, color .22s ease;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .2s ease;
}

textarea {
  min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 65%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 13%, transparent);
}

.app-shell {
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  width: 252px;
  padding: 22px 15px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background .2s ease, border-color .2s ease;
}

.brand {
  min-height: 58px;
  margin: 0 5px 20px;
  padding: 8px;
  border-radius: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #7c4dff, #5146e5);
  color: #fff;
  box-shadow: 0 10px 22px rgba(109,61,245,.26);
}

.brand strong {
  color: var(--text-strong);
  font-size: 15px;
}

.brand span {
  color: var(--text-muted);
  font-size: 11px;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.sidebar nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.sidebar nav a:hover {
  background: var(--bg-soft);
  color: var(--text-strong);
  transform: translateX(2px);
}

.sidebar nav a.active {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.sidebar-user {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: 72px;
  padding: 12px 24px;
  background: var(--topbar-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(22px, 2.2vw, 31px);
  letter-spacing: -.03em;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.topbar-actions {
  gap: 8px;
}

.theme-toggle-button,
.notification-button,
.topbar-profile {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-button {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.theme-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="light"] .theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

.content {
  padding: 24px;
}

.panel,
.metric-card,
.dashboard-action-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    background .2s ease;
}

.panel {
  padding: 20px;
}

.panel:hover,
.metric-card:hover,
.dashboard-action-card:hover {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 17px;
  letter-spacing: -.02em;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.metric-card span {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: var(--text-strong);
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -.04em;
}

.metric-card small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
}

.metric-link {
  text-decoration: none;
}

.dashboard-payment-alert {
  margin: 0 0 18px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  background: var(--warning-soft);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.dashboard-payment-alert.all-clear {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: var(--success-soft);
}

.button {
  min-height: 42px;
  border-radius: 10px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 24%, transparent);
}

.button.secondary,
.button.ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: auto;
  background: var(--bg-elevated);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px;
  background: var(--bg-soft);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .045em;
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--primary) 3.5%, var(--bg-elevated));
}

.amazon-search-bar {
  border-color: color-mix(in srgb, var(--primary) 65%, var(--border));
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.amazon-search-bar select {
  background: var(--bg-soft);
  color: var(--text);
  border-right-color: var(--border);
}

.amazon-search-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.amazon-search-button:hover {
  background: var(--primary-strong);
}

.quick-tool-grid a,
.mobile-more-grid a {
  border-color: var(--border);
  background: var(--bg-elevated);
}

.quick-tool-grid a:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}

.notice,
.page-filter-banner {
  border-color: color-mix(in srgb, var(--info) 28%, var(--border));
  background: color-mix(in srgb, var(--info) 8%, var(--bg-elevated));
  color: var(--text);
}

.alert {
  border-radius: 12px;
}

.chat-panel,
.chat-composer,
.comment-composer,
.mobile-more-sheet,
.mobile-filter-sheet,
.mobile-bottom-nav {
  background: var(--bg-elevated);
  border-color: var(--border);
}

.message-bubble {
  background: var(--bg-soft);
  color: var(--text);
}

.chat-message.mine .message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.reaction-row > span,
.mobile-more-header button,
.mobile-filter-header button,
.chat-image-button {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--border);
}

.appointment-detail-header {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--primary) 10%, var(--bg-elevated)),
      color-mix(in srgb, var(--secondary) 7%, var(--bg-elevated))
    );
}

.theme-settings-form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
}

.theme-settings-form .button {
  grid-column: 1 / -1;
  justify-self: start;
}

.theme-choice {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  background: var(--bg-soft);
}

.theme-choice.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent);
}

.theme-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-choice strong {
  color: var(--text-strong);
}

.theme-choice small {
  color: var(--text-muted);
}

.theme-preview {
  height: 92px;
  display: grid;
  grid-template-columns: 26% 1fr;
  grid-template-rows: 30% 1fr;
  gap: 7px;
  padding: 9px;
  border-radius: 10px;
  overflow: hidden;
}

.theme-preview i {
  display: block;
  border-radius: 6px;
}

.theme-preview i:first-child {
  grid-row: 1 / 3;
}

.light-preview {
  background: #f4f6fb;
  border: 1px solid #dfe5ee;
}

.light-preview i {
  background: #fff;
}

.light-preview i:first-child {
  background: #e9e4ff;
}

.dark-preview {
  background: #091120;
  border: 1px solid #26334b;
}

.dark-preview i {
  background: #162238;
}

.dark-preview i:first-child {
  background: #211849;
}

.calendar-grid {
  border-color: var(--border);
  background: var(--border);
}

.calendar-head,
.calendar-day {
  background: var(--bg-elevated);
  color: var(--text);
}

.calendar-head {
  background: var(--bg-soft);
}

.calendar-day>a {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.simple-bars .bar-row div {
  background: var(--bg-muted);
}

.simple-bars .bar-row i {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* modern scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 35%, transparent) transparent;
}

@media (max-width:1100px) {
  .metrics-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width:760px) {
  body {
    background: var(--bg);
  }

  .topbar {
    min-height: 64px;
    padding: 10px 14px;
  }

  .content {
    padding: 14px 12px 112px;
  }

  .panel {
    padding: 15px;
    border-radius: 15px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
  }

  .metric-card {
    min-height: 112px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .mobile-bottom-nav {
    border-radius: 21px 21px 0 0;
    background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  }

  .mobile-bottom-nav > a,
  .mobile-bottom-nav > button {
    color: var(--text-muted);
  }

  .theme-settings-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width:430px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}


/* Mobile dashboard cleanup */
@media (max-width:760px) {
  .dashboard-new-appointment-button {
    display: none !important;
  }
}

/* Role and job payment additions */
.muted{color:var(--muted);font-size:.88rem}
.alert.info{background:rgba(59,130,246,.1);border-color:rgba(59,130,246,.25);color:var(--text)}
table td form{margin:0}


/* Hide only the large dashboard New Appointment button on mobile.
   The floating center + button remains visible. */
@media (max-width: 768px) {
  .dashboard-mobile-hide-new-appointment {
    display: none !important;
  }
}


/* Clients mobile filter */
.clients-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.clients-desktop-filters {
  flex: 1;
}
.clients-mobile-filter-trigger {
  display: none;
}
body.client-filter-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .clients-toolbar {
    align-items: center;
  }

  .clients-desktop-filters {
    display: none !important;
  }

  .clients-mobile-filter-trigger {
    display: inline-flex;
  }

  .clients-toolbar > .button.primary {
    margin-left: auto;
  }
}

.push-setup-status{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border-radius:14px;margin-bottom:16px}
.push-setup-status.connected{background:#ecfdf3;border:1px solid #a7f3d0;color:#166534}
.push-setup-status.not-connected{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412}
.push-setup-form{margin-bottom:22px;padding-bottom:22px;border-bottom:1px solid var(--border,#e5e7eb)}
.push-permission-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border:1px solid var(--border,#e5e7eb);border-radius:14px;margin-bottom:20px;background:var(--surface-soft,#f8fafc)}
.push-permission-card>div{display:flex;flex-direction:column;gap:5px}
.checkbox-label{display:flex!important;align-items:center!important;gap:12px!important;min-width:0}
.checkbox-label input{width:22px!important;height:22px!important;flex:0 0 22px;margin:0}
.checkbox-label span{min-width:0;line-height:1.35;overflow-wrap:anywhere}
@media(max-width:760px){
 .push-permission-card{align-items:stretch;flex-direction:column}
 .push-permission-card .button{width:100%}
 .notification-settings-form,.form-grid{min-width:0}
 .checkbox-label{padding:10px 0}
}


/* Appointment edit and delete controls */
.appointment-header-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.appointment-header-actions form,
.appointment-row-actions form{
  margin:0;
}
.button.danger{
  background:#dc2626;
  border-color:#dc2626;
  color:#fff;
}
.button.danger:hover{
  background:#b91c1c;
  border-color:#b91c1c;
  color:#fff;
}
.appointment-row-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  align-items:center;
}
.appointment-edit-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
@media(max-width:760px){
  .appointment-detail-header{
    align-items:stretch;
    gap:16px;
  }
  .appointment-header-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }
  .appointment-header-actions .button,
  .appointment-header-actions form,
  .appointment-header-actions form .button{
    width:100%;
  }
  .appointment-row-actions{
    min-width:210px;
  }
  .appointment-edit-actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .appointment-edit-actions .button{
    width:100%;
  }
}

.push-production-tools{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin:0 0 18px;
  padding:14px;
  border:1px solid var(--border,#e5e7eb);
  border-radius:14px;
  background:var(--surface-soft,#f8fafc);
}
.push-tool-result{
  flex-basis:100%;
  min-height:20px;
  font-size:.9rem;
  overflow-wrap:anywhere;
}
.push-tool-result.success{color:#166534}
.push-tool-result.error{color:#b91c1c}
@media(max-width:760px){
  .push-production-tools .button{width:100%}
}


/* Exam Manager V1: dual appointment time display */
.dual-time-panel {
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  background: var(--surface, #fff);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}
.dual-time-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dual-time-heading h2 {
  margin: .2rem 0 0;
  font-size: 1.2rem;
}
.dual-time-kicker {
  display: block;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .65;
}
.dual-time-note {
  font-size: .82rem;
  opacity: .7;
}
.dual-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.time-zone-card {
  padding: 1.1rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  background: var(--panel, #f8fafc);
}
.kenya-time-card {
  background: linear-gradient(135deg, rgba(34, 197, 94, .10), rgba(255, 255, 255, .02));
}
.time-zone-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .75rem;
  font-weight: 800;
}
.time-zone-date {
  font-size: .9rem;
  opacity: .72;
}
.time-zone-value {
  margin: .15rem 0;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.035em;
}
.time-zone-meta {
  font-size: .8rem;
  opacity: .62;
}
.check-in-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: .88rem;
}
@media (max-width: 700px) {
  .dual-time-heading {
    display: block;
  }
  .dual-time-note {
    display: block;
    margin-top: .4rem;
  }
  .dual-time-grid {
    grid-template-columns: 1fr;
  }
}


/* Exam Manager V1 Push Diagnostic Center */
.push-tool-result.diagnostic-report {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
}
.diagnostic-summary {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: .9rem;
}
.diagnostic-summary span {
  font-size: .82rem;
  opacity: .75;
}
.diagnostic-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.diagnostic-check {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--surface, #fff);
  font-size: .84rem;
}
.diagnostic-check > span {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  font-weight: 900;
}
.diagnostic-check.pass > span {
  background: rgba(34, 197, 94, .15);
  color: #15803d;
}
.diagnostic-check.fail > span {
  background: rgba(239, 68, 68, .14);
  color: #b91c1c;
}
.diagnostic-error-detail {
  margin-top: .8rem;
  padding: .75rem;
  border-radius: 10px;
  background: rgba(239, 68, 68, .08);
}
.diagnostic-error-detail code {
  display: block;
  margin-top: .35rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.push-tool-result details {
  margin-top: .75rem;
}
.push-tool-result pre {
  overflow: auto;
  max-height: 320px;
  padding: .75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, .07);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .76rem;
}
@media (max-width: 700px) {
  .diagnostic-checks {
    grid-template-columns: 1fr;
  }
}


/* Exam Manager V1 automatic payment confirmation */
.payment-confirmation-panel {
  scroll-margin-top: 90px;
}
.payment-confirmation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.payment-confirmation-summary > div {
  padding: .9rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--panel, #f8fafc);
}
.payment-confirmation-summary span {
  display: block;
  margin-bottom: .25rem;
  font-size: .78rem;
  opacity: .68;
}
.payment-confirmation-summary strong {
  font-size: 1rem;
}
.payment-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .75rem;
}
.partial-payment-control {
  display: grid;
  grid-template-columns: minmax(130px, 180px) auto;
  align-items: end;
  gap: .55rem;
}
.partial-payment-control > span {
  grid-column: 1 / -1;
  font-size: .8rem;
  font-weight: 700;
}
@media (max-width: 760px) {
  .payment-confirmation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .payment-confirmation-actions,
  .partial-payment-control {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .payment-confirmation-actions .button,
  .partial-payment-control input {
    width: 100%;
  }
}

/* GED Pretest save reliability */
#appointment-client-error[hidden] { display:none !important; }
#appointment-client-error { margin-bottom: 8px; }

/* GED appointment timezone accuracy */
#multi-timezone-warning {
  margin-top: .6rem;
  padding: .7rem .8rem;
  border-radius: 10px;
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.32);
}

/* Compact mobile dashboard */
@media(max-width:760px){
  .dashboard-grid,.metric-grid,.stats-grid{gap:10px!important}
  .dashboard-grid,.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .dashboard-grid .metric-card,.dashboard-grid .stat-card,.metric-grid .metric-card,.stats-grid .stat-card{min-height:0!important;padding:14px!important}
  .dashboard-grid .metric-card h3,.metric-grid .metric-card h3{font-size:.82rem!important;margin-bottom:6px!important}
  .dashboard-grid .metric-card strong,.metric-grid .metric-card strong{font-size:1.55rem!important;line-height:1!important}
  .dashboard-grid .metric-card p,.metric-grid .metric-card p{font-size:.75rem!important;line-height:1.25!important;margin-top:7px!important}
  .payment-confirmation-card,.payment-confirmations,.payment-alert{padding:14px 16px!important;margin-bottom:12px!important}
}

/* Emails + TikTok */
.resource-page{display:grid;gap:18px}
.resource-filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.resource-filters select{min-width:150px}
.resource-table-wrap{overflow:auto}
.resource-table{width:100%;border-collapse:collapse}
.resource-table th,.resource-table td{padding:11px 10px;border-bottom:1px solid var(--border,#e5e7eb);text-align:left;vertical-align:top}
.resource-table td strong,.resource-table td small{display:block}
.resource-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.resource-actions form{margin:0}
.resource-card-list{display:grid;gap:12px}
.resource-account-card{border:1px solid var(--border,#e5e7eb);border-radius:15px;padding:14px;background:var(--surface,#fff)}
.resource-account-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
.resource-account-head strong,.resource-account-head span{display:block}
.resource-account-head strong{font-size:1.05rem}
.resource-account-head div>span{font-size:.8rem;opacity:.65;margin-top:3px}
.resource-account-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
.resource-account-grid>div{padding:9px;border-radius:10px;background:var(--surface-soft,#f8fafc)}
.resource-account-grid span,.resource-assignment-card span{display:block;font-size:.75rem;opacity:.65}
.resource-account-grid b{display:block;margin-top:3px;font-size:.88rem;word-break:break-word}
.resource-staff-update{display:grid;grid-template-columns:150px 1fr auto;gap:8px;margin-top:10px}
.resource-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.resource-stat{padding:14px;border:1px solid var(--border,#e5e7eb);border-radius:14px;background:var(--surface,#fff)}
.resource-stat span{display:block;font-size:.78rem;opacity:.65;text-transform:uppercase;letter-spacing:.04em}
.resource-stat strong{display:block;margin-top:5px;font-size:1.7rem}
.resource-assignment-card{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px;border:1px solid var(--border,#e5e7eb);border-radius:13px}
.resource-assignment-counts{display:flex;gap:10px}
.resource-assignment-counts span{padding:8px 10px;border-radius:10px;background:var(--surface-soft,#f8fafc);opacity:1}
.badge.active{background:#dcfce7;color:#166534}.badge.backup{background:#ede9fe;color:#6d28d9}.badge.closed{background:#fee2e2;color:#991b1b}
.badge.unused{background:#f1f5f9;color:#475569}.badge.assigned{background:#dbeafe;color:#1d4ed8}.badge.used{background:#dcfce7;color:#166534}.badge.disabled{background:#fee2e2;color:#991b1b}
@media(max-width:760px){
 .resource-account-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .resource-staff-update{grid-template-columns:1fr}
 .resource-staff-update .button{width:100%}
 .resource-filters{display:grid;grid-template-columns:1fr 1fr}
 .resource-filters .button{grid-column:1/-1}
 .resource-table th,.resource-table td{white-space:nowrap}
 .resource-assignment-card{align-items:flex-start;flex-direction:column}
}
