@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* ── PrivacyFed colour palette ────────────────────────────────────────────
   Primary green:  #1d6b4e  (dark forest green — matches PF brand)
   Green mid:      #2d8a63
   Green light:    #e8f5ef
   Green mid-light:#b7dece
   Accent teal:    #1a9678  (CTA hover)
   Text dark:      #0d1f17
   Text body:      #2c3e35
   Muted:          #607068
   Border:         #dde6e1
   BG light:       #f5faf7
   BG white:       #ffffff
   Danger:         #c0392b
   Success:        #1d6b4e  (same as brand — green confirms)
   ─────────────────────────────────────────────────────────────────────── */

:root {
  --brand:        #1d6b4e;
  --brand-dark:   #155239;
  --brand-darker: #0e3827;
  --brand-light:  #e8f5ef;
  --brand-mid:    #b7dece;
  --brand-hover:  #1a9678;
  --text:         #0d1f17;
  --text-2:       #2c3e35;
  --muted:        #607068;
  --muted-light:  #8fa099;
  --border:       #dde6e1;
  --border-light: #edf4f0;
  --bg:           #f5faf7;
  --bg-2:         #ecf4ef;
  --card:         #ffffff;
  --danger:       #c0392b;
  --danger-light: #fdf3f2;
  --danger-mid:   #f5bfba;
  --success:      #1d6b4e;
  --success-light:#e8f5ef;
  --success-mid:  #b7dece;
  --warning-light:#fffbeb;
  --warning-mid:  #fde68a;
  --warning-text: #92400e;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --sidebar-w:    248px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow:       0 4px 16px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.03);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.10), 0 4px 16px rgba(0,0,0,.05);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px;
  background: var(--bg-2); padding: 2px 6px; border-radius: 4px;
  color: var(--brand-dark); border: 1px solid var(--border);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-light); }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.layout { display: flex; min-height: 100vh; }

/* Sidebar — deep green matching PrivacyFed dark green tones */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0d2b1d 0%, #0f3524 60%, #0d2b1d 100%);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; top: 0; left: 0; height: 100vh;
  box-shadow: 4px 0 24px rgba(13,43,29,.25);
}

.sidebar-logo {
  padding: 22px 18px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, #2d8a63, #1d6b4e);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(29,107,78,.5); font-size: 16px; flex-shrink: 0;
}
.sidebar-logo-text { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.2px; }
.sidebar-logo-text span { color: #6fcfa3; }

.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }

.nav-section {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,.25);
  letter-spacing: .08em; text-transform: uppercase;
  padding: 14px 10px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; color: rgba(255,255,255,.55);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  border-radius: var(--radius); transition: all 0.15s;
  text-decoration: none; border: none; background: none; width: 100%;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); text-decoration: none; }
.nav-item.active {
  background: rgba(29,107,78,.5); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(111,207,163,.2);
}
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item.active .nav-icon { color: #6fcfa3; }

.sidebar-footer { padding: 12px 10px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  background: rgba(255,255,255,.05); margin-bottom: 8px;
}
.sidebar-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #2d8a63, #1a9678);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.sidebar-user-name  { font-size: 13px; font-weight: 600; color: #fff;
                      white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-role  { font-size: 11px; color: rgba(255,255,255,.35); text-transform: capitalize; }
.btn-logout {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 8px; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.40);
  background: none; border: 1px solid rgba(255,255,255,.08);
  cursor: pointer; transition: all 0.15s; text-decoration: none; font-family: inherit;
}
.btn-logout:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); text-decoration: none; }

.main { margin-left: var(--sidebar-w); flex: 1; padding: 36px 40px; }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-title  { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }

.card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.card-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.card-icon svg { width: 17px; height: 17px; }
.card-icon.purple { background: var(--brand-light); color: var(--brand); }
.card-icon.green  { background: var(--brand-light); color: var(--brand); }
.card-icon.slate  { background: var(--bg-2); color: var(--muted); }
.card-icon.amber  { background: var(--warning-light); color: #d97706; }

.card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-desc  { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-2); margin-bottom: 7px;
}
.form-hint { font-size: 12px; color: var(--muted-light); margin-top: 5px; }

input[type=text], input[type=email], input[type=password], input[type=time], select {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 14px; color: var(--text);
  background: var(--card); font-family: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
input:focus, select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,107,78,.10);
}
input::placeholder { color: var(--muted-light); }
input[type=time] { width: auto; min-width: 110px; cursor: pointer; }
select { cursor: pointer; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); font-size: 13.5px;
  font-weight: 600; cursor: pointer; border: 1.5px solid transparent;
  transition: all 0.15s; text-decoration: none; font-family: inherit;
  letter-spacing: 0.01em; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, #1d6b4e, #155239);
  color: #fff; border-color: #0e3827;
  box-shadow: 0 2px 8px rgba(29,107,78,.25), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1a9678, #1d6b4e);
  box-shadow: 0 4px 14px rgba(29,107,78,.35); text-decoration: none; color: #fff;
}
.btn-outline {
  background: var(--card); color: var(--text-2);
  border-color: var(--border); box-shadow: var(--shadow-sm);
}
.btn-outline:hover { background: var(--bg); border-color: #bfcfc8; text-decoration: none; color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.btn-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger-mid); }
.btn-danger:hover { background: #fce8e6; text-decoration: none; }
.btn-sm  { padding: 5px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-lg); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Table ──────────────────────────────────────────────────────────────── */
.table-wrap {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  background: var(--card);
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead { background: var(--bg); }
.table th {
  text-align: left; padding: 11px 16px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .06em;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover td { background: var(--bg); }

.user-cell   { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #2d8a63, #1a9678);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.user-name  { font-weight: 500; color: var(--text); }
.user-email { font-size: 12px; color: var(--muted); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-superadmin  { background: #f3e8ff; color: #6b21a8; }
.badge-superadmin .badge-dot { background: #9333ea; }
.badge-admin   { background: var(--brand-light); color: var(--brand-dark); }
.badge-admin .badge-dot   { background: var(--brand); }
.badge-user    { background: var(--bg-2); color: var(--muted); }
.badge-user .badge-dot    { background: var(--muted-light); }
.badge-active  { background: var(--success-light); color: #0e3827; }
.badge-active .badge-dot  { background: var(--brand); }
.badge-pending { background: var(--warning-light); color: var(--warning-text); }
.badge-pending .badge-dot { background: #f59e0b; }

select.badge {
  border: none; cursor: pointer; appearance: none; -webkit-appearance: none;
  padding-right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23607068' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
  font-family: inherit; box-shadow: none;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  display: none; padding: 12px 16px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; margin-bottom: 18px;
  align-items: center; gap: 9px;
}
.alert.show { display: flex; }
.alert svg  { width: 16px; height: 16px; flex-shrink: 0; }
.alert-success { background: var(--success-light); color: #0e3827; border: 1px solid var(--success-mid); }
.alert-error   { background: var(--danger-light); color: #991b1b; border: 1px solid var(--danger-mid); }

/* ── Working hours ──────────────────────────────────────────────────────── */
.wh-grid { display: flex; flex-direction: column; gap: 8px; }

.wh-day {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
}
.wh-day:not(.disabled):focus-within { border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(29,107,78,.07); }
.wh-day.disabled { background: var(--bg); }

.wh-day-header { display: flex; align-items: center; gap: 14px; padding: 11px 14px; }

.wh-day-name {
  font-size: 13px; font-weight: 700; color: var(--text); width: 34px; flex-shrink: 0;
}
.wh-day.disabled .wh-day-name { color: var(--muted-light); }

.wh-toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.wh-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.wh-track {
  position: absolute; inset: 0; border-radius: 99px;
  background: var(--border); transition: background 0.2s; cursor: pointer;
}
.wh-toggle input:checked + .wh-track { background: var(--brand); }
.wh-thumb {
  position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform 0.2s; pointer-events: none;
}
.wh-toggle input:checked ~ .wh-thumb { transform: translateX(16px); }

.wh-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.wh-day:not(.disabled) .wh-label { color: var(--text-2); }

.wh-add {
  margin-left: auto; display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--brand); background: var(--brand-light);
  border: none; border-radius: 6px; padding: 4px 10px;
  cursor: pointer; font-weight: 600; transition: background 0.15s; font-family: inherit;
}
.wh-add:hover { background: var(--brand-mid); }
.wh-day.disabled .wh-add { display: none; }

.wh-slots { display: flex; flex-direction: column; gap: 6px; padding: 0 14px 12px; }
.wh-day.disabled .wh-slots { display: none; }

.wh-slot {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 8px; padding: 7px 10px;
  border: 1px solid var(--border-light);
}
.wh-slot input[type=time] {
  width: 108px; padding: 5px 9px; font-size: 13px;
  background: var(--card); box-shadow: none; min-width: unset;
}
.wh-sep { font-size: 13px; color: var(--muted-light); font-weight: 500; }
.wh-remove {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted-light); padding: 3px 5px; border-radius: 5px;
  font-size: 16px; line-height: 1; transition: color 0.1s, background 0.1s;
}
.wh-remove:hover { color: var(--danger); background: var(--danger-light); }

/* ── Auth pages ─────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8f5ef 0%, #f5faf7 55%, #edf4f0 100%);
  padding: 20px;
}
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px;
}
.auth-logo-icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #2d8a63, #1d6b4e);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 4px 14px rgba(29,107,78,.30);
}
.auth-logo-text { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; color: var(--text); }
.auth-logo-text span { color: var(--brand); }
.auth-heading { font-size: 18px; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.auth-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 24px; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(13,31,23,.45); backdrop-filter: blur(4px);
  z-index: 100; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius-xl); padding: 28px;
  width: 100%; max-width: 460px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title  { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-close  {
  width: 28px; height: 28px; border-radius: 7px; background: none;
  border: none; cursor: pointer; color: var(--muted); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s; line-height: 1;
}
.modal-close:hover { background: var(--bg-2); color: var(--text); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-light);
}

/* ── Misc ────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-light); margin: 20px 0; }
.text-muted    { color: var(--muted); font-size: 13px; }
.text-sm       { font-size: 13px; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.flex  { display: flex; }
.items-center     { align-items: center; }
.items-start      { align-items: flex-start; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between  { justify-content: space-between; }
.w-full           { width: 100%; }
