:root {
    --font-sans: "Aptos", "Segoe UI", sans-serif;
    --navy: #102642;
    --navy-strong: #17385f;
    --navy-soft: #214972;
    --accent: #2b74d8;
    --accent-soft: #4da5ff;
    --sky: #f3f7fc;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.82);
    --border: #d8e4f2;
    --text: #1b2a3a;
    --muted: #677b94;
    --success: #21b36a;
    --warning: #d99a22;
    --danger: #d75a58;
    --info: #2c8ef0;
    --shadow: 0 18px 45px rgba(16, 38, 66, 0.12);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --sidebar-width: 290px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--sky);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

main {
    position: relative;
    z-index: 1;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.narrow-container {
    width: min(760px, calc(100% - 40px));
    margin: 0 auto;
}

.public-body {
    position: relative;
    overflow-x: hidden;
}

.page-aurora {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(77, 165, 255, 0.18), transparent 34%),
        radial-gradient(circle at 90% 20%, rgba(43, 116, 216, 0.16), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #eef4fb 55%, #edf3fa 100%);
    pointer-events: none;
    z-index: 0;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 18px 0;
    backdrop-filter: blur(16px);
}

.public-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 16px 22px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.74);
    border-radius: 999px;
    box-shadow: var(--shadow);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 90px;
    height: auto;
    object-fit: contain;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--navy);
}

.brand-copy strong {
    font-size: 0.92rem;
}

.brand-copy small {
    font-size: 0.82rem;
    color: var(--muted);
}

.public-nav {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.public-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.95rem;
    transition: 0.18s ease;
}

.public-nav a:hover,
.public-nav a.active {
    color: var(--navy);
    background: rgba(43, 116, 216, 0.1);
}

.public-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--navy-soft));
    color: #fff;
    box-shadow: 0 14px 28px rgba(16, 38, 66, 0.18);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.82);
    color: var(--navy);
    border-color: var(--border);
}

.btn-ghost {
    background: rgba(43, 116, 216, 0.08);
    color: var(--navy);
    padding: 9px 12px;
}

.btn-inline {
    background: transparent;
    color: var(--accent);
    padding: 0;
    border: 0;
    font-weight: 600;
}

.btn-full {
    width: 100%;
}

.logout-form,
.action-cluster form {
    margin: 0;
}

.danger-text {
    color: var(--danger);
}

.panel {
    background: var(--surface-soft);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    backdrop-filter: blur(16px);
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent);
}

.lead {
    color: var(--muted);
    font-size: 0.97rem;
    line-height: 1.65;
}

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

.hero-section,
.section-block,
.auth-section {
    padding: 28px 0 52px;
}

.hero-grid,
.auth-grid,
.booking-grid,
.two-column,
.dashboard-split {
    display: grid;
    gap: 26px;
}

.hero-grid,
.booking-grid,
.two-column,
.auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.hero-section h1,
.auth-section h1,
.section-heading h1,
.section-heading h2,
.panel h2,
.success-panel h1 {
    margin: 0 0 14px;
    line-height: 1.12;
    color: var(--navy);
}

.section-heading h2,
.panel h2 {
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.auth-section h1,
.success-panel h1 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.hero-section h1 {
    font-size: clamp(1.9rem, 3.8vw, 3.2rem);
    max-width: 12ch;
}

.hero-actions,
.form-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-panel {
    position: relative;
    overflow: hidden;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -40px -40px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(77, 165, 255, 0.22), transparent 68%);
}

.stats-grid,
.card-grid,
.dashboard-grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 26px;
}

.stat-card,
.metric-card {
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 247, 252, 0.92));
    border: 1px solid var(--border);
}

.stat-label,
.metric-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card strong,
.metric-card strong {
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    color: var(--navy);
}

.metric-card p {
    color: var(--muted);
    margin: 10px 0 0;
    line-height: 1.6;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-heading.compact {
    align-items: center;
}

.service-card,
.doctor-card,
.side-panel {
    position: relative;
    overflow: hidden;
}

.pill {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(43, 116, 216, 0.1);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.service-card h3,
.doctor-card h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--navy);
}

.service-card p,
.doctor-bio,
.feature-item,
.public-footer p {
    color: var(--muted);
    line-height: 1.7;
}

.service-meta,
.summary-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.service-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-meta dt,
.summary-grid dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.service-meta dd,
.summary-grid dd {
    margin: 0;
    font-weight: 700;
    color: var(--navy);
}

.feature-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.feature-item {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(43, 116, 216, 0.06);
    border: 1px solid rgba(43, 116, 216, 0.08);
}

.soft-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.36));
}

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

.doctor-head {
    display: flex;
    gap: 16px;
    align-items: center;
}

.doctor-avatar,
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--navy), var(--accent));
    color: #fff;
    font-weight: 700;
}

.service-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.slot-picker-panel {
    margin-top: 18px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: rgba(43, 116, 216, 0.05);
    border: 1px solid rgba(43, 116, 216, 0.12);
}

.slot-picker-panel h3 {
    margin: 0 0 8px;
    color: var(--navy);
}

.slot-picker-status {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.slot-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.slot-day-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.88);
    color: var(--navy);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.slot-day-option:hover,
.slot-day-option.is-selected {
    transform: translateY(-1px);
    border-color: rgba(16, 38, 66, 0.28);
    box-shadow: 0 10px 20px rgba(16, 38, 66, 0.1);
}

.slot-day-option strong {
    text-transform: capitalize;
    font-size: 0.98rem;
}

.slot-day-option span {
    color: var(--muted);
    font-size: 0.9rem;
}

.slot-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    color: var(--navy);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.slot-option:hover,
.slot-option.is-selected {
    transform: translateY(-1px);
    border-color: rgba(43, 116, 216, 0.32);
    box-shadow: 0 10px 20px rgba(43, 116, 216, 0.12);
}

.slot-option strong {
    font-size: 1rem;
}

.slot-option span {
    color: var(--muted);
    font-size: 0.9rem;
}

.selection-chip,
.selected-slot-text {
    margin: 16px 0 0;
    color: var(--navy);
}

.selection-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(16, 38, 66, 0.08);
    font-size: 0.94rem;
    font-weight: 600;
}

.selected-slot-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.service-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(16, 38, 66, 0.05);
}

.service-line small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.compact .service-line {
    padding: 12px 14px;
}

.booking-side {
    display: grid;
    gap: 20px;
}

.stack-form {
    display: grid;
    gap: 18px;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--navy);
}

.full-width {
    grid-column: 1 / -1;
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    font: inherit;
    color: var(--text);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-control:focus {
    outline: 0;
    border-color: rgba(43, 116, 216, 0.38);
    box-shadow: 0 0 0 4px rgba(43, 116, 216, 0.12);
}

.checkbox-input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.error-text,
.errorlist {
    margin: 0;
    color: var(--danger);
    font-size: 0.9rem;
    list-style: none;
    padding: 0;
}

.messages-stack {
    display: grid;
    gap: 12px;
    margin: 0 0 22px;
}

.message-banner {
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.message-success {
    background: rgba(33, 179, 106, 0.14);
    color: #14693f;
}

.message-error,
.message-danger {
    background: rgba(215, 90, 88, 0.14);
    color: #8f2828;
}

.message-warning {
    background: rgba(217, 154, 34, 0.16);
    color: #8e6517;
}

.message-info {
    background: rgba(43, 116, 216, 0.12);
    color: var(--navy);
}

.auth-card {
    max-width: 520px;
    justify-self: end;
}

.auth-copy {
    padding-top: 34px;
}

.public-footer {
    padding: 0 0 60px;
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: rgba(16, 38, 66, 0.94);
    color: rgba(255, 255, 255, 0.92);
}

.footer-grid h3,
.footer-grid h4 {
    margin: 0 0 12px;
}

.dashboard-body {
    background: linear-gradient(180deg, #eef4fb 0%, #e7eff8 100%);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    padding: 0;
    background: linear-gradient(180deg, var(--navy) 0%, #132d4e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 20;
    box-shadow: 24px 0 48px rgba(16, 38, 66, 0.12);
    transition: transform 0.26s cubic-bezier(.4, 0, .2, 1);
}

body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

.dashboard-main {
    transition: margin-left 0.26s cubic-bezier(.4, 0, .2, 1);
}

body.sidebar-collapsed .dashboard-main {
    margin-left: 0;
}

.sidebar-brand {
    padding: 28px 24px 18px;
    background: #fff;
    border-radius: 0 0 28px 28px;
}

.sidebar-brand .brand-logo {
    width: 170px;
}

.sidebar-section {
    padding: 24px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-product-title {
    margin: 0 10px 6px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-label {
    margin: 0 10px 4px;
    color: rgba(255, 255, 255, 0.46);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
}

.nav-link {
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 600;
    transition: 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(77, 165, 255, 0.16);
    color: #fff;
}

.nav-group > summary {
    list-style: none;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: 0.18s ease;
}

.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::marker { display: none; }

.nav-group > summary::after {
    content: "›";
    font-size: 1.1rem;
    opacity: 0.7;
    display: inline-block;
    transition: transform 0.2s ease;
}

.nav-group[open] > summary::after {
    transform: rotate(90deg);
}

.nav-group > summary:hover {
    color: #fff;
}

.nav-group-items {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 4px 0 6px 8px;
    margin-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.13);
}

.nav-group-items .nav-link {
    display: block;
    width: 100%;
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 28px;
    align-items: baseline;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.detail-list dd {
    margin: 0;
    font-weight: 500;
}

.nav-link-sub {
    padding-left: 12px;
}

.inline-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.inline-link:hover {
    color: var(--accent-soft);
}

.sidebar-footer {
    padding: 18px 14px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 12px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.user-info {
    min-width: 0;
}

.user-name {
    font-weight: 700;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.64);
    margin-top: 2px;
}

.dashboard-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 24px 28px 36px;
}

.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.dashboard-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.sidebar-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 9px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-radius: 10px;
    transition: background 0.15s;
}

.sidebar-toggle:hover {
    background: rgba(16, 38, 66, 0.07);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--navy);
    border-radius: 2px;
}

.dashboard-topbar h1 {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    color: var(--navy);
}

.dashboard-content {
    display: grid;
    gap: 22px;
}

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

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

.data-table th,
.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(16, 38, 66, 0.08);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.data-table td small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
}

.badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(33, 179, 106, 0.14);
    color: #147344;
}

.badge-warning {
    background: rgba(217, 154, 34, 0.16);
    color: #8a651e;
}

.badge-danger {
    background: rgba(215, 90, 88, 0.16);
    color: #922d2c;
}

.badge-info {
    background: rgba(43, 116, 216, 0.14);
    color: var(--navy);
}

.badge-neutral {
    background: rgba(16, 38, 66, 0.1);
    color: var(--navy);
}

.action-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filters-panel {
    padding-bottom: 18px;
}

.actions-field {
    align-self: end;
}

.form-section {
    display: grid;
    gap: 16px;
}

.form-section + .form-section {
    margin-top: 8px;
    padding-top: 8px;
}

.form-section h3 {
    margin: 0;
    color: var(--navy);
}

.narrow-panel {
    max-width: 720px;
}

.success-panel {
    text-align: center;
}

.summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 26px 0 0;
    text-align: left;
}

.empty-state {
    text-align: center;
}

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

    .directory-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .public-header-inner,
    .hero-grid,
    .booking-grid,
    .two-column,
    .auth-grid,
    .dashboard-split,
    .footer-grid,
    .form-grid,
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .public-header-inner {
        border-radius: 28px;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        transform: none !important;
    }

    .dashboard-main {
        margin-left: 0 !important;
        padding: 20px;
    }

    .sidebar-toggle {
        display: none;
    }

    .dashboard-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-section h1 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .card-grid,
    .dashboard-grid,
    .stats-grid,
    .summary-grid,
    .service-meta {
        grid-template-columns: 1fr;
    }

    .btn,
    .hero-actions,
    .form-actions,
    .public-actions {
        width: 100%;
    }

    .hero-actions .btn,
    .form-actions .btn,
    .public-actions .btn {
        width: 100%;
    }

    .action-cluster {
        flex-direction: column;
        align-items: flex-start;
    }
}
