:root {
  --color-primary: #172D26;
  --color-primary-hover: #214036;
  --color-secondary: #A7D9B5;
  --color-secondary-soft: rgba(167, 217, 181, 0.2);
  --color-bg: #F4F7F4;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F9FBF9;
  --color-border: #DCE6DE;
  --color-text: #25352D;
  --color-text-muted: #7C8B82;

  --color-blue: #2B6CB0;
  --color-blue-soft: #EBF4FF;
  --color-orange: #C05621;
  --color-orange-soft: #FFF2E8;
  --color-purple: #6B46C1;
  --color-purple-soft: #F3EEFF;
  --color-green: #276749;
  --color-green-soft: #E8F6EC;
  --color-red: #C53030;
  --color-red-soft: #FDECEC;

  --sidebar-width: 260px;
  --topbar-height: 68px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(23, 45, 38, 0.06);
  --shadow-md: 0 6px 18px rgba(23, 45, 38, 0.08);
  --transition-fast: 0.2s ease;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* App Layout */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background-color: #172D26;
  color: #FFFFFF;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  z-index: 1000;
  transition: transform var(--transition-fast);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 14px;
}
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background-color: #A7D9B5; color: #172D26;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-text h1 { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.brand-text span { font-size: 0.72rem; color: #A7D9B5; }

.sidebar-nav {
  flex: 1; display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; padding-right: 4px;
}
.nav-section-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  padding: 10px 12px 4px; font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82); font-size: 0.88rem; font-weight: 500;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.nav-link i, .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background-color: rgba(255, 255, 255, 0.1); color: #FFFFFF; }
.nav-link.active { background-color: #A7D9B5; color: #172D26; font-weight: 600; }
.nav-badge {
  margin-left: auto; background: #C53030; color: #FFF;
  font-size: 0.7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}

.sidebar-footer {
  padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-logout {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82); font-size: 0.88rem; font-weight: 500;
}
.sidebar-logout:hover { background-color: rgba(255, 255, 255, 0.1); color: #FFFFFF; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 28, 23, 0.45); z-index: 900;
}
.sidebar-overlay.active { display: block; }

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

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 500;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-toggle-btn {
  display: none; width: 38px; height: 38px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center; flex-shrink: 0;
  background-color: var(--color-bg); color: var(--color-text);
  border: 1px solid var(--color-border);
}
.topbar-title {
  font-size: 1.15rem; font-weight: 700; color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-date { font-size: 0.84rem; color: var(--color-text-muted); font-weight: 500; }

.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background-color: var(--color-bg); color: var(--color-text);
  border: 1px solid var(--color-border);
}
.icon-btn:hover { border-color: var(--color-primary); }
.notif-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--color-red); color: #FFF;
  font-size: 0.68rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  font-size: 0.84rem; font-weight: 600; flex-shrink: 0;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-primary); color: #A7D9B5;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Main Content */
.main-content {
  flex: 1; padding: 24px; max-width: 1380px; width: 100%; margin: 0 auto;
}

/* Footer */
.app-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 16px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px;
  font-size: 0.8rem; color: var(--color-text-muted);
}
.app-footer a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Auth Pages */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(135deg, #172D26 0%, #24473B 100%);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: #172D26; color: #A7D9B5;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.auth-header h1 { font-size: 1.45rem; font-weight: 700; color: var(--color-text); }
.auth-header p { font-size: 0.88rem; color: var(--color-text-muted); margin-top: 4px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.86rem; color: var(--color-text-muted); }
.auth-footer a { color: var(--color-primary); font-weight: 600; text-decoration: underline; }
