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

:root {
  --bg:        #f0f2f5;
  --surface:   #ffffff;
  --dark:      #1a1a2e;
  --dark-mid:  #2d2d4e;
  --accent:    #e8593c;
  --text:      #1a1a2e;
  --text-muted:#888888;
  --text-light:#bbbbbb;
  --border:    #e5e7eb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow:    0 1px 4px rgba(0,0,0,0.07);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--dark);
  color: white;
  padding: 18px 32px 18px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
html[dir="rtl"] header { padding: 18px 80px 18px 32px; }
header h1 { font-size: 20px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 14px; }
.user-badge { font-size: 13px; opacity: 0.6; }

/* ── Hamburger button ── */
#menu-btn {
  position: fixed; top: 18px; z-index: 1000;
  left: 24px;
  width: 44px; height: 44px;
  background: var(--dark); border-radius: 50%; border: none;
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25); transition: background 0.2s;
}
#menu-btn:hover { background: var(--dark-mid); }
#menu-btn span {
  display: block; width: 18px; height: 2px;
  background: white; border-radius: 2px;
  transition: all 0.3s; transform-origin: center;
}
#menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav drawer ── */
#nav-drawer {
  position: fixed; top: 0; left: -260px;
  width: 240px; height: 100vh; height: 100dvh;
  background: var(--dark); z-index: 999;
  padding: 80px 24px 32px;
  transition: right 0.3s ease, left 0.3s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
#nav-drawer.open { left: 0; }
html[dir="rtl"] #nav-drawer {
  left: auto; right: -260px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.2);
}
html[dir="rtl"] #nav-drawer.open { right: 0; }
html[dir="rtl"] #menu-btn { left: auto; right: 24px; }
#nav-drawer a {
  display: block; color: rgba(255,255,255,0.75);
  text-decoration: none; font-size: 16px; font-weight: 500;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.2s;
}
#nav-drawer a:hover,
#nav-drawer a.active { color: white; }
#nav-drawer .nav-icon { margin-inline-end: 12px; font-size: 16px; }
#nav-drawer .nav-logout {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  padding-top: 14px;
}
#nav-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 998;
}
#nav-overlay.open { display: block; }

/* ── Container ── */
.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 32px;
}

/* ── Section label ── */
.section-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 12px;
}

/* ── Month controls ── */
.month-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  margin: 24px 0;
}
.month-nav-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); transition: background 0.2s;
  box-shadow: var(--shadow);
}
.month-nav-btn:hover { background: #f0f0f0; }
[dir="rtl"] .month-nav-btn { transform: scaleX(-1); }
input[type="month"] {
  padding: 7px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  background: var(--surface); color: var(--text);
  outline: none; cursor: pointer; box-shadow: var(--shadow);
}
input[type="month"]:focus { border-color: var(--dark); }
.showing-label { font-size: 13px; color: var(--text-muted); }
.current-month-btn {
  padding: 7px 12px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: #666; cursor: pointer;
  transition: background 0.2s; box-shadow: var(--shadow);
}
.current-month-btn:hover { background: #f0f0f0; }