/* ──────────────────────────────────────────────────────
   StrongMind Admin Panel — admin.css
   ────────────────────────────────────────────────────── */

   :root {
    --sage:        #7E9C8C;
    --sage-lt:     #8DAA96;
    --sage-bg:     rgba(126,156,140,.1);
    --sand:        #C2A98A;
    --sand-bg:     rgba(194,169,138,.1);
    --charcoal:    #2D3436;
    --muted:       #5B6470;
    --sidebar-w:   240px;
    --topbar-h:    60px;
    --bg:          #F4F6F8;
    --card-bg:     #ffffff;
    --border:      rgba(0,0,0,.07);
    --radius:      .75rem;
    --shadow-sm:   0 2px 12px rgba(0,0,0,.06);
    --shadow:      0 4px 24px rgba(0,0,0,.08);
  }
  
  * { box-sizing: border-box; }
  body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--charcoal); margin: 0; }
  
  /* ── Layout ─────────────────────────────────────────────── */
  .admin-layout { display: flex; min-height: 100vh; }
  
  /* ── Sidebar ────────────────────────────────────────────── */
  .admin-sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
  }
  .admin-sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }
  
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  .brand-icon-sm {
    width: 34px; height: 34px;
    background: var(--sage-bg);
    border: 1px solid rgba(126,156,140,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--sage);
    flex-shrink: 0;
  }
  .brand-icon-sm svg { width: 16px; height: 16px; }
  .sidebar-brand-name { font-weight: 700; font-size: .9rem; color: var(--charcoal); line-height: 1.2; }
  .sidebar-brand-sub  { font-size: .65rem; color: var(--muted); }
  
  .sidebar-nav { flex: 1; padding: .75rem .75rem; display: flex; flex-direction: column; gap: .2rem; }
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .85rem;
    border-radius: .6rem;
    color: var(--muted);
    font-size: .83rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .18s, color .18s;
    position: relative;
  }
  .sidebar-link i { font-size: 1rem; flex-shrink: 0; }
  .sidebar-link:hover  { background: var(--sage-bg); color: var(--sage); }
  .sidebar-link.active { background: var(--sage-bg); color: var(--sage); font-weight: 600; }
  .sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--sage);
  }
  .sidebar-badge {
    margin-left: auto;
    background: var(--sand);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 50px;
  }
  
  .sidebar-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
  }
  .sidebar-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
  }
  .sidebar-user-name { font-size: .8rem; font-weight: 600; color: var(--charcoal); line-height: 1.2; }
  .sidebar-user-role { font-size: .68rem; color: var(--muted); }
  .sidebar-logout { margin-left: auto; color: var(--muted); font-size: 1rem; transition: color .2s; }
  .sidebar-logout:hover { color: #e74c3c; }
  
  /* ── Main ───────────────────────────────────────────────── */
  .admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .28s cubic-bezier(.4,0,.2,1);
  }
  .admin-main.expanded { margin-left: 0; }
  
  /* ── Topbar ─────────────────────────────────────────────── */
  .admin-topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 99;
  }
  .sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--charcoal);
    padding: .25rem;
    line-height: 1;
  }
  .topbar-title { font-weight: 600; font-size: .95rem; flex: 1; }
  .topbar-right { display: flex; align-items: center; gap: .75rem; }
  .topbar-date  { font-size: .75rem; color: var(--muted); }
  
  /* ── Content ────────────────────────────────────────────── */
  .admin-content { padding: 1.5rem; flex: 1; }
  
  /* ── Cards ──────────────────────────────────────────────── */
  .admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }
  .admin-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
  }
  .admin-card-header h5 { font-size: .9rem; font-weight: 700; margin: 0; }
  .admin-card-body { padding: 1.25rem; }
  
  /* ── Stat Cards ─────────────────────────────────────────── */
  .stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
  }
  .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .stat-icon {
    width: 48px; height: 48px;
    border-radius: .75rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
  }
  .stat-icon.sage    { background: var(--sage-bg);   color: var(--sage); }
  .stat-icon.sand    { background: var(--sand-bg);   color: var(--sand); }
  .stat-icon.blue    { background: rgba(13,110,253,.1); color: #0d6efd; }
  .stat-icon.green   { background: rgba(25,135,84,.1);  color: #198754; }
  .stat-icon.yellow  { background: rgba(255,193,7,.12); color: #997404; }
  .stat-icon.red     { background: rgba(220,53,69,.1);  color: #dc3545; }
  .stat-num   { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--charcoal); }
  .stat-label { font-size: .75rem; color: var(--muted); font-weight: 500; }
  .stat-trend { font-size: .72rem; margin-top: .25rem; }
  .stat-trend.up   { color: #198754; }
  .stat-trend.down { color: #dc3545; }
  
  /* ── Table ──────────────────────────────────────────────── */
  .admin-table { font-size: .83rem; }
  .admin-table thead th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1rem;
    background: #fafafa;
  }
  .admin-table td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--border); }
  .admin-table tbody tr:hover { background: var(--sage-bg); }
  
  /* ── Badge Status ───────────────────────────────────────── */
  .badge-status {
    font-size: .7rem;
    font-weight: 600;
    padding: .3rem .7rem;
    border-radius: 50px;
  }
  .bg-warning-subtle  { background: #fff3cd !important; }
  .bg-success-subtle  { background: #d1e7dd !important; }
  .bg-primary-subtle  { background: #cfe2ff !important; }
  .bg-danger-subtle   { background: #f8d7da !important; }
  .text-warning { color: #856404 !important; }
  .text-success { color: #0f5132 !important; }
  .text-primary { color: #084298 !important; }
  .text-danger  { color: #842029 !important; }
  .border-warning-subtle { border-color: #ffe69c !important; }
  .border-success-subtle { border-color: #a3cfbb !important; }
  .border-primary-subtle { border-color: #9ec5fe !important; }
  .border-danger-subtle  { border-color: #f1aeb5 !important; }
  
  /* ── Calendar ───────────────────────────────────────────── */
  .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .35rem;
  }
  .cal-day-header {
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    padding: .5rem 0;
  }
  .cal-cell {
    min-height: 80px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .6rem;
    padding: .4rem;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    position: relative;
  }
  .cal-cell:hover { border-color: var(--sage); box-shadow: 0 2px 8px rgba(126,156,140,.15); }
  .cal-cell.today  { border-color: var(--sage); background: var(--sage-bg); }
  .cal-cell.empty  { background: #fafafa; cursor: default; }
  .cal-cell.blocked { background: repeating-linear-gradient(45deg,#fafafa,#fafafa 4px,#f0eeec 4px,#f0eeec 8px); }
  .cal-date {
    font-size: .78rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: .2rem;
  }
  .cal-cell.today .cal-date { color: var(--sage); }
  .cal-cell.other-month .cal-date { color: #bbb; }
  .cal-booking-dot {
    font-size: .65rem;
    font-weight: 600;
    border-radius: .3rem;
    padding: .1rem .35rem;
    margin-bottom: .15rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .cal-booking-dot.pending   { background: #fff3cd; color: #856404; }
  .cal-booking-dot.confirmed { background: #d1e7dd; color: #0f5132; }
  .cal-booking-dot.completed { background: #cfe2ff; color: #084298; }
  .cal-booking-dot.cancelled { background: #f8d7da; color: #842029; }
  .cal-more { font-size: .62rem; color: var(--muted); font-weight: 600; }
  
  /* ── Availability Grid ──────────────────────────────────── */
  .avail-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; }
  .avail-day-head {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    text-align: center;
    padding: .5rem 0;
  }
  .avail-slot {
    border: 1.5px solid var(--border);
    border-radius: .6rem;
    padding: .75rem .5rem;
    text-align: center;
    transition: all .2s;
    background: #fff;
    cursor: pointer;
  }
  .avail-slot.on  { border-color: var(--sage); background: var(--sage-bg); }
  .avail-slot.off { background: #f8f8f8; border-color: #e0e0e0; opacity: .6; }
  .avail-slot-icon { font-size: 1.1rem; display: block; margin-bottom: .25rem; }
  .avail-slot-name { font-size: .68rem; font-weight: 600; display: block; }
  .avail-slot-max  { font-size: .62rem; color: var(--muted); }
  
  /* ── Reminder Panel ─────────────────────────────────────── */
  .reminder-item {
    border: 1px solid var(--border);
    border-radius: .75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    transition: border-color .2s;
  }
  .reminder-item:hover { border-color: var(--sage); }
  .reminder-type-badge {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .2rem .6rem;
    border-radius: 50px;
  }
  .reminder-type-badge.email     { background: #cfe2ff; color: #084298; }
  .reminder-type-badge.whatsapp  { background: #d1e7dd; color: #0f5132; }
  
  /* ── Login Page ─────────────────────────────────────────── */
  .login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #F8F7F4, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .login-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
  }
  
  /* ── Forms ──────────────────────────────────────────────── */
  .admin-form .form-control,
  .admin-form .form-select,
  .admin-form textarea {
    border: 1px solid rgba(45,52,54,.12);
    border-radius: .6rem;
    font-size: .86rem;
    padding: .6rem .9rem;
    transition: border-color .2s, box-shadow .2s;
  }
  .admin-form .form-control:focus,
  .admin-form .form-select:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(126,156,140,.15);
  }
  .admin-form label { font-size: .78rem; font-weight: 600; margin-bottom: .3rem; }
  
  /* ── Buttons ────────────────────────────────────────────── */
  .btn-sage {
    background: var(--sage);
    color: #fff;
    border: none;
    font-size: .83rem;
    font-weight: 600;
    border-radius: .6rem;
    transition: background .2s;
  }
  .btn-sage:hover { background: #6c8a7a; color: #fff; }
  
  /* ── Activity Feed ──────────────────────────────────────── */
  .activity-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
  }
  .activity-item:last-child { border-bottom: none; }
  .activity-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
  }
  .activity-text { font-size: .82rem; line-height: 1.5; }
  .activity-time { font-size: .7rem; color: var(--muted); margin-top: .15rem; }
  
  /* ── Responsive ─────────────────────────────────────────── */
  @media (max-width: 768px) {
    .admin-sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .cal-grid { grid-template-columns: repeat(7,1fr); }
    .cal-cell { min-height: 50px; }
    .cal-booking-dot { display: none; }
    .avail-grid { grid-template-columns: repeat(4,1fr); }
  }
  
  /* ── Misc ───────────────────────────────────────────────── */
  .page-header { margin-bottom: 1.5rem; }
  .page-header h4 { font-size: 1.1rem; font-weight: 700; margin: 0; }
  .page-header p  { font-size: .8rem; color: var(--muted); margin: .2rem 0 0; }
  .divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
  .text-sage { color: var(--sage) !important; }
  .text-sand { color: var(--sand) !important; }