/**
 * ZeroToHero Unified Design System & Global Stylesheet (style.css)
 * Triết lý thiết kế cao cấp: Modern Dark Theme, Vibrant Gold/Green Accents, Glassmorphism & Sidebar App Layout
 */

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

/* ----------------------------------------------------
 * 1. DESIGN TOKENS & CSS VARIABLES
 * ---------------------------------------------------- */
:root {
  /* Color Palette */
  --bg: #0a0c12;
  --surface: #111420;
  --surface2: #181d2e;
  --surface3: #1c2236;
  --border: #252d45;
  --border-light: rgba(255, 255, 255, 0.08);

  /* Brand & Accent Colors */
  --accent: #c8961e;
  --accent-hover: #a87818;
  --accent2: #e8b84b;
  --accent3: #26de81;
  --accent3-hover: #1db968;
  --accent4: #fc5c65;
  --accent-blue: #7ab4fc;
  --accent-purple: #a78bfa;

  /* Typography Colors */
  --text: #e8e8f0;
  --text2: #8898bb;
  --text-muted: #5e6e8e;

  /* Aliases for ZH Tài Chính & legacy component styles */
  --panel: #111420;
  --panel2: #181d2e;
  --line: #252d45;
  --txt: #e8e8f0;
  --muted: #8898bb;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-gold: 0 4px 20px rgba(200, 150, 30, 0.35);
  --shadow-glow-green: 0 4px 20px rgba(38, 222, 129, 0.35);

  /* Typography Font */
  --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-height: 72px;
  --sidebar-width: 250px;
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --surface3: #e2e8f0;
  --border: #cbd5e1;
  --border-light: rgba(0, 0, 0, 0.08);

  --text: #0f172a;
  --text2: #475569;
  --text-muted: #64748b;

  /* Aliases for ZH Tài Chính & legacy component styles */
  --panel: #ffffff;
  --panel2: #f8fafc;
  --line: #e2e8f0;
  --txt: #0f172a;
  --muted: #64748b;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-glow-gold: 0 4px 20px rgba(200, 150, 30, 0.2);
  --shadow-glow-green: 0 4px 20px rgba(38, 222, 129, 0.2);
}

/* Light Theme Navigation Buttons & Hovers */
.nav-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.nav-btn-hieusuat {
  background: rgba(200, 150, 30, 0.12);
  border: 1px solid rgba(200, 150, 30, 0.4);
  color: var(--accent2);
}

.nav-btn-hieusuat:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(200, 150, 30, 0.4);
}

.nav-btn-taichinh {
  background: rgba(38, 222, 129, 0.12);
  border: 1px solid rgba(38, 222, 129, 0.4);
  color: var(--accent3);
}

.nav-btn-taichinh:hover {
  background: var(--accent3);
  color: #0f2a1e;
  box-shadow: 0 4px 16px rgba(38, 222, 129, 0.4);
}

.nav-btn-admin {
  background: rgba(56, 103, 214, 0.18);
  border: 1px solid rgba(75, 123, 236, 0.5);
  color: #4b7bec;
}

.nav-btn-admin:hover,
.nav-btn-admin.active {
  background: #3867d6;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(56, 103, 214, 0.4);
}

[data-theme="light"] .nav-btn-hieusuat {
  background: rgba(200, 150, 30, 0.1);
  border: 1px solid rgba(200, 150, 30, 0.4);
  color: #975a16;
}

[data-theme="light"] .nav-btn-hieusuat:hover {
  background: #c8961e;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(200, 150, 30, 0.3);
}

[data-theme="light"] .nav-btn-taichinh {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #047857;
}

[data-theme="light"] .nav-btn-taichinh:hover {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

/* Light Theme Sidebar Items */
[data-theme="light"] .sidebar-item {
  color: #475569;
}

[data-theme="light"] .sidebar-item:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .sidebar-item.active {
  background: rgba(200, 150, 30, 0.14);
  border-color: #d69e2e;
  color: #744210;
  font-weight: 700;
}

/* Light Theme Common Buttons */
[data-theme="light"] .btn-ghost {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .btn-ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Light Theme High-Contrast Colors for Timeline, Badges & Labels */
[data-theme="light"] .cascade-period {
  font-weight: 800 !important;
}

[data-theme="light"] .cascade-period[style*="a78bfa"] { color: #6b21a8 !important; }
[data-theme="light"] .cascade-period[style*="c8961e"] { color: #92400e !important; }
[data-theme="light"] .cascade-period[style*="e8b84b"] { color: #b45309 !important; }
[data-theme="light"] .cascade-period[style*="26de81"] { color: #047857 !important; }
[data-theme="light"] .cascade-period[style*="7ab4fc"] { color: #1d4ed8 !important; }
[data-theme="light"] .cascade-period[style*="fc5c65"] { color: #b91c1c !important; }

[data-theme="light"] .cascade-dot[style*="a78bfa"] { border-color: #6b21a8 !important; }
[data-theme="light"] .cascade-dot[style*="c8961e"] { border-color: #92400e !important; }
[data-theme="light"] .cascade-dot[style*="e8b84b"] { border-color: #b45309 !important; }
[data-theme="light"] .cascade-dot[style*="26de81"] { border-color: #047857 !important; }
[data-theme="light"] .cascade-dot[style*="7ab4fc"] { border-color: #1d4ed8 !important; }
[data-theme="light"] .cascade-dot[style*="fc5c65"] { border-color: #b91c1c !important; }

[data-theme="light"] .cascade-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .cascade-inner {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .val.green, [data-theme="light"] .amt-in { color: #047857 !important; }
[data-theme="light"] .val.red, [data-theme="light"] .amt-out { color: #b91c1c !important; }
[data-theme="light"] .val.blue { color: #1d4ed8 !important; }
[data-theme="light"] .val.purple, [data-theme="light"] .amt-inv { color: #6b21a8 !important; }

[data-theme="light"] .badge-gold {
  background: rgba(180, 83, 9, 0.1) !important;
  color: #92400e !important;
  border-color: rgba(180, 83, 9, 0.3) !important;
}

[data-theme="light"] .badge-green {
  background: rgba(4, 120, 87, 0.1) !important;
  color: #047857 !important;
  border-color: rgba(4, 120, 87, 0.3) !important;
}

[data-theme="light"] .badge-red {
  background: rgba(185, 28, 28, 0.1) !important;
  color: #b91c1c !important;
  border-color: rgba(185, 28, 28, 0.3) !important;
}

.zh-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.zh-theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent2);
}

/* ----------------------------------------------------
 * 2. GLOBAL RESET & BASE STYLES
 * ---------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

html, body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ----------------------------------------------------
 * 3. TOP HEADER SYSTEM
 * ---------------------------------------------------- */
.header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #000;
  box-shadow: 0 4px 14px rgba(200, 150, 30, 0.3);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(90deg, #c8961e, #e8d07a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Nav center (absolute centered on desktop) */
.nav-links-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Nav right (user pill + logout) */
.nav-links-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}



/* ----------------------------------------------------
 * 4. APP DASHBOARD LAYOUT & SIDEBAR
 * ---------------------------------------------------- */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text2);
  text-transform: uppercase;
  padding: 8px 12px 4px;
  margin-bottom: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text2);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  user-select: none;
}

.sidebar-item:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
  background: rgba(200, 150, 30, 0.12);
  border-color: rgba(200, 150, 30, 0.4);
  color: var(--accent2);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.sidebar-item .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* --- Sidebar Nav Group (injected on mobile) --- */
.sidebar-nav-group {
  margin-bottom: 4px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 4px 14px;
  border-radius: 1px;
  opacity: 0.6;
}

/* Nav links inside sidebar — style like sidebar-item but with link reset */
a.sidebar-nav-item {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

a.sidebar-nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

a.sidebar-nav-item.active {
  background: rgba(200, 150, 30, 0.12);
  border-color: rgba(200, 150, 30, 0.4);
  color: var(--accent2);
  font-weight: 700;
}



.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  min-width: 0;
}




/* ----------------------------------------------------
 * 5. COMMON BUTTON SYSTEM
 * ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius);
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  box-shadow: var(--shadow-glow-gold);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent3), var(--accent3-hover));
  color: #0f2a1e;
  box-shadow: var(--shadow-sm);
}

.btn-success:hover {
  background: linear-gradient(135deg, #5df3a8, var(--accent3));
  box-shadow: var(--shadow-glow-green);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent2);
}

.btn-danger {
  background: rgba(252, 92, 101, 0.15);
  border: 1px solid rgba(252, 92, 101, 0.3);
  color: var(--accent4);
}

.btn-danger:hover {
  background: rgba(252, 92, 101, 0.25);
}

/* ----------------------------------------------------
 * 6. CARD & CONTAINER SYSTEM
 * ---------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: rgba(200, 150, 30, 0.3);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 16px;
}

/* Grid Layouts */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .grid2, .grid3 {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------
 * 7. FORM CONTROLS & INPUTS
 * ---------------------------------------------------- */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=date],
textarea,
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 150, 30, 0.15);
}

/* ----------------------------------------------------
 * 8. USER IDENTITY BADGE & LOGOUT
 * ---------------------------------------------------- */
.zh-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(200, 150, 30, 0.12);
  border: 1px solid rgba(200, 150, 30, 0.3);
  font-size: 13px;
  color: var(--accent2);
  font-weight: 600;
}

.zh-logout-btn {
  background: none;
  border: none;
  color: var(--accent4);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.zh-logout-btn:hover {
  background: rgba(252, 92, 101, 0.15);
}

/* ----------------------------------------------------
 * 9. BADGES & PILLS
 * ---------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

.badge-gold {
  background: rgba(200, 150, 30, 0.15);
  color: var(--accent2);
  border: 1px solid rgba(200, 150, 30, 0.3);
}

.badge-green {
  background: rgba(38, 222, 129, 0.15);
  color: var(--accent3);
  border: 1px solid rgba(38, 222, 129, 0.3);
}

.badge-red {
  background: rgba(252, 92, 101, 0.15);
  color: var(--accent4);
  border: 1px solid rgba(252, 92, 101, 0.3);
}

/* ----------------------------------------------------
 * 10. ANIMATIONS
 * ---------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
  animation: fadeIn 0.3s ease-out forwards;
}

/* ----------------------------------------------------
 * 11. CUSTOM GLOBAL MODAL POPUP SYSTEM
 * ---------------------------------------------------- */
.zh-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.zh-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.zh-modal-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.zh-modal-overlay.active .zh-modal-box {
  transform: scale(1);
}

.zh-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(200, 150, 30, 0.12);
  border: 1.5px solid rgba(200, 150, 30, 0.3);
}

.zh-modal-icon.danger {
  background: rgba(252, 92, 101, 0.12);
  border-color: rgba(252, 92, 101, 0.4);
}

.zh-modal-icon.info {
  background: rgba(122, 180, 252, 0.12);
  border-color: rgba(122, 180, 252, 0.4);
}

.zh-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.zh-modal-message {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 24px;
}

.zh-modal-input-wrap {
  margin-bottom: 24px;
}

.zh-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.zh-modal-actions .btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
}

/* ----------------------------------------------------
 * 12. COMPREHENSIVE LIGHT THEME HIGH-CONTRAST SWEEP
 * ---------------------------------------------------- */
[data-theme="light"] .tab-section-hd,
[data-theme="light"] .section-title,
[data-theme="light"] .pillar-hd,
[data-theme="light"] .pillar-title {
  color: #0f172a !important;
  font-weight: 800 !important;
}

[data-theme="light"] div[style*="color:#7ab4fc"],
[data-theme="light"] span[style*="color:#7ab4fc"] {
  color: #1d4ed8 !important;
}

[data-theme="light"] div[style*="color:#e8b84b"],
[data-theme="light"] span[style*="color:#e8b84b"] {
  color: #b45309 !important;
}

[data-theme="light"] div[style*="color:#26de81"],
[data-theme="light"] span[style*="color:#26de81"] {
  color: #047857 !important;
}

[data-theme="light"] div[style*="color:#a78bfa"],
[data-theme="light"] span[style*="color:#a78bfa"] {
  color: #6b21a8 !important;
}

[data-theme="light"] div[style*="color:#fc5c65"],
[data-theme="light"] span[style*="color:#fc5c65"] {
  color: #b91c1c !important;
}

/* KR and KA badges */
[data-theme="light"] .okr-num,
[data-theme="light"] .kr-badge {
  background: rgba(180, 83, 9, 0.12) !important;
  color: #92400e !important;
  border: 1px solid rgba(180, 83, 9, 0.4) !important;
}

[data-theme="light"] .okr-num.ka,
[data-theme="light"] .ka-badge {
  background: rgba(4, 120, 87, 0.12) !important;
  color: #047857 !important;
  border: 1px solid rgba(4, 120, 87, 0.4) !important;
}

[data-theme="light"] .pillar-focus-label {
  color: #92400e !important;
  font-weight: 800 !important;
}

/* Card & Input Light Mode Overrides */
[data-theme="light"] .card,
[data-theme="light"] .card[style*="linear-gradient"],
[data-theme="light"] div[style*="linear-gradient"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] #gm_goal {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-bottom: 2px solid #047857 !important;
}

[data-theme="light"] .gm-input,
[data-theme="light"] input[type=text],
[data-theme="light"] textarea {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] textarea[id^="matranQ"] {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .card div[style*="color:var(--text2)"],
[data-theme="light"] div[style*="color:var(--text2)"] {
  color: #475569 !important;
}

/* Week Grid & Day Badges */
[data-theme="light"] .day-col {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .day-col.today {
  border-color: #d69e2e !important;
  background: rgba(200, 150, 30, 0.08) !important;
}

[data-theme="light"] .day-name {
  color: #0f172a !important;
  font-weight: 800 !important;
}

[data-theme="light"] .day-badge.badge-okr {
  background: rgba(107, 33, 168, 0.12) !important;
  color: #6b21a8 !important;
  border: 1px solid rgba(107, 33, 168, 0.3) !important;
}

[data-theme="light"] .day-badge.badge-focus {
  background: rgba(4, 120, 87, 0.12) !important;
  color: #047857 !important;
  border: 1px solid rgba(4, 120, 87, 0.3) !important;
}

[data-theme="light"] .day-badge.badge-kaizen {
  background: rgba(180, 83, 9, 0.12) !important;
  color: #92400e !important;
  border: 1px solid rgba(180, 83, 9, 0.3) !important;
}

[data-theme="light"] .day-badge.badge-review {
  background: rgba(185, 28, 28, 0.12) !important;
  color: #b91c1c !important;
  border: 1px solid rgba(185, 28, 28, 0.3) !important;
}

/* History Filter Buttons */
[data-theme="light"] .hist-filter-btn {
  background: #ffffff !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .hist-filter-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .hist-filter-btn.active {
  background: #c8961e !important;
  color: #ffffff !important;
  border-color: #c8961e !important;
}

/* OKR Pillar Cards & Forms */
[data-theme="light"] .pillar-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .kr-input,
[data-theme="light"] .ka-input,
[data-theme="light"] .pillar-name-input {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .kr-input:focus,
[data-theme="light"] .ka-input:focus,
[data-theme="light"] .pillar-name-input:focus {
  border-color: #c8961e !important;
  background: #ffffff !important;
}

/* Inputs & Form controls */
[data-theme="light"] textarea,
[data-theme="light"] input[type=text],
[data-theme="light"] input[type=number],
[data-theme="light"] input[type=date],
[data-theme="light"] select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] ::placeholder {
  color: #64748b !important;
  opacity: 1;
}

[data-theme="light"] .card-title,
[data-theme="light"] .card-sub,
[data-theme="light"] .sub {
  color: #475569 !important;
}

[data-theme="light"] .hist-entry {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .hist-goal {
  color: #0f172a !important;
}

[data-theme="light"] .hist-pillar {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

/* Light Theme Overrides for index.html (Portal Hub) */
[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-eyebrow {
  background: rgba(200, 150, 30, 0.1) !important;
  border-color: rgba(200, 150, 30, 0.4) !important;
  color: #92400e !important;
}

[data-theme="light"] .app-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .app-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .app-card .app-title {
  color: #0f172a !important;
}

[data-theme="light"] .app-card .app-desc {
  color: #475569 !important;
}

[data-theme="light"] .feature-item {
  color: #334155 !important;
}

/* ====================================================
 * RESPONSIVE SYSTEM — HEADER & SIDEBAR (Mobile-First)
 * ==================================================== */

/* --- Hamburger Toggle Button (hidden on desktop) --- */
.mobile-toggle-btn {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}


.mobile-toggle-btn:hover {
  background: var(--surface3);
  border-color: var(--accent);
  color: var(--accent2);
}

/* --- Backdrop Overlay --- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  animation: fadeInBackdrop 0.25s ease forwards;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== TABLET (≤ 992px) ===== */
@media (max-width: 992px) {
  .header {
    padding: 0 20px;
  }

  /* Unwrap absolute-positioned center nav so it flows naturally */
  .nav-links-center {
    position: static !important;
    transform: none !important;
  }
}

/* ===== MOBILE (≤ 768px) ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 58px;
  }

  /* Header: single-row, no wrap */
  .header {
    padding: 0 12px;
    height: var(--header-height);
    flex-wrap: nowrap;
    gap: 0;
  }

  /* Show hamburger */
  .mobile-toggle-btn {
    display: flex;
    margin-right: 8px;
  }

  /* Brand: compact */
  .brand {
    display: none !important;
  }



  .brand-sub {
    display: none;
  }

  /* Nav-center: HIDE on mobile (moved into sidebar by JS) */
  .nav-links-center {
    display: none !important;
  }

  /* Theme button: HIDE on mobile (moved into sidebar by JS) */
  .zh-theme-btn {
    display: none !important;
  }

  /* Right section: compact — just user pill + logout */
  .nav-links-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .zh-user-pill {
    padding: 4px 10px !important;
    font-size: 12px !important;
    gap: 5px !important;
  }

  .zh-logout-btn {
    font-size: 11px !important;
    padding: 2px 6px !important;
    margin-left: 0 !important;
  }

  /* ---- Main layout: full width, no side shift ---- */
  .app-layout {
    display: block;
    min-height: calc(100vh - var(--header-height));
  }

  /* ---- Sidebar: fixed drawer ---- */
  .sidebar {
    position: fixed !important;
    top: var(--header-height) !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    max-width: 80vw !important;
    z-index: 9999 !important;
    background: var(--surface) !important;
    border-right: 1px solid var(--border) !important;
    border-bottom: none !important;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.45) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 20px 12px !important;
    flex-direction: column !important;
    gap: 4px !important;
    /* Reset horizontal scroll from @850 rule */
    flex-wrap: nowrap;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .sidebar-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-item {
    white-space: normal;
    font-size: 13px;
  }

  /* Main content: full width */
  .main-content {
    padding: 16px 14px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ===== SMALL MOBILE (≤ 480px) ===== */
@media (max-width: 480px) {
  .brand-title {
    display: none !important;
  }

  /* Nav btn: icon-only */
  .nav-btn span:not(:first-child) {
    display: none !important;
  }

  .nav-btn {
    padding: 5px 8px !important;
  }

  /* Hide username text, keep logout */
  #zhNavUserName,
  #zhTcUserName,
  #userNameDisplay {
    display: none !important;
  }

  .zh-user-pill {
    padding: 4px 8px !important;
  }
}

