/* ==========================================================================
   DZHIRASENA — DESIGN SYSTEM v2.0
   Clean · Professional · Fully Responsive
   ========================================================================== */

/* ── 1. DESIGN TOKENS ────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:          #2563EB;
  --brand-dark:     #1D4ED8;
  --brand-light:    #EFF6FF;
  --brand-muted:    #DBEAFE;

  /* Neutrals */
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-tertiary:  #94A3B8;
  --text-inverse:   #FFFFFF;

  /* Surfaces */
  --bg-app:         #F8FAFC;
  --bg-card:        #FFFFFF;
  --bg-subtle:      #F1F5F9;
  --bg-sidebar:     #FFFFFF;

  /* Borders */
  --border:         #E2E8F0;
  --border-focus:   #2563EB;

  /* Semantic */
  --success:        #10B981;
  --success-bg:     #ECFDF5;
  --success-text:   #065F46;
  --warning:        #F59E0B;
  --warning-bg:     #FFFBEB;
  --danger:         #EF4444;
  --danger-bg:      #FEF2F2;
  --danger-text:    #991B1B;
  --info:           #2563EB;
  --info-bg:        #EFF6FF;

  /* Priority */
  --prio-high:      #EF4444;
  --prio-high-bg:   #FEF2F2;
  --prio-med:       #2563EB;
  --prio-med-bg:    #EFF6FF;
  --prio-low:       #64748B;
  --prio-low-bg:    #F8FAFC;

  /* Radius */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.04);

  /* Layout */
  --sidebar-w:  260px;
  --header-h:   64px;

  /* Transitions */
  --transition: 0.18s ease;
}

/* ── DARK MODE TOKENS ─────────────────────────────────────────────────────── */
body.dark-theme {
  --brand:          #3B82F6;
  --brand-dark:     #2563EB;
  --brand-light:    #1E3A5F;
  --brand-muted:    #1E40AF;
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary:  #64748B;
  --bg-app:         #0F172A;
  --bg-card:        #1E293B;
  --bg-subtle:      #253047;
  --bg-sidebar:     #1E293B;
  --border:         #334155;
  --success-bg:     #064E3B;
  --warning-bg:     #78350F;
  --danger-bg:      #7F1D1D;
  --info-bg:        #1E3A5F;
  --prio-high-bg:   #7F1D1D;
  --prio-med-bg:    #1E3A5F;
  --prio-low-bg:    #253047;
}

/* ── 2. RESET & BASE ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-app);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6,
.btn, .stat-value, .brand-logo {
  font-family: 'Outfit', 'Inter', sans-serif;
}

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-dark); }

input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }

/* ── 3. BUTTONS ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn svg { flex-shrink: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(37,99,235,.2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--text-tertiary);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-block { width: 100%; }

.btn-sm {
  padding: 6px 12px;
  font-size: .8125rem;
  border-radius: var(--r-sm);
}

.btn-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-weight: 600;
  font-size: .875rem;
  color: var(--danger);
  transition: all var(--transition);
}
.btn-logout:hover { background: var(--danger-bg); border-color: var(--danger); }

/* Icon-only action buttons */
.action-btn-primary, .action-btn-danger, .action-btn-info, .action-btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: none; border-radius: var(--r-sm);
  cursor: pointer; transition: all var(--transition);
  background: transparent;
}
.action-btn-primary { color: var(--brand); }
.action-btn-primary:hover { background: var(--brand-light); }
.action-btn-danger  { color: var(--danger); }
.action-btn-danger:hover  { background: var(--danger-bg); }
.action-btn-info    { color: var(--brand); }
.action-btn-info:hover    { background: var(--brand-light); }
.action-btn-icon:hover    { background: var(--bg-subtle); }

/* ── 4. FORM ELEMENTS ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .8125rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
  letter-spacing: .01em;
}

.form-group input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.form-group select,
.form-group textarea,
select, textarea,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: .875rem;
  transition: all var(--transition);
  outline: none;
}

.form-group input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):focus,
.form-group select:focus, .form-group textarea:focus,
select:focus, textarea:focus,
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="number"]:focus, input[type="date"]:focus {
  border-color: var(--brand);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* input with icon */
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 13px; color: var(--text-tertiary); pointer-events: none; }
.input-wrapper input { padding-left: 40px !important; }
.toggle-password {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 4px;
}
.toggle-password:hover { color: var(--text-primary); }

.form-row { display: flex; gap: 14px; }
.col-6 { flex: 1; min-width: 0; }

/* Custom checkbox */
.checkbox-container {
  display: flex; align-items: center;
  position: relative; padding-left: 26px;
  cursor: pointer; user-select: none;
  color: var(--text-secondary); font-size: .875rem;
}
.checkbox-container input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkmark {
  position: absolute; left: 0;
  width: 17px; height: 17px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 4px; transition: all var(--transition);
}
.checkbox-container:hover .checkmark { border-color: var(--brand); }
.checkbox-container input:checked ~ .checkmark { background: var(--brand); border-color: var(--brand); }
.checkmark::after {
  content: ""; position: absolute; display: none;
  left: 5px; top: 2px; width: 4px; height: 8px;
  border: 2px solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark::after { display: block; }

/* ── 5. LOGIN SCREEN ──────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  padding: 24px 16px;
}

body.dark-theme .login-screen {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

.login-screen::before {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 0%, rgba(37,99,235,.08) 0%, transparent 60%);
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 420px;
  animation: fadeUp .4s ease-out;
  position: relative; z-index: 1;
}

.login-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 28px;
}
.logo-icon {
  background: var(--brand);
  color: #fff;
  padding: 9px;
  border-radius: var(--r-md);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.login-logo h2 { font-size: 22px; font-weight: 800; color: var(--brand); }

.login-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 36px 32px;
  border: 1px solid var(--border);
}

.login-header { margin-bottom: 24px; }
.login-header h3 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-header p { color: var(--text-secondary); font-size: .875rem; }

.label-row { display: flex; justify-content: space-between; align-items: center; }
.forgot-link { font-size: .8125rem; font-weight: 600; }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: .875rem;
}
.login-footer a { font-weight: 600; }
.login-footer .copyright { margin-top: 20px; font-size: .75rem; color: var(--text-tertiary); }

.footer-meta {
  margin-top: 20px;
  font-size: .75rem;
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.status-indicator-green {
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

.divider {
  display: flex; align-items: center;
  margin: 20px 0;
  color: var(--text-tertiary); font-size: .75rem; font-weight: 600; letter-spacing: .05em;
}
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider:not(:empty)::before { margin-right: 12px; }
.divider:not(:empty)::after  { margin-left: 12px; }

/* ── 6. APP SHELL LAYOUT ──────────────────────────────────────────────────── */
.app-screen { min-height: 100vh; display: flex; }

/* Desktop Sidebar */
.desktop-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 0;
  overflow-y: auto;
}

/* Sidebar brand */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-brand-icon {
  background: var(--brand);
  color: #fff;
  padding: 8px;
  border-radius: var(--r-md);
}
.sidebar-brand h2 { font-size: 17px; font-weight: 800; color: var(--brand); }

/* Sidebar profile */
.sidebar-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.profile-avatar { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.user-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--brand-muted);
}
.profile-avatar .active-badge {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px;
  background: var(--success);
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
}
.profile-info h4 { font-weight: 600; font-size: .875rem; line-height: 1.3; }
.profile-info p  { color: var(--text-tertiary); font-size: .75rem; }

/* Nav */
.sidebar-nav { flex: 1; }
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: .875rem;
  border-radius: var(--r-md);
  transition: all var(--transition);
}
.nav-item a:hover { color: var(--brand); background: var(--brand-light); }
.nav-item.active a {
  color: var(--brand);
  background: var(--brand-light);
  font-weight: 600;
}
.nav-item.active a svg { stroke: var(--brand); }

/* Sidebar footer */
.sidebar-footer { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px; }
.app-version-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: .6875rem; color: var(--text-tertiary);
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
}
.active-dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2.5s infinite;
}

/* Main layout */
.main-layout {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

/* ── 7. DESKTOP HEADER ────────────────────────────────────────────────────── */
.desktop-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 90;
  gap: 16px;
}
.header-logo { display: flex; align-items: center; gap: 8px; }
.logo-tick { background: var(--brand-light); padding: 5px; border-radius: 50%; }
.header-logo h2 { font-size: 17px; font-weight: 800; color: var(--brand); }

.header-controls { display: flex; align-items: center; gap: 12px; }

.search-bar { position: relative; display: flex; align-items: center; }
.search-bar svg { position: absolute; left: 12px; color: var(--text-tertiary); pointer-events: none; }
.search-bar input {
  padding: 8px 14px 8px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  width: 220px; outline: none;
  font-size: .875rem;
  transition: all var(--transition);
  color: var(--text-primary);
}
.search-bar input:focus {
  width: 280px;
  background: var(--bg-card);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.control-btn {
  background: none; border: none;
  cursor: pointer; color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); position: relative;
}
.control-btn:hover { background: var(--bg-subtle); color: var(--brand); }

.notification-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 3px;
  background: var(--danger);
  color: #fff; border-radius: 99px;
  border: 2px solid var(--bg-card);
  font-size: .625rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.desktop-profile-wrapper { position: relative; cursor: pointer; }
.header-profile-img {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-radius: 50%; object-fit: cover;
  transition: border-color var(--transition);
}
.header-profile-img:hover { border-color: var(--brand); }

/* Dropdown */
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  width: 210px;
  display: none; flex-direction: column;
  overflow: hidden;
  animation: slideDown .18s ease-out;
  z-index: 150;
}
.dropdown-menu.show { display: flex; }
.dropdown-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dropdown-header strong { display: block; font-weight: 600; font-size: .875rem; }
.dropdown-header span { color: var(--text-tertiary); font-size: .75rem; }
.dropdown-divider { border-top: 1px solid var(--border); }
.dropdown-item { padding: 10px 16px; color: var(--text-primary); font-size: .875rem; transition: background var(--transition); display: block; }
.dropdown-item:hover { background: var(--bg-subtle); color: var(--brand); }

/* ── 8. CONTENT AREA ──────────────────────────────────────────────────────── */
.content-container { padding: 28px 32px; flex: 1; max-width: 1400px; width: 100%; }

.view-header-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.view-title { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -.3px; }
.view-subtitle { color: var(--text-secondary); font-size: .875rem; margin-top: 3px; }

/* ── 9. METRICS CARDS ─────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.metric-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.blue-bg   { background: var(--brand-light); }
.green-bg  { background: var(--success-bg); }
.orange-bg { background: var(--warning-bg); }
.red-bg    { background: var(--danger-bg); }

.metric-info span {
  font-size: .6875rem; font-weight: 700;
  color: var(--text-tertiary); letter-spacing: .05em; text-transform: uppercase;
}
.metric-info h3 { font-size: 28px; font-weight: 800; line-height: 1.1; margin: 2px 0; }
.stat-trend  { font-size: .75rem; font-weight: 600; }
.trend-up    { color: var(--success); }
.trend-down  { color: var(--danger); }
.trend-neutral { color: var(--text-tertiary); }

/* ── 10. SECTION TITLES & FILTERS ────────────────────────────────────────── */
.section-title-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.section-title-row h2 { font-size: 17px; font-weight: 700; }

.filter-controls { display: flex; gap: 10px; align-items: center; }
.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  cursor: pointer; font-size: .875rem;
  color: var(--text-primary); outline: none;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--brand); }

/* Toolbar (tasks page) */
.toolbar-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
}
.toolbar-search {
  position: relative; display: flex; align-items: center;
  flex: 1; min-width: 180px;
}
.toolbar-search svg { position: absolute; left: 12px; color: var(--text-tertiary); pointer-events: none; }
.toolbar-search input {
  width: 100%; padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-subtle); outline: none;
  font-size: .875rem; color: var(--text-primary);
  transition: all var(--transition);
}
.toolbar-search input:focus { border-color: var(--brand); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.toolbar-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar-select {
  padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-subtle); cursor: pointer;
  min-width: 130px; outline: none;
  font-size: .875rem; color: var(--text-primary);
  transition: all var(--transition);
}
.toolbar-select:focus { border-color: var(--brand); background: var(--bg-card); }

/* ── 11. DASHBOARD LAYOUT ─────────────────────────────────────────────────── */
.dashboard-split-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

/* ── 12. TASK CARDS ───────────────────────────────────────────────────────── */
.task-list-wrapper {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 560px; overflow-y: auto;
  padding-right: 4px; padding-bottom: 4px;
}
.task-list-wrapper::-webkit-scrollbar { width: 4px; }
.task-list-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.view-all-tasks-wrapper { max-height: none; overflow: visible; }

.task-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  padding: 16px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}
.task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
  border-left-color: inherit;
  transform: translateY(-1px);
}
.task-card.prio-tinggi { border-left-color: var(--prio-high); }
.task-card.prio-sedang { border-left-color: var(--prio-med); }
.task-card.prio-rendah { border-left-color: var(--prio-low); }

.task-checkbox-col { display: flex; align-items: flex-start; padding-top: 2px; }
.task-card-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  background: var(--bg-card); flex-shrink: 0;
}
.task-card-check svg { color: #fff; display: none; }
.task-card-check:hover { border-color: var(--success); background: var(--success-bg); }
.task-card.completed .task-card-check { background: var(--success); border-color: var(--success); }
.task-card.completed .task-card-check svg { display: block; }

.task-content-col { flex: 1; min-width: 0; }
.task-tags-row { display: flex; gap: 6px; margin-bottom: 7px; flex-wrap: wrap; }

.task-title  { font-size: .9375rem; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; word-break: break-word; line-height: 1.4; }
.task-desc   { font-size: .8125rem; color: var(--text-secondary); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-tertiary); font-size: .75rem; }
.task-meta span { display: flex; align-items: center; gap: 4px; }
.task-meta-row  { display: flex; align-items: center; gap: 14px; color: var(--text-tertiary); font-size: .75rem; flex-wrap: wrap; }
.task-meta-item { display: flex; align-items: center; gap: 5px; }

.task-card.completed { opacity: .6; }
.task-card.completed .task-title { text-decoration: line-through; color: var(--text-tertiary); }

.task-actions-col { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.task-actions {
  display: flex; gap: 4px; opacity: 0;
  transition: opacity var(--transition); align-self: center;
}
.task-card:hover .task-actions { opacity: 1; }

/* Task assignee avatar */
.task-assignee-avatar { margin-top: 8px; }
.task-assignee-avatar img {
  width: 26px; height: 26px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--bg-card);
  display: inline-block;
  margin-right: -6px;
}

/* ── 13. TAGS / BADGES ────────────────────────────────────────────────────── */
.tag {
  font-size: .6875rem; font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase; letter-spacing: .03em;
  display: inline-flex; align-items: center;
}
.tag-prio-tinggi { background: var(--prio-high-bg); color: var(--prio-high); }
.tag-prio-sedang { background: var(--prio-med-bg);  color: var(--prio-med);  }
.tag-prio-rendah { background: var(--prio-low-bg);  color: var(--prio-low);  }
.tag-cat-generic { background: var(--bg-subtle); color: var(--text-secondary); }
.tag-cat-finance  { background: #F5F3FF; color: #7C3AED; }
.tag-cat-design   { background: var(--success-bg); color: #059669; }
.tag-cat-marketing{ background: #FFF1F2; color: #E11D48; }
.tag-cat-it       { background: #FFF7ED; color: #EA580C; }
.tag-status-running   { background: var(--brand-light); color: var(--brand); }
.tag-status-completed { background: var(--success-bg); color: var(--success-text); }

.role-badge {
  font-size: .6875rem; font-weight: 700;
  padding: 4px 9px; border-radius: var(--r-full);
  display: inline-block;
}
.role-badge.role-admin { background: var(--brand-light); color: var(--brand); }
.role-badge.role-pm    { background: #F5F3FF; color: #7C3AED; }
.role-badge.role-staff { background: var(--bg-subtle); color: var(--text-secondary); }

/* ── 14. WIDGETS / CARDS ──────────────────────────────────────────────────── */
.widget-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}
.widget-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* bg-white-card alias */
.bg-white-card { background: var(--bg-card); border: 1px solid var(--border); }

/* Progress bar */
.progress-widget-card { background: var(--bg-card); }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.progress-header h3 { margin-bottom: 0; }
.progress-header span { font-size: 17px; font-weight: 800; color: var(--success); }
.progress-bar-container { height: 7px; background: var(--bg-subtle); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #10B981, #059669); border-radius: 99px; transition: width .5s ease-out; }
.progress-meta { font-size: .75rem; color: var(--text-secondary); }

/* ── 15. TABLE STYLES ─────────────────────────────────────────────────────── */
.table-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  /* Do NOT use overflow:hidden — it blocks horizontal scroll inside table-responsive */
  overflow: visible;
  box-shadow: var(--shadow-xs);
}
/* Clip the rounded corners visually while allowing scroll */
.table-card > .table-responsive:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.table-card > .table-responsive:last-child  { border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; }
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Clip border-radius */
  border-radius: inherit;
}

.user-table { width: 100%; border-collapse: collapse; text-align: left; }
.user-table th {
  background: var(--bg-subtle);
  padding: 13px 20px;
  font-weight: 700; font-size: .6875rem;
  color: var(--text-tertiary); letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.user-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle; font-size: .875rem;
}
.user-table tbody tr { transition: background var(--transition); }
.user-table tbody tr:hover { background: var(--bg-subtle); }
.user-table tr:last-child td { border-bottom: none; }
.hoverable-row { transition: background var(--transition); }
.hoverable-row:hover { background: var(--bg-subtle) !important; }

.table-user-info { display: flex; align-items: center; gap: 10px; }
.table-user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.table-user-name { font-weight: 600; font-size: .875rem; line-height: 1.3; }
.table-user-email { font-size: .75rem; color: var(--text-tertiary); }

/* ── 16. TOGGLE SWITCH ────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #CBD5E1; border-radius: 99px; transition: .25s;
}
.slider::before {
  content: ""; position: absolute;
  width: 15px; height: 15px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .25s;
  box-shadow: var(--shadow-xs);
}
input:checked + .slider { background: var(--success); }
input:checked + .slider::before { transform: translateX(17px); }

.status-row-indicator { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; font-size: .8125rem; }
.status-active   { color: var(--success); }
.status-inactive { color: var(--text-tertiary); }

/* ── 17. MODALS ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn .18s ease-out;
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 520px;
  max-height: 92vh; overflow-y: auto;
  animation: slideUp .22s ease-out;
  border: 1px solid var(--border);
}
.modal-content-wide { max-width: 780px !important; }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 6px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.modal-body { padding: 22px; }
#add-user-form, #add-task-form-mobile { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-title { font-size: 16px; font-weight: 700; }
.btn-close-modal {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 4px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-close-modal:hover { background: var(--bg-subtle); color: var(--text-primary); }

/* Task detail */
.task-detail-layout { display: flex; flex-direction: column; gap: 20px; padding: 20px; overflow-y: auto; }
@media (min-width: 640px) {
  .task-detail-layout { flex-direction: row; }
  .task-detail-left  { flex: 1; border-right: 1px solid var(--border); padding-right: 20px; }
  .task-detail-right { flex: 1; padding-left: 20px; }
}
.task-detail-info-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 20px; }
.detail-info-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: .6875rem; color: var(--text-tertiary); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* ── 18. PRIORITY SELECTOR ────────────────────────────────────────────────── */
.priority-selector {
  display: flex; background: var(--bg-subtle);
  padding: 4px; border-radius: var(--r-md); gap: 0;
}
.priority-selector input[type="radio"] { display: none; }
.prio-btn {
  flex: 1; text-align: center;
  padding: 7px 10px; border-radius: var(--r-sm);
  border: none; background: transparent;
  cursor: pointer; font-weight: 600; font-size: .8125rem;
  color: var(--text-tertiary); transition: all var(--transition);
}
#prio-high:checked + .prio-high-label,
#prio-high-mob:checked + .prio-high-label,
#edit-prio-high:checked + .prio-high-label {
  background: var(--bg-card); color: var(--prio-high);
  box-shadow: var(--shadow-sm);
}
#prio-medium:checked + .prio-medium-label,
#prio-medium-mob:checked + .prio-medium-label,
#edit-prio-medium:checked + .prio-medium-label {
  background: var(--bg-card); color: var(--prio-med);
  box-shadow: var(--shadow-sm);
}
#prio-low:checked + .prio-low-label,
#prio-low-mob:checked + .prio-low-label,
#edit-prio-low:checked + .prio-low-label {
  background: var(--bg-card); color: var(--prio-low);
  box-shadow: var(--shadow-sm);
}

/* ── 19. TOAST NOTIFICATIONS ──────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 400; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  min-width: 260px; max-width: 380px;
  border-left: 4px solid var(--border);
  pointer-events: auto;
  animation: slideInRight .25s ease-out;
}
.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--brand); }
.toast-message { font-size: .8125rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }

/* ── 20. NOTIFICATIONS PANEL ──────────────────────────────────────────────── */
.notification-wrapper { position: relative; }
.notification-dropdown { width: 310px; max-height: 420px; padding: 0; }
.notification-list { overflow-y: auto; max-height: 340px; display: flex; flex-direction: column; }
.notification-item {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-start;
  transition: background var(--transition); cursor: pointer;
}
.notification-item:hover { background: var(--bg-subtle); }
.notification-item.unread { background: var(--brand-light); }
.notification-item.unread:hover { background: #dbeafe; }
.notification-item-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notification-item-icon.icon-task_added    { background: var(--brand-light); color: var(--brand); }
.notification-item-icon.icon-task_completed{ background: var(--success-bg); color: var(--success); }
.notification-item-icon.icon-info          { background: var(--warning-bg); color: var(--warning); }
.notification-item-content { flex: 1; min-width: 0; }
.notification-item-text  { font-size: .8125rem; color: var(--text-primary); line-height: 1.4; word-break: break-word; }
.notification-item-time  { font-size: .6875rem; color: var(--text-tertiary); margin-top: 3px; }
.notification-empty { padding: 28px 14px; text-align: center; color: var(--text-secondary); font-size: .8125rem; }

/* ── 21. EMPTY STATE ──────────────────────────────────────────────────────── */
.empty-state-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1.5px dashed var(--border);
  padding: 56px 32px;
  text-align: center;
  max-width: 440px; margin: 40px auto;
}
.empty-state-icon { margin-bottom: 14px; color: var(--text-tertiary); }
.empty-state-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.empty-state-card p  { color: var(--text-secondary); font-size: .875rem; }

/* ── 22. PROFILE PAGE ─────────────────────────────────────────────────────── */
.profile-settings-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  max-width: 580px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.settings-avatar-section {
  display: flex; align-items: center; gap: 20px;
  padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.large-avatar   { width: 72px; height: 72px; }
.avatar-container { position: relative; display: inline-block; }
.change-avatar-overlay {
  position: absolute; bottom: -2px; right: -2px;
  background: var(--brand); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid var(--bg-card);
  transition: all var(--transition);
}
.change-avatar-overlay:hover { background: var(--brand-dark); transform: scale(1.1); }
.settings-avatar-info h3 { font-size: 17px; font-weight: 700; }
.settings-avatar-info p  { color: var(--text-secondary); font-size: .8125rem; margin: 3px 0 7px; }
.settings-fields-section { display: flex; flex-direction: column; gap: 0; }

/* ── 23. TEAM / CATEGORY LAYOUT ───────────────────────────────────────────── */
.team-grid-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px; align-items: start;
}
.category-card { background: var(--bg-card); }
.category-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  font-size: .875rem; font-weight: 500;
  transition: background var(--transition);
}
.category-item:hover { background: var(--brand-light); }
.category-item-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 3px;
  border-radius: var(--r-sm); transition: all var(--transition);
  display: flex; align-items: center;
}
.category-item-delete:hover { color: var(--danger); background: var(--danger-bg); }

/* ── 24. PAGINATION ───────────────────────────────────────────────────────── */
#archive-pagination-container {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 24px 0 8px; flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card); cursor: pointer;
  font-size: .875rem; font-weight: 600; color: var(--text-secondary);
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── 25. ANIMATIONS ───────────────────────────────────────────────────────── */
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideUp    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes slideDown  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft  { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .7; }
}

/* ── 26. MOBILE NAV (hidden on desktop) ──────────────────────────────────── */
.mobile-header     { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-only-btn   { display: none; }

/* ── 27. RESPONSIVE — TABLET & MOBILE (≤1024px) ──────────────────────────── */
@media (max-width: 1024px) {
  .desktop-sidebar {
    display: none !important;
  }
  
  .mobile-sidebar-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    z-index: 190; display: none; opacity: 0; transition: opacity 0.3s;
  }
  .mobile-sidebar-overlay.show { display: block; opacity: 1; }

  .desktop-header  { display: none; }
  .main-layout     { margin-left: 0; padding-top: 56px; padding-bottom: 72px; width: 100%; max-width: 100vw; min-width: 0; }

  /* ── Mobile Header ── */
  .mobile-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; z-index: 90;
    box-shadow: var(--shadow-sm);
  }
  .mobile-only-search { display: block; }

  .mobile-menu-btn {
    display: none !important;
  }
  .mobile-menu-btn:hover { background: var(--bg-subtle); }
  .mobile-logo { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 16px; color: var(--brand); }
  .mobile-user-avatar { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; object-fit: cover; border: 2px solid var(--border); }

  /* ── Mobile Bottom Navigation ── */
  .mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 62px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 14px rgba(0,0,0,.08);
  }
  .bottom-nav-item {
    background: none; border: none;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--text-tertiary); cursor: pointer;
    font-size: .6875rem; font-weight: 600;
    flex: 1; padding: 8px 4px;
    transition: color var(--transition);
    border-radius: var(--r-md);
  }
  .bottom-nav-item svg { transition: transform var(--transition); }
  .bottom-nav-item:hover svg { transform: translateY(-2px); }
  .bottom-nav-item.active { color: var(--brand); }
  .bottom-nav-item.active svg { stroke: var(--brand); }

  /* ── Content Spacing ── */
  .content-container { padding: 16px 14px; width: 100%; max-width: 100vw; min-width: 0; box-sizing: border-box; }
  .view-header-row   { margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
  .view-title        { font-size: 18px; }
  .view-subtitle     { font-size: 12px; }

  /* ── Dashboard layout ── */
  .dashboard-split-layout { grid-template-columns: 1fr; gap: 16px; }
  .desktop-task-widget { display: none; }
  .mobile-only-btn { display: inline-flex; }

  /* ── Toolbar ── */
  .toolbar-card {
    flex-direction: column; align-items: stretch;
    padding: 12px 14px; gap: 10px;
  }
  .toolbar-filters { flex-direction: column; gap: 8px; }
  .toolbar-select { width: 100%; min-width: unset; }
  .toolbar-search { width: 100%; }
  .toolbar-search input { width: 100%; }

  /* ── Metrics grid: 2 col on tablet ── */
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* ── Task card mobile ── */
  .task-card {
    padding: 12px 14px;
    gap: 10px;
  }
  .task-card-check { width: 20px; height: 20px; flex-shrink: 0; }
  .task-tags-row { flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
  .task-title { font-size: .875rem; }
  .task-desc  { font-size: .75rem; -webkit-line-clamp: 2; }
  .task-meta-row { gap: 10px; }
  /* Hide assignee column (shown inline in meta already) */
  .task-assignee-col { display: none; }
  /* Always show action buttons on mobile (no hover required) */
  .task-actions { opacity: 1; }

  /* ── Tables ── */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .user-table th, .user-table td { padding: 11px 14px; font-size: .8125rem; white-space: nowrap; }

  /* ── Team layout ── */
  .team-grid-layout { grid-template-columns: 1fr; }

  /* ── Charts grid (laporan) ── */
  #charts-grid { grid-template-columns: 1fr !important; }
  #charts-grid > div[style*='grid-column: span 2'],
  #charts-grid .table-card[style*='grid-column: span 2'] { grid-column: span 1 !important; }

  /* ── Toast ── */
  .toast-container { top: 64px; right: 10px; left: 10px; }
  .toast { min-width: unset; max-width: 100%; font-size: .8125rem; }

  /* ── Section title row ── */
  .section-title-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .filter-controls { width: 100%; flex-wrap: wrap; }
  .filter-select { flex: 1; min-width: 120px; }
}

/* ── 28. RESPONSIVE — SMALL PHONES (≤480px) ──────────────────────────────── */
@media (max-width: 480px) {
  /* Layout */
  .content-container { padding: 12px 12px; }
  .view-header-row   { flex-direction: column; align-items: stretch; gap: 8px; }
  .view-header-row .btn { width: 100%; justify-content: center; }
  .view-title { font-size: 17px; }

  /* Metrics */
  .metrics-grid { grid-template-columns: 1fr; gap: 10px; }
  .metric-card  { padding: 14px 16px; gap: 12px; }
  .metric-info h3 { font-size: 22px; }
  .metric-mini-bar { display: none; } /* saves space */

  /* Forms */
  .form-row { flex-direction: column; gap: 0; }
  .form-group { margin-bottom: 14px; }
  label { font-size: 12px; }

  /* Task card slim */
  .task-card { padding: 10px 12px; gap: 8px; }
  .task-title { font-size: .8375rem; }
  .task-tags-row .tag { font-size: .6rem; padding: 2px 6px; }
  .task-meta-row { gap: 8px; font-size: .7rem; }

  /* Toolbar */
  .toolbar-card { padding: 10px 12px; gap: 8px; }

  /* Section title */
  .section-title-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .filter-controls   { width: 100%; flex-wrap: wrap; gap: 6px; }
  .filter-select     { flex: 1 1 140px; }

  /* Modals — full bottom sheet */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-content {
    max-width: 100%; max-height: 94vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: slideUp .22s ease-out;
  }
  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }

  /* Tables */
  .table-card { border-radius: var(--r-md); }
  .user-table th, .user-table td { padding: 9px 10px; font-size: .75rem; }
  .table-user-email { display: none; } /* hide email column on tiny screens */

  /* Notifications */
  .notification-dropdown {
    position: fixed; top: 56px; left: 8px; right: 8px;
    width: auto; z-index: 200; max-height: 60vh;
  }

  /* Profile settings */
  .profile-settings-card { padding: 16px; }
  .settings-avatar-section { flex-direction: column; text-align: center; gap: 12px; }

  /* Task list */
  .task-list-wrapper { max-height: none; overflow: visible; padding-right: 0; }

  /* Charts on tiny screen */
  #charts-grid > div { padding: 14px !important; }

  /* Honor & Laporan table — make key columns narrower */
  .honor-amount-input { width: 110px; font-size: .8rem; }

  /* Bottom nav label truncation */
  .bottom-nav-item { font-size: .6rem; }

  /* Notification badge */
  .notification-badge { min-width: 14px; height: 14px; font-size: .5625rem; }
}

/* ── 29. MISC COMPONENTS ──────────────────────────────────────────────────── */

/* Form control alias */
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg-subtle); border: 1.5px solid var(--border);
  border-radius: var(--r-md); color: var(--text-primary);
  font-family: inherit; font-size: .875rem;
  transition: all var(--transition); outline: none;
}
.form-control:focus { border-color: var(--brand); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* Input standalone (outside form-group) */
.input {
  padding: 9px 12px;
  background: var(--bg-subtle); border: 1.5px solid var(--border);
  border-radius: var(--r-md); color: var(--text-primary);
  font-family: inherit; font-size: .875rem;
  transition: all var(--transition); outline: none;
}
.input:focus { border-color: var(--brand); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* Social login buttons */
.social-login { display: flex; gap: 12px; }
.btn-social {
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--text-primary); flex: 1; padding: 10px;
  border-radius: var(--r-md); cursor: pointer; font-size: .875rem;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all var(--transition); font-weight: 500;
}
.btn-social:hover { background: var(--bg-subtle); border-color: var(--text-tertiary); }

/* Honor input */
.honor-amount-input {
  width: 140px; text-align: right; font-weight: 600;
  padding: 7px 12px; font-size: .875rem;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-subtle); color: var(--text-primary);
  transition: all var(--transition); outline: none;
}
.honor-amount-input:focus { border-color: var(--brand); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* Attachments */
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachment-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-full); font-size: .75rem; font-weight: 500;
  color: var(--text-secondary);
}
.attachment-chip a { color: var(--brand); }
.attachment-chip button {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 0; line-height: 1;
}
.attachment-chip button:hover { color: var(--danger); }

/* Progress update items */
.progress-update-item {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  font-size: .8125rem;
  border-left: 3px solid var(--brand);
}
.progress-update-meta { font-size: .6875rem; color: var(--text-tertiary); margin-bottom: 3px; font-weight: 600; }

/* Assignee avatars stacked */
.assignee-avatar { width: 28px; height: 28px; position: relative; }
.assignee-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Mobile slide-out sidebar */
.mobile-sidebar-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  z-index: 150; display: none;
}
.mobile-sidebar-overlay.show { display: block; animation: fadeIn .2s; }
.mobile-sidebar {
  position: fixed; top: 0; left: -100%; bottom: 0;
  width: min(300px, 80vw);
  background: var(--bg-card); z-index: 160;
  display: flex; flex-direction: column;
  padding: 24px 16px;
  transition: left .25s ease-out;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.mobile-sidebar.open { left: 0; }

/* Dropdown notif on mobile */
@media (max-width: 480px) {
  .notification-badge { min-width: 14px; height: 14px; font-size: .5625rem; }
}

/* Dark mode adjustments */
body.dark-theme .login-card          { border-color: var(--border); }
body.dark-theme .task-card           { background: var(--bg-card); }
body.dark-theme .metric-card         { background: var(--bg-card); }
body.dark-theme .widget-card         { background: var(--bg-card); }
body.dark-theme .table-card          { background: var(--bg-card); }
body.dark-theme .toolbar-card        { background: var(--bg-card); }
body.dark-theme .modal-content       { background: var(--bg-card); }
body.dark-theme .desktop-sidebar     { background: var(--bg-sidebar); border-color: var(--border); }
body.dark-theme .desktop-header      { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .mobile-header       { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .mobile-bottom-nav   { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .dropdown-menu       { background: var(--bg-card); border-color: var(--border); }
body.dark-theme .modal-header        { background: var(--bg-card); }
body.dark-theme .user-table th       { background: var(--bg-subtle); }
body.dark-theme select,
body.dark-theme .toolbar-select,
body.dark-theme .filter-select,
body.dark-theme .form-control,
body.dark-theme .input              { background: var(--bg-subtle); color: var(--text-primary); }
body.dark-theme .btn-secondary      { background: var(--bg-subtle); border-color: var(--border); color: var(--text-primary); }
body.dark-theme .priority-selector  { background: var(--bg-subtle); }
body.dark-theme .prio-btn           { color: var(--text-tertiary); }
body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme input[type="date"]  { background: var(--bg-subtle); color: var(--text-primary); border-color: var(--border); }

/* ── 30. BACKWARD COMPATIBILITY ALIASES ──────────────────────────────────── */
/* Variabel lama yang masih dipakai di inline styles JS/HTML */
:root {
  --primary-color:       var(--brand);
  --primary-hover:       var(--brand-dark);
  --primary-light:       var(--brand-light);
  --text-dark:           var(--text-primary);
  --text-muted:          var(--text-secondary);
  --text-light:          var(--text-tertiary);
  --text-color:          var(--text-primary);
  --text-secondary:      #475569;
  --bg-main:             var(--bg-app);
  --bg-color:            var(--bg-app);
  --border-color:        var(--border);
  --border-radius-sm:    var(--r-sm);
  --border-radius-md:    var(--r-md);
  --border-radius-lg:    var(--r-lg);
  --shadow-sm:           0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:           0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:           0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-card:         0 4px 6px -1px rgba(0,0,0,.06);
  --priority-high:       var(--prio-high);
  --priority-high-bg:    var(--prio-high-bg);
  --priority-medium:     var(--prio-med);
  --priority-medium-bg:  var(--prio-med-bg);
  --priority-low:        var(--prio-low);
  --priority-low-bg:     var(--prio-low-bg);
  --danger:              #EF4444;
  --danger-bg:           #FEF2F2;
}

body.dark-theme {
  --bg-main:   var(--bg-app);
  --bg-color:  var(--bg-app);
  --text-dark: var(--text-primary);
  --text-muted: var(--text-secondary);
  --text-light: var(--text-tertiary);
  --text-color: var(--text-primary);
  --border-color: var(--border);
}

/* ── 31. ATTACHMENT ITEMS ─────────────────────────────────────────────────── */
.attachment-section { margin-top: 4px; }
.section-sub-title {
  display: flex; align-items: center; gap: 7px;
  font-size: .8125rem; font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px; margin-top: 16px;
}
.attachment-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }

.attachment-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--transition);
}
.attachment-item:hover { background: var(--brand-light); border-color: var(--brand-muted); }

.attachment-link {
  display: flex; align-items: center; gap: 9px;
  color: var(--text-primary); font-size: .8125rem; font-weight: 500;
  text-decoration: none; flex: 1; min-width: 0;
  transition: color var(--transition);
}
.attachment-link:hover { color: var(--brand); }
.attachment-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-link small { font-size: .6875rem; color: var(--text-tertiary); white-space: nowrap; flex-shrink: 0; }

.delete-attach-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 4px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0; margin-left: 8px;
}
.delete-attach-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* Upload drop zone */
.upload-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-subtle);
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-drop-zone p { color: var(--text-tertiary); font-size: .8125rem; margin: 6px 0; }
.upload-drop-zone .btn { display: inline-flex; margin-top: 6px; }

/* Expandable completed tasks accordion styles */
.tasks-expand-row {
  transition: all var(--transition);
}
.tasks-expand-row.hidden {
  display: none !important;
}
.expand-tasks-container {
  margin: 4px 0;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  padding: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.expand-task-item {
  transition: transform var(--transition), box-shadow var(--transition);
}
.expand-task-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  border-color: var(--brand-muted) !important;
}
.toggle-tasks-btn.active {
  background: var(--brand) !important;
  color: #ffffff !important;
  border-color: var(--brand) !important;
}

/* Responsive Honor Table for Mobile/Tablet (≤768px) */
@media (max-width: 768px) {
  #honor-table, 
  #honor-table thead, 
  #honor-table tbody, 
  #honor-table th, 
  #honor-table td, 
  #honor-table tr { 
    display: block; 
  }
  
  /* Hide table headers on mobile */
  #honor-table thead tr { 
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  #honor-table tr.employee-row {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-card);
    margin-bottom: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
  }
  
  #honor-table td { 
    border: none;
    position: relative;
    padding: 6px 0;
    text-align: left !important;
  }
  
  #honor-table td:nth-of-type(1) {
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 8px;
  }
  
  #honor-table td:nth-of-type(2)::before { 
    content: "Tugas Selesai: "; 
    font-weight: 600;
    color: var(--text-secondary);
  }
  
  #honor-table td:nth-of-type(2) {
    display: inline-block;
    width: 50%;
    text-align: left !important;
    font-size: 13.5px;
  }
  
  #honor-table td:nth-of-type(3)::before { 
    content: "Total Terinput: "; 
    font-weight: 600;
    color: var(--text-secondary);
  }
  
  #honor-table td:nth-of-type(3) {
    display: inline-block;
    width: 50%;
    text-align: right !important;
    font-size: 13.5px;
    color: var(--success) !important;
  }
  
  #honor-table td:nth-of-type(4) {
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    margin-top: 8px;
    text-align: center !important;
  }
  
  #honor-table td:nth-of-type(4) button {
    width: 100%;
  }

  /* Expanded tasks row layout on mobile */
  #honor-table tr.tasks-expand-row {
    margin-top: -10px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--r-md) var(--r-md);
    background: var(--bg-subtle);
    padding: 12px 16px;
  }
  
  #honor-table tr.tasks-expand-row td {
    padding: 0;
    display: block;
  }
  
  #honor-table .expand-tasks-container {
    padding: 0;
    border-left: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  
  #honor-table .expand-task-item {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
    padding: 12px;
  }
  
  #honor-table .expand-task-item div:last-child {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  
  #honor-table .expand-task-item div:last-child input {
    flex: 1;
    width: auto !important;
  }
  
  #honor-table .expand-task-item div:last-child button {
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  #honor-view .card-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start !important;
  }
}

/* Responsive Team User Table for Mobile (≤768px) */
@media (max-width: 768px) {
  #team-user-table,
  #team-user-table thead,
  #team-user-table tbody,
  #team-user-table th,
  #team-user-table td,
  #team-user-table tr {
    display: block;
  }
  
  #team-user-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  #team-user-table tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-card);
    margin-bottom: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
  }
  
  #team-user-table td {
    border: none;
    position: relative;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #team-user-table td:nth-of-type(1) {
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 8px;
    display: block;
  }
  
  #team-user-table td:nth-of-type(2)::before {
    content: "Role:";
    font-weight: 600;
    color: var(--text-secondary);
  }
  
  #team-user-table td:nth-of-type(3)::before {
    content: "Status:";
    font-weight: 600;
    color: var(--text-secondary);
  }
  
  #team-user-table td:nth-of-type(4) {
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    margin-top: 8px;
    display: flex;
    justify-content: center;
  }
  
  #team-user-table td:nth-of-type(4) > div {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  
  #team-user-table td:nth-of-type(4) button {
    flex: 1;
    justify-content: center;
  }
  
  #team-user-table .table-user-email {
    display: block !important;
  }
}

/* ── 16. TEAM WORKLOAD WIDGET ──────────────────────────────────────────────── */
.team-workload-list {
  display: flex;
  flex-direction: column;
}

.team-workload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.team-workload-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.team-workload-item:first-child {
  padding-top: 0;
}

.team-workload-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-workload-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 1.5px solid var(--border);
}

.team-workload-meta {
  display: flex;
  flex-direction: column;
}

.team-workload-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.team-workload-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.team-workload-badges {
  display: flex;
  gap: 6px;
}

.workload-badge {
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.workload-badge.active {
  background: var(--warning-bg);
  color: var(--warning);
}

.workload-badge.completed {
  background: var(--success-bg);
  color: var(--success);
}

/* Sidebar Submenu */
.sidebar-submenu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  padding-left: 24px;
}

.submenu-item a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8125rem;
  border-radius: var(--r-md);
  transition: all var(--transition);
  text-decoration: none;
}

.submenu-item a:hover {
  color: var(--brand);
  background: var(--brand-light);
}

.submenu-item.active a {
  color: var(--brand);
  background: var(--brand-light);
  font-weight: 600;
}


/* ── 17. ANALYTICS CHARTS GRID ──────────────────────────────────────────── */
#charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

#charts-grid .table-card {
  overflow: hidden;
}

/* Full-width chart spans both columns */
#charts-grid .table-card[style*="grid-column: span 2"],
#charts-grid > div[style*="grid-column: span 2"] {
  grid-column: span 2;
}

@media (max-width: 900px) {
  #charts-grid {
    grid-template-columns: 1fr;
  }
  #charts-grid .table-card[style*="grid-column: span 2"],
  #charts-grid > div[style*="grid-column: span 2"] {
    grid-column: span 1;
  }
}

/* Hoverable table row animation */
.hoverable-row {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hoverable-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Metric value helper classes */
.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.metric-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.text-success { color: var(--success) !important; }
.text-primary { color: var(--brand) !important; }

/* ── 23. AVATAR USER TOOLTIP ────────────────────────────────────────────── */
.avatar-tooltip-container {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.avatar-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  text-align: left;
  line-height: 1.4;
}

/* Arrow pointer to the left */
.avatar-tooltip::after {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent var(--border) transparent transparent;
}

.avatar-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent var(--bg-card) transparent transparent;
  z-index: 1;
}

.avatar-tooltip-container:hover .avatar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.avatar-tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tooltip-avatar-img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  margin: 0 !important;
  border: 1.5px solid var(--border) !important;
}

.tooltip-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tooltip-user-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.tooltip-user-role {
  font-size: 0.75rem;
  color: var(--brand);
  font-weight: 600;
}

.avatar-tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-info-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  gap: 8px;
}

.tooltip-info-label {
  color: var(--text-tertiary);
  font-weight: 500;
}

.tooltip-info-val {
  color: var(--text-secondary);
  font-weight: 600;
  word-break: break-all;
}

.tooltip-status-active {
  color: var(--success);
}

.tooltip-status-inactive {
  color: var(--danger);
}

/* ==========================================================================
   21. TASK DETAIL COMMENTS & DISCUSSIONS
   ========================================================================== */

.comments-list {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom scrollbar for comments list */
.comments-list::-webkit-scrollbar {
  width: 6px;
}
.comments-list::-webkit-scrollbar-track {
  background: transparent;
}
.comments-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.comments-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.comment-bubble {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 90%;
  animation: fadeIn 0.2s ease-out;
}
.comment-bubble.comment-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.comment-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.comment-content {
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.comment-bubble.comment-own .comment-content {
  background: var(--brand-light);
  border-top-right-radius: 4px;
  border-right: 3px solid var(--brand);
}
.comment-bubble.comment-other .comment-content {
  border-top-left-radius: 4px;
}
.comment-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}
.comment-bubble.comment-own .comment-header-row {
  flex-direction: row-reverse;
}
.comment-author {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.comment-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.comment-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
  white-space: pre-line;
}
.comment-bubble.comment-own .comment-text {
  color: var(--text-primary);
}
.delete-comment-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 2px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.delete-comment-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}
.no-comments-msg {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-align: center;
  padding: 40px 0;
  font-style: italic;
}

.comment-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.comment-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-input-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
#comment-input {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#comment-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}
#send-comment-btn {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


