/* ============================================================
   PsikoPanel — Design System v4  |  2026
   Fonts: Geist Sans (Google), Inter fallback
   Design: Clean neutral dark-first, teal accent, warm grays
   ============================================================ */

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

/* ══════════════════════════════════════════════════════════
   DESIGN TOKENS — Dark (default)
   ══════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg-canvas:   #0a0f1a;
  --bg-surface:  #111827;
  --bg-elevated: #1a2437;
  --bg-overlay:  #1f2d42;
  --bg-subtle:   rgba(255,255,255,.04);
  --bg-0: #0a0f1a;
  --bg-1: #111827;
  --bg-2: #1a2437;
  --bg-3: #1f2d42;

  /* Borders */
  --border-subtle:   rgba(255,255,255,.06);
  --border-default:  rgba(255,255,255,.10);
  --border-strong:   rgba(255,255,255,.18);
  --border: rgba(255,255,255,.10);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary:  #475569;
  --text-disabled:  #334155;
  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #475569;

  /* Accent — Teal (professional, calm, medical) */
  --accent:      #14b8a6;
  --accent-l:    #2dd4bf;
  --accent-d:    #0f766e;
  --accent-bg:   rgba(20,184,166,.12);
  --accent-ring: rgba(20,184,166,.25);

  /* Semantic */
  --green:   #10b981;
  --green-bg: rgba(16,185,129,.12);
  --red:     #ef4444;
  --red-bg:  rgba(239,68,68,.12);
  --orange:  #f59e0b;
  --orange-bg: rgba(245,158,11,.12);
  --blue:    #3b82f6;
  --blue-bg: rgba(59,130,246,.12);
  --purple:  #8b5cf6;
  --purple-bg: rgba(139,92,246,.12);
  --teal:    #14b8a6;
  --teal-bg: rgba(20,184,166,.12);

  /* Layout */
  --sidebar-w:      256px;
  --sidebar-mini-w: 68px;
  --header-h:       60px;

  /* Typography */
  --font:       'Geist', 'Inter', system-ui, sans-serif;
  --font-mono:  'Geist Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm:  6px;
  --radius:     8px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow:     0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.6);
  --shadow-accent: 0 4px 20px rgba(20,184,166,.25);

  /* Transitions */
  --trans:      .15s cubic-bezier(.4,0,.2,1);
  --trans-slow: .25s cubic-bezier(.4,0,.2,1);
}

/* Light mode overrides */
[data-theme="light"] {
  --bg-canvas:   #f8fafc;
  --bg-surface:  #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-overlay:  #e2e8f0;
  --bg-subtle:   rgba(0,0,0,.03);
  --bg-0: #f8fafc;
  --bg-1: #ffffff;
  --bg-2: #f1f5f9;
  --bg-3: #e8eef7;

  --border-subtle:  rgba(0,0,0,.05);
  --border-default: rgba(0,0,0,.09);
  --border-strong:  rgba(0,0,0,.16);
  --border: rgba(0,0,0,.09);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-tertiary:  #94a3b8;
  --text-disabled:  #cbd5e1;
  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  --accent-bg:   rgba(20,184,166,.08);
  --accent-ring: rgba(20,184,166,.2);
  --green-bg: rgba(16,185,129,.08);
  --red-bg:   rgba(239,68,68,.08);
  --orange-bg: rgba(245,158,11,.08);
  --blue-bg:  rgba(59,130,246,.08);
  --purple-bg: rgba(139,92,246,.08);

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 16px rgba(0,0,0,.1);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.15);
}

/* ══════════════════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font);
  background: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background var(--trans-slow), color var(--trans-slow);
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
img { max-width: 100%; display: block; }

/* ══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute; top: -100px; left: 8px;
  background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: .82rem; font-weight: 600; z-index: 9999;
  text-decoration: none; transition: top var(--trans);
}
.skip-link:focus { top: 8px; }

/* ══════════════════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR v4
   ══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--trans-slow), background var(--trans-slow);
  z-index: 40;
}

/* Logo bar */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 800;
  flex-shrink: 0;
}
.logo-text {
  font-size: .9rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--trans);
}
.sidebar-collapse-btn {
  margin-left: auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary); cursor: pointer;
  flex-shrink: 0;
  transition: all var(--trans);
}
.sidebar-collapse-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.collapse-arrow { font-size: 10px; transition: transform var(--trans-slow); }

/* Quick stats strip */
.sidebar-stats {
  margin: 12px 12px 4px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  flex-shrink: 0;
  overflow: hidden;
  transition: all var(--trans-slow);
}
.sstat {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: default;
  transition: background var(--trans);
}
.sstat:hover { background: var(--bg-overlay); }
.sstat-icon { font-size: 12px; }
.sstat-val  { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.sstat-val.has-alert { color: var(--red); }
.sstat-lbl  { font-size: 8px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .05em; }

/* Scrollable nav area */
.nav-groups {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}
.nav-groups::-webkit-scrollbar { width: 4px; }
.nav-groups::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 2px; }

/* Nav group */
.nav-group { display: flex; flex-direction: column; }
.nav-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px 2px;
  background: none; border: none; cursor: pointer; width: 100%;
  transition: all var(--trans);
}
.nav-group-header:hover .nav-group-label { color: var(--text-secondary); }
.nav-group-label {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden;
  transition: color var(--trans);
}
.nav-group-arrow {
  font-size: 9px; color: var(--text-tertiary);
  transition: transform var(--trans-slow);
  flex-shrink: 0;
}
.nav-group:not(.open) .nav-group-arrow { transform: rotate(-90deg); }
.nav-group-items {
  display: flex; flex-direction: column; gap: 1px;
  padding: 0 8px 6px;
}

/* Nav item */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: .82rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: inherit;
}
.nav-icon svg { width: 17px; height: 17px; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--trans); }

/* Nav badges */
.nav-badge {
  min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; border-radius: 99px;
  padding: 0 5px; flex-shrink: 0; letter-spacing: 0;
}
.nav-badge-red    { background: var(--red);    color: #fff; }
.nav-badge-blue   { background: var(--blue);   color: #fff; }
.nav-badge-orange { background: var(--orange); color: #fff; }
.nav-badge-new {
  font-size: .55rem; font-weight: 700; padding: 2px 5px;
  background: var(--accent-bg); color: var(--accent);
  border: 1px solid var(--accent-ring);
  border-radius: 4px; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: .04em;
}

/* Sidebar bottom */
.sidebar-bottom {
  flex-shrink: 0;
  padding: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-role-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 4px;
  overflow: hidden;
}
.role-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.role-label { font-size: .7rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-logout { color: var(--text-tertiary) !important; }
.nav-logout:hover { background: var(--red-bg) !important; color: var(--red) !important; }

/* ── Mini mode ── */
[data-sidebar="mini"] .sidebar { width: var(--sidebar-mini-w); }
[data-sidebar="mini"] .logo-text,
[data-sidebar="mini"] .nav-label,
[data-sidebar="mini"] .nav-group-header,
[data-sidebar="mini"] .nav-badge-new,
[data-sidebar="mini"] .sidebar-stats,
[data-sidebar="mini"] .sidebar-role-pill { display: none !important; }
[data-sidebar="mini"] .sidebar-logo { justify-content: center; padding: 0 8px; }
[data-sidebar="mini"] .sidebar-collapse-btn { margin-left: 0; }
[data-sidebar="mini"] .nav-item { padding: 10px; justify-content: center; border-radius: var(--radius); }
[data-sidebar="mini"] .nav-item.active::before { display: none; }
[data-sidebar="mini"] .nav-badge { display: none; }
[data-sidebar="mini"] .nav-group-items { padding: 0 8px 4px; }
[data-sidebar="mini"] .nav-groups { padding: 4px 0; }
[data-sidebar="mini"] .nav-group { border-top: 1px solid var(--border-subtle); }
[data-sidebar="mini"] .sidebar-bottom { padding: 8px; }
[data-sidebar="mini"] .collapse-arrow { transform: rotate(180deg); }

/* Mobile */
.mobile-menu-btn {
  display: none;
  background: none; border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 7px;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--trans);
}
.mobile-menu-btn:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 39;
  backdrop-filter: blur(2px);
}
.sidebar-mobile-overlay.active { display: block; }

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ══════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════ */
.page-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 30;
  gap: 16px;
}
.page-header-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.page-title {
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-actions { display: flex; gap: 8px; align-items: center; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Theme toggle */
.theme-toggle-btn {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 14px; cursor: pointer;
  transition: all var(--trans); flex-shrink: 0;
}
.theme-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }

/* User menu */
.header-user-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: 99px; cursor: pointer;
  position: relative; transition: all var(--trans);
  user-select: none;
}
.header-user-wrap:hover { border-color: var(--accent); }
.header-avatar-img  { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.header-avatar-init {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem; flex-shrink: 0;
}
.header-user-text { line-height: 1.2; }
.header-user-name { font-size: .75rem; font-weight: 600; color: var(--text-primary); display: block; white-space: nowrap; }
.header-user-role { font-size: .65rem; color: var(--text-tertiary); display: block; }
.header-chevron   { color: var(--text-tertiary); font-size: 9px; transition: transform var(--trans); }
.header-user-wrap.open .header-chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  min-width: 200px; overflow: hidden; z-index: 200; display: none;
}
.user-dropdown.open { display: block; animation: dropIn .15s ease; }
@keyframes dropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.user-dropdown-header { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
.dd-name  { font-size: .82rem; font-weight: 700; color: var(--text-primary); }
.dd-email { font-size: .7rem; color: var(--text-tertiary); margin-top: 1px; }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px; color: var(--text-secondary);
  font-size: .8rem; font-weight: 500; text-align: left;
  background: none; border: none; cursor: pointer;
  transition: background var(--trans), color var(--trans);
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg-subtle); color: var(--text-primary); }
.dd-separator { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.dd-danger { color: var(--red) !important; }
.dd-danger:hover { background: var(--red-bg) !important; color: var(--red) !important; }

/* ══════════════════════════════════════════════════════════
   GLOBAL SEARCH
   ══════════════════════════════════════════════════════════ */
.global-search-wrap { position: relative; z-index: 60; }
.global-search-input {
  width: 200px; padding: 6px 12px 6px 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: .78rem; font-family: var(--font);
  outline: none;
  transition: border-color var(--trans), width var(--trans), background var(--trans);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.global-search-input:focus { border-color: var(--accent); background-color: var(--bg-overlay); width: 260px; }
.global-search-input::placeholder { color: var(--text-tertiary); }
.global-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 200; min-width: 300px;
}
.gs-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; color: var(--text-primary);
  font-size: .8rem; border-bottom: 1px solid var(--border-subtle);
  transition: background var(--trans); outline: none;
}
.gs-item:last-child { border-bottom: none; }
.gs-item:hover, .gs-item:focus { background: var(--bg-subtle); }
.gs-icon { font-size: .9rem; flex-shrink: 0; width: 20px; text-align: center; }
.gs-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gs-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-alt { font-size: .7rem; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════════════════════════════════════════════
   NOTIFICATION BELL
   ══════════════════════════════════════════════════════════ */
.notif-wrap { position: relative; z-index: 60; }
.notif-btn {
  position: relative; width: 34px; height: 34px;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--trans);
}
.notif-btn:hover { border-color: var(--accent); color: var(--accent); }
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--red); color: #fff;
  font-size: .55rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  border: 2px solid var(--bg-canvas);
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 290px; background: var(--bg-elevated);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 200;
}
.notif-header { padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
.notif-title { font-size: .78rem; font-weight: 700; color: var(--text-primary); }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary); font-size: .78rem;
  transition: background var(--trans);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-subtle); }
.notif-item.notif-high { border-left: 3px solid var(--red); }
.notif-ico { font-size: .9rem; flex-shrink: 0; margin-top: 1px; }
.notif-body { display: flex; flex-direction: column; gap: 2px; }
.notif-msg { font-weight: 600; color: var(--text-primary); }
.notif-sub { font-size: .7rem; color: var(--text-tertiary); }
.notif-empty { padding: 20px; text-align: center; color: var(--text-tertiary); font-size: .78rem; }

/* ══════════════════════════════════════════════════════════
   PAGE BODY
   ══════════════════════════════════════════════════════════ */
.page-body { padding: 24px; flex: 1; }

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: background var(--trans), border-color var(--trans);
}
.card-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-tertiary); margin-bottom: 14px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

/* ══════════════════════════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════════════════════════ */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform var(--trans), box-shadow var(--trans);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--card-accent, var(--accent));
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card-icon { font-size: 1.2rem; margin-bottom: 2px; }
.stat-label { font-size: .7rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-sub   { font-size: .72rem; color: var(--text-tertiary); margin-top: 2px; }

/* Color variants — subtle tinted backgrounds */
.stat-card.c-blue   { --card-accent: var(--blue);   background: var(--blue-bg); border-color: rgba(59,130,246,.2); }
.stat-card.c-green  { --card-accent: var(--green);  background: var(--green-bg); border-color: rgba(16,185,129,.2); }
.stat-card.c-orange { --card-accent: var(--orange); background: var(--orange-bg); border-color: rgba(245,158,11,.2); }
.stat-card.c-purple { --card-accent: var(--purple); background: var(--purple-bg); border-color: rgba(139,92,246,.2); }
.stat-card.c-red    { --card-accent: var(--red);    background: var(--red-bg); border-color: rgba(239,68,68,.2); }
.stat-card.c-teal   { --card-accent: var(--teal);   background: var(--teal-bg); border-color: rgba(20,184,166,.2); }

/* Text on tinted cards */
.stat-card.c-blue .stat-label, .stat-card.c-green .stat-label,
.stat-card.c-orange .stat-label, .stat-card.c-purple .stat-label,
.stat-card.c-red .stat-label,   .stat-card.c-teal .stat-label { color: var(--text-secondary); }
.stat-card.c-blue .stat-value   { color: var(--blue); }
.stat-card.c-green .stat-value  { color: var(--green); }
.stat-card.c-orange .stat-value { color: var(--orange); }
.stat-card.c-purple .stat-value { color: var(--purple); }
.stat-card.c-red .stat-value    { color: var(--red); }
.stat-card.c-teal .stat-value   { color: var(--teal); }
.stat-card.c-blue .stat-sub, .stat-card.c-green .stat-sub,
.stat-card.c-orange .stat-sub,  .stat-card.c-purple .stat-sub,
.stat-card.c-red .stat-sub,     .stat-card.c-teal .stat-sub { color: var(--text-tertiary); }

/* ══════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; }
table, table.tbl, table.table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
table th, table.tbl th, table.table th {
  padding: 10px 14px;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left; white-space: nowrap;
}
table td, table.tbl td, table.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
table tr:last-child td, table.tbl tr:last-child td, table.table tr:last-child td { border-bottom: none; }
table tr:hover td, table.tbl tr:hover td, table.table tr:hover td { background: var(--bg-elevated); }
table td:first-child, table.tbl td:first-child { color: var(--text-primary); font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: .65rem; font-weight: 700; white-space: nowrap;
}
.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-red    { background: var(--red-bg);    color: var(--red);    }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-teal   { background: var(--teal-bg);   color: var(--teal);   }
.badge-gray   { background: var(--bg-elevated); color: var(--text-tertiary); border: 1px solid var(--border-subtle); }

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: .82rem; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: all var(--trans);
  font-family: var(--font);
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-ring);
}
.btn-primary:hover { background: var(--accent-l); border-color: var(--accent-l); }
.btn-secondary {
  background: var(--bg-elevated); color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
  background: var(--red-bg); color: var(--red); border-color: rgba(239,68,68,.3);
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .75rem; }
.btn-xs { padding: 3px 9px; font-size: .7rem; border-radius: var(--radius-sm); }
.btn-ghost { background: none; border-color: var(--border-default); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .75rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius); color: var(--text-primary);
  font-size: .82rem; font-family: var(--font);
  outline: none; transition: border-color var(--trans), box-shadow var(--trans);
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.form-control::placeholder { color: var(--text-tertiary); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-right: 40px; }
.input-icon-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-tertiary); cursor: pointer;
  font-size: 14px; transition: color var(--trans);
}
.input-icon-btn:hover { color: var(--text-secondary); }

/* Search bar */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-input {
  flex: 1; padding: 8px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius); color: var(--text-primary);
  font-size: .82rem; font-family: var(--font); outline: none;
  transition: border-color var(--trans);
}
.search-input:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════ */
.alert {
  padding: 10px 14px; border-radius: var(--radius);
  font-size: .82rem; margin-bottom: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.alert-success { background: var(--green-bg); border: 1px solid rgba(16,185,129,.25); color: var(--green); border-left: 3px solid var(--green); }
.alert-error   { background: var(--red-bg);   border: 1px solid rgba(239,68,68,.25); color: var(--red); border-left: 3px solid var(--red); }
.alert-info    { background: var(--blue-bg);  border: 1px solid rgba(59,130,246,.25); color: var(--blue); border-left: 3px solid var(--blue); }
.alert-warning { background: var(--orange-bg); border: 1px solid rgba(245,158,11,.25); color: var(--orange); border-left: 3px solid var(--orange); }

/* ══════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
  transition: opacity var(--trans);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(.96) translateY(-8px); } to { opacity:1; transform:none; } }
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }

/* ══════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: var(--radius-lg);
  font-size: .8rem; font-weight: 600;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg); min-width: 220px; max-width: 340px;
  animation: toastIn .25s ease;
  color: var(--text-primary);
}
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
.toast.success { border-color: rgba(16,185,129,.3); background: var(--green-bg); color: var(--green); }
.toast.error   { border-color: rgba(239,68,68,.3);  background: var(--red-bg); color: var(--red); }
.toast.info    { border-color: rgba(59,130,246,.3);  background: var(--blue-bg); color: var(--blue); }

/* ══════════════════════════════════════════════════════════
   PROGRESS BARS
   ══════════════════════════════════════════════════════════ */
.progress-bar { height: 6px; background: var(--bg-elevated); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .3s ease; }
.progress-fill.green  { background: var(--green); }
.progress-fill.orange { background: var(--orange); }
.progress-fill.red    { background: var(--red); }

/* ══════════════════════════════════════════════════════════
   DANISAN / HASTA ROWS
   ══════════════════════════════════════════════════════════ */
.hasta-satir {
  display: flex; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border-subtle);
  transition: background var(--trans); cursor: pointer;
  gap: 12px;
}
.hasta-satir:last-child { border-bottom: none; }
.hasta-satir:hover { background: var(--bg-elevated); }
.hasta-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; flex-shrink: 0;
}
.hasta-ad { font-weight: 600; color: var(--text-primary); font-size: .85rem; }
.hasta-tel { font-size: .72rem; color: var(--text-tertiary); margin-top: 1px; }

/* ══════════════════════════════════════════════════════════
   CALENDAR
   ══════════════════════════════════════════════════════════ */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day  { min-height: 80px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 6px; font-size: .72rem; cursor: pointer; transition: background var(--trans), border-color var(--trans); }
.cal-day.header { min-height: auto; background: none; border: none; color: var(--text-tertiary); font-weight: 700; font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; }
.cal-day:hover  { background: var(--bg-overlay); }
.cal-day.today  { border-color: var(--accent); background: var(--accent-bg); }
.cal-day.other  { opacity: .4; }
.cal-day.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.rdv-bubble { font-size: .6rem; padding: 2px 5px; border-radius: 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--accent-bg); color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   PROFILE
   ══════════════════════════════════════════════════════════ */
.profile-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.profile-avatar-wrap { flex-shrink: 0; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; border: 3px solid var(--border-default);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .page-body { padding: 16px; }
  .stat-cards { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 40; transform: translateX(-100%);
    transition: transform var(--trans-slow);
    width: var(--sidebar-w) !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .sidebar-collapse-btn { display: none; }
  [data-sidebar="mini"] .sidebar { transform: translateX(-100%); }
  .page-header { padding: 0 16px; }
  .global-search-input { width: 130px; }
  .global-search-input:focus { width: 160px; }
  .header-user-text, .header-chevron { display: none; }
  .page-body { padding: 12px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .global-search-wrap { display: none; }
  .notif-dropdown { right: -60px; width: 260px; }
}

/* ══════════════════════════════════════════════════════════
   MISC UTILITIES
   ══════════════════════════════════════════════════════════ */
.text-muted    { color: var(--text-tertiary); }
.text-accent   { color: var(--accent); }
.text-success  { color: var(--green); }
.text-danger   { color: var(--red); }
.text-warning  { color: var(--orange); }
.font-mono     { font-family: var(--font-mono); }
.font-bold     { font-weight: 700; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.gap-16        { gap: 16px; }
.mt-16         { margin-top: 16px; }
.mb-16         { margin-bottom: 16px; }
.mb-24         { margin-bottom: 24px; }

/* Scrollbar global */
* { scrollbar-width: thin; scrollbar-color: var(--border-default) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ══════════════════════════════════════════════════════════
   COMPAT PATCH — Tüm sayfalardaki eksik class'lar
   QA Agent tespit — Tümü bu blokta tamamlandı
   ══════════════════════════════════════════════════════════ */

/* ── Eski CSS var alias'ları (tüm sayfalarda kullanılıyor) ── */
:root {
  --bg-0: var(--bg-canvas);
  --bg-1: var(--bg-surface);
  --bg-2: var(--bg-elevated);
  --bg-3: var(--bg-overlay);
  --text-1: var(--text-primary);
  --text-2: var(--text-secondary);
  --text-3: var(--text-tertiary);
  --border: var(--border-default);
  --accent-bg: rgba(20,184,166,.12);
  --radius: 8px;
  --radius-lg: 14px;
  --trans: .15s cubic-bezier(.4,0,.2,1);
  --shadow: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  --font: 'Geist','Nunito Sans',system-ui,sans-serif;
  --red: #ef4444;
  --green: #10b981;
  --orange: #f59e0b;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --teal: #14b8a6;
}
[data-theme="light"] {
  --bg-0: var(--bg-canvas);
  --bg-1: var(--bg-surface);
  --bg-2: var(--bg-elevated);
  --bg-3: var(--bg-overlay);
  --text-1: var(--text-primary);
  --text-2: var(--text-secondary);
  --text-3: var(--text-tertiary);
  --border: var(--border-default);
}

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--bg-canvas);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(20,184,166,.06) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.04) 0%, transparent 50%);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; font-weight: 800;
}
.login-logo-text { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); letter-spacing: -.01em; }
.login-title { font-size: .82rem; color: var(--text-tertiary); margin-bottom: 28px; line-height: 1.5; }
.login-links { margin-top: 16px; text-align: center; font-size: .78rem; color: var(--text-tertiary); }
.login-links a, .login-links button { color: var(--accent); font-size: .78rem; background: none; border: none; cursor: pointer; }
.login-links a:hover, .login-links button:hover { text-decoration: underline; }
.remember-row { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: .78rem; color: var(--text-secondary); }
.remember-row input[type="checkbox"] { accent-color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   DASHBOARD / INDEX
   ══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .grid-2, .form-row { grid-template-columns: 1fr; }
}
.chart-wrap {
  position: relative;
  height: 220px;
  margin-top: 8px;
}

/* Randevu tabs */
.rdv-tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); color: var(--text-secondary);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all var(--trans);
}
.rdv-tab-btn.active, .rdv-tab-btn:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-ring); }
.rdv-tab-panel { display: none; }
.rdv-tab-panel.active { display: block; }

/* Tab btn/panel (danışan kartı) */
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all var(--trans);
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover  { color: var(--text-primary); }
.tab-panel { display: none; padding: 20px 0; }
.tab-panel.active { display: block; }

/* Durum buttons (randevu status) */
.durum-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: .72rem; font-weight: 700; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  color: var(--text-secondary); transition: all var(--trans);
}
.durum-btn:hover { border-color: var(--accent); color: var(--accent); }
.durum-popover-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: .78rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: background var(--trans);
  border-bottom: 1px solid var(--border-subtle);
}
.durum-popover-item:last-child { border-bottom: none; }
.durum-popover-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.durum-popover-item.secili { color: var(--accent); font-weight: 700; }

/* Randevu kart */
.randevu-kart {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-subtle);
  transition: background var(--trans);
}
.randevu-kart:hover { background: var(--bg-elevated); }
.randevu-kart:last-child { border-bottom: none; }

/* Borç indicator */
.borc-ind {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .7rem; font-weight: 700;
  color: var(--red); background: var(--red-bg);
  padding: 2px 7px; border-radius: 99px;
}

/* Icon button */
.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: pointer; font-size: .82rem;
  transition: all var(--trans);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* ══════════════════════════════════════════════════════════
   PROFILE / HASTA
   ══════════════════════════════════════════════════════════ */
.profile-name  { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 3px; }
.profile-meta  { font-size: .78rem; color: var(--text-tertiary); display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.profile-meta span { display: flex; align-items: center; gap: 4px; }

/* ══════════════════════════════════════════════════════════
   ÖDEMELER
   ══════════════════════════════════════════════════════════ */
.eslesme-satir {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  font-size: .82rem;
}
.eslesme-satir:last-child { border-bottom: none; }
.eslesme-bilgi { flex: 1; }
.eslesme-tutar { font-weight: 700; color: var(--text-primary); white-space: nowrap; }

/* ══════════════════════════════════════════════════════════
   PORTAL (public danışan sayfası — kendi teması)
   ══════════════════════════════════════════════════════════ */
.pcard {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.pcard-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-tertiary); margin-bottom: 12px;
}
.section { display: none; }
.section.aktif { display: block; }

/* Portal layout */
.portal-header {
  background: linear-gradient(135deg, var(--accent-d), var(--accent));
  padding: 24px 20px; color: #fff;
}
.portal-brand { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.portal-name  { font-size: .85rem; opacity: .85; }
.portal-psk   { font-size: .75rem; opacity: .7; margin-top: 2px; }
.psk          { font-weight: 700; }
.portal-content { padding: 16px; max-width: 640px; margin: 0 auto; }
.portal-nav {
  display: flex; gap: 2px; overflow-x: auto;
  padding: 12px 16px 0; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.portal-nav a {
  padding: 8px 14px; font-size: .78rem; font-weight: 600;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  white-space: nowrap; cursor: pointer; transition: all var(--trans);
}
.portal-nav a.aktif { color: var(--accent); border-bottom-color: var(--accent); }

/* Portal stats */
.stat-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-box {
  flex: 1; min-width: 80px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 12px; text-align: center;
}
.stat-num { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); }
.stat-lbl { font-size: .65rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* Randevu items */
.randevu-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--border-subtle);
  border-radius: var(--radius); margin-bottom: 8px;
  background: var(--bg-surface);
}
.randevu-tarih-blok {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 44px; background: var(--accent-bg); border-radius: var(--radius);
  padding: 6px; flex-shrink: 0;
}
.ay   { font-size: .6rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.gun  { font-size: 1.2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.randevu-bilgi { flex: 1; }
.saat { font-size: .75rem; color: var(--text-tertiary); margin-top: 3px; }
.ico  { font-size: .9rem; }

/* Portal messages */
.msg-ok  { background: var(--green-bg);  border-left: 3px solid var(--green); color: var(--green); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; font-size: .82rem; }
.msg-err { background: var(--red-bg);    border-left: 3px solid var(--red);   color: var(--red);   padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; font-size: .82rem; }
.b-green { color: var(--green); font-weight: 700; }

/* Portal avatar */
.portal-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; flex-shrink: 0;
}
.portal-user { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

/* Empty state */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-tertiary);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state .empty-title { font-size: .9rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state .empty-sub   { font-size: .78rem; line-height: 1.6; }

/* ══════════════════════════════════════════════════════════
   MISC COMPONENT FIXES
   ══════════════════════════════════════════════════════════ */
/* Hidden utility */
.hidden { display: none !important; }

/* Inline color utilities used in PHP */
.green  { color: var(--green); }
.red    { color: var(--red); }
.orange { color: var(--orange); }
.blue   { color: var(--blue); }

/* badge-red alias */
.badge-red { background: var(--red-bg); color: var(--red); }

/* btn-ghost was already defined but alias needed */
.btn-outline {
  background: none; border: 1px solid var(--border-default);
  color: var(--text-secondary); border-radius: var(--radius);
  padding: 8px 16px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all var(--trans);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* table: tbl alias (used in many pages as class="tbl") */
table.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.tbl th {
  padding: 10px 14px; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-tertiary); border-bottom: 1px solid var(--border-subtle);
  text-align: left; white-space: nowrap;
}
table.tbl td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary); vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--bg-elevated); }
table.tbl td:first-child { color: var(--text-primary); font-weight: 600; }

/* Hafıza: input disabled & read-only */
input:disabled, select:disabled, textarea:disabled {
  opacity: .5; cursor: not-allowed;
}
input[readonly], textarea[readonly] {
  background: var(--bg-elevated); cursor: default;
}

/* Responsive: stats-grid on mobile */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-nav { padding: 8px 8px 0; }
  .portal-nav a { padding: 6px 10px; font-size: .72rem; }
}
