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

:root {
    --teal:        #1D9E75;
    --teal-dark:   #178a63;
    --teal-light:  #E8F5F0;
    --teal-mid:    #B8E0D4;
    --bg:          #F0F4F3;
    --white:       #ffffff;
    --text:        #1a1a2e;
    --text-muted:  #666;
    --text-hint:   #999;
    --border:      #e8e8e8;
    --border-light:#f0f0f0;
    --shadow:      0 1px 8px rgba(0,0,0,0.07);
    --shadow-md:   0 4px 20px rgba(0,0,0,0.10);
    --radius:      12px;
    --radius-sm:   8px;
    --radius-xs:   6px;
    --danger:      #C0392B;
    --danger-bg:   #FFF0F0;
    --warning:     #B8860B;
    --warning-bg:  #FFF8E6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform .25s ease;
}
.sidebar-logo {
    padding: 22px 20px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--border-light);
}
.logo-mark {
    width: 34px; height: 34px;
    background: var(--teal);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-mark svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.logo-text { font-size: 17px; font-weight: 700; color: var(--text); }
.logo-sub  { font-size: 10px; color: var(--text-hint); margin-top: 1px; }

.sidebar-user {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 10px;
}
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--teal-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: var(--teal);
    flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name  { font-size: 13px; font-weight: 600; }
.user-status { font-size: 11px; margin-top: 2px; }
.user-status.active   { color: var(--teal); }
.user-status.pending  { color: var(--warning); }
.user-status.review   { color: #5B5BD6; }

.sidebar-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 13px; border-radius: var(--radius-sm);
    color: var(--text-muted); text-decoration: none;
    font-size: 14px; font-weight: 500;
    margin-bottom: 2px; transition: all .15s;
}
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover  { background: var(--teal-light); color: var(--teal); }
.nav-item.active { background: var(--teal-light); color: var(--teal); font-weight: 600; }
.nav-badge {
    margin-left: auto;
    background: var(--teal);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border-light);
}
.btn-logout {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 13px; border-radius: var(--radius-sm);
    color: var(--text-hint); font-size: 13px;
    background: none; border: none; cursor: pointer;
    width: 100%; transition: all .15s;
    text-decoration: none;
}
.btn-logout:hover { background: var(--danger-bg); color: var(--danger); }
.btn-logout svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Main */
.main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.hamburger {
    display: none;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
    display: block; width: 20px; height: 2px;
    background: var(--text); border-radius: 2px; margin: 4px 0;
    transition: all .2s;
}

.content { padding: 24px; flex: 1; max-width: 900px; }

/* ── Cards ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body  { padding: 20px; }

/* ── Stats ── */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
    background: var(--white); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--teal-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; stroke: var(--teal); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-hint); margin-top: 2px; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    cursor: pointer; border: none;
    text-decoration: none; transition: all .15s;
    white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
.btn-outline:hover { background: var(--teal-light); }
.btn-ghost   { background: #F4F5F7; color: var(--text-muted); }
.btn-ghost:hover   { background: #E8EAED; }
.btn-danger  { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover  { background: #FFE0E0; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-muted); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .4px;
}
.form-control {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; outline: none;
    transition: border-color .2s; color: var(--text);
    background: var(--white);
}
.form-control:focus { border-color: var(--teal); }
.form-control::placeholder { color: var(--text-hint); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--text-hint); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ── Badges ── */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.badge-success { background: var(--teal-light);  color: var(--teal); }
.badge-pending { background: var(--warning-bg);  color: var(--warning); }
.badge-danger  { background: var(--danger-bg);   color: var(--danger); }
.badge-info    { background: #EEF0FF; color: #5B5BD6; }
.badge-gray    { background: #F4F5F7; color: #666; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 8px; }
.alert svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--teal-light);  color: var(--teal-dark); border: 1px solid var(--teal-mid); }
.alert-error   { background: var(--danger-bg);   color: var(--danger);    border: 1px solid #F5C6C6; }
.alert-warning { background: var(--warning-bg);  color: var(--warning);   border: 1px solid #F5DFA0; }
.alert-info    { background: #EEF0FF; color: #5B5BD6; border: 1px solid #D0D3FF; }

/* ── Progress ── */
.progress { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--teal); border-radius: 3px; transition: width .3s; }

/* ── List items ── */
.list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-bottom: 1px solid var(--border-light);
}
.list-item:last-child { border-bottom: none; }
.list-item-icon {
    width: 38px; height: 38px; border-radius: 9px;
    background: var(--teal-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.list-item-icon svg { width: 17px; height: 17px; stroke: var(--teal); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 500; }
.list-item-sub   { font-size: 12px; color: var(--text-hint); margin-top: 2px; }
.list-item-right { text-align: right; flex-shrink: 0; }

/* ── Auth pages ── */
.auth-page {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: var(--bg); padding: 20px;
}
.auth-card {
    background: var(--white); border-radius: 16px;
    padding: 40px 36px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-md);
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--teal); text-decoration: none; font-weight: 500; }

/* ── Availability slots ── */
.slot-grid { display: flex; flex-direction: column; gap: 8px; }
.slot-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--bg);
    border-radius: var(--radius-sm); border: 1px solid var(--border-light);
}
.slot-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.slot-dot.free      { background: var(--teal); }
.slot-dot.pending   { background: #F0A500; }
.slot-dot.confirmed { background: #5B5BD6; }
.slot-body  { flex: 1; font-size: 13px; }
.slot-dates { font-weight: 500; }
.slot-label { font-size: 12px; color: var(--text-hint); margin-top: 1px; }

/* ── Mobile ── */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 199;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
    .sidebar-overlay.open { display: block; }
    .main { margin-left: 0; }
    .hamburger { display: block; }
    .content { padding: 16px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .form-row  { grid-template-columns: 1fr; }
    .topbar { padding: 12px 16px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
}