/* =====================================================================
   FMROJ OFFICE — GLOBAL DESIGN SYSTEM
   ===================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --card: #ffffff;
  --text: #0f1729;
  --text-muted: #6b7280;
  --border: #e5e9f2;
  --primary: #2f5bff;
  --primary-hover: #2647d6;
  --primary-soft: #eef2ff;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #0891b2;
  --info-soft: #ecfeff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 41, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 41, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --transition: 160ms cubic-bezier(.4,0,.2,1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #101a2c;
  --card: #131f34;
  --text: #eef1f8;
  --text-muted: #93a0b8;
  --border: #223050;
  --primary: #5b7fff;
  --primary-hover: #789aff;
  --primary-soft: #1a2646;
  --success: #22c55e;
  --success-soft: #0f2818;
  --warning: #f59e0b;
  --warning-soft: #2b220b;
  --danger: #f87171;
  --danger-soft: #2c1414;
  --info: #22d3ee;
  --info-soft: #0c2530;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #101a2c; --card: #131f34; --text: #eef1f8;
    --text-muted: #93a0b8; --border: #223050; --primary: #5b7fff; --primary-hover: #789aff;
    --primary-soft: #1a2646; --success: #22c55e; --success-soft: #0f2818; --warning: #f59e0b;
    --warning-soft: #2b220b; --danger: #f87171; --danger-soft: #2c1414; --info: #22d3ee; --info-soft: #0c2530;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
h1,h2,h3,h4 { margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
::selection { background: var(--primary-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand img { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-brand .name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.nav-section { margin-top: 16px; }
.nav-section:first-child { margin-top: 4px; }
.nav-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); padding: 0 10px; margin-bottom: 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.75; }
.nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.nav-link:hover svg { opacity: 1; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.nav-link.active svg { opacity: 1; }
.nav-link .badge-count {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 99px; background: var(--danger); color: #fff;
}

.main-area { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
}
.topbar .breadcrumb { font-size: 13px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.topbar .breadcrumb b { color: var(--text); font-weight: 600; }
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 99px; padding: 8px 14px; color: var(--text-muted);
  font-size: 13px; cursor: pointer; width: 260px;
}
.topbar-search kbd {
  margin-left: auto; font-size: 11px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; color: var(--text-muted);
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text); cursor: pointer; position: relative;
  transition: background var(--transition);
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 99px;
  background: var(--danger); border: 2px solid var(--surface);
}
.menu-toggle { display: none; }

.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px 8px 5px 5px; border-radius: 99px; transition: background var(--transition); }
.user-chip:hover { background: var(--primary-soft); }
.avatar {
  width: 32px; height: 32px; border-radius: 99px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; flex-shrink: 0; object-fit: cover;
}
.avatar.lg { width: 84px; height: 84px; font-size: 26px; border-radius: 20px; }
.user-chip .who { line-height: 1.25; }
.user-chip .who .name { font-size: 13px; font-weight: 650; }
.user-chip .who .role { font-size: 11.5px; color: var(--text-muted); }

.content { padding: 22px 26px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------------------------------------------------------------- Cards */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 15px; }
.card-body { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card .icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.stat-card .icon svg { width: 18px; height: 18px; }
.stat-card .value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.icon-primary { background: var(--primary-soft); color: var(--primary); }
.icon-success { background: var(--success-soft); color: var(--success); }
.icon-warning { background: var(--warning-soft); color: var(--warning); }
.icon-danger { background: var(--danger-soft); color: var(--danger); }
.icon-info { background: var(--info-soft); color: var(--info); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 960px) { .grid-2, .grid-cols-2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }

.spinner {
  width: 14px; height: 14px; border-radius: 99px; border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn:not(.btn-primary):not(.btn-danger) .spinner { border-color: var(--border); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Forms */
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-size: 12.5px; font-weight: 650; margin-bottom: 6px; color: var(--text); }
label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 80px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.form-group.has-error input, .form-group.has-error select, .form-group.has-error textarea { border-color: var(--danger); }
.form-group.has-error .field-error { display: block; }
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-left: 36px; }
.input-icon-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 99px; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ---------------------------------------------------------------- Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--primary-soft); }
.row-name { display: flex; align-items: center; gap: 10px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.pagination .pages { display: flex; gap: 4px; }
.pagination button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 12.5px; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------------------------------------------------------- Empty state */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state svg { width: 46px; height: 46px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { margin-bottom: 14px; }

/* ---------------------------------------------------------------- Toasts */
#toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 40px); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: var(--radius-md);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease; font-size: 13px;
}
.toast .icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.warning .icon { color: var(--warning); }
.toast.info .icon { color: var(--info); }
.toast .close { margin-left: auto; cursor: pointer; opacity: 0.5; flex-shrink: 0; }
.toast .close:hover { opacity: 1; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast.leaving { animation: toast-out 160ms ease forwards; }
@keyframes toast-out { to { transform: translateX(14px); opacity: 0; } }

/* ---------------------------------------------------------------- Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8, 12, 24, 0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 150; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); transform: translateY(10px) scale(0.98); transition: transform var(--transition);
  max-height: 88vh; display: flex; flex-direction: column;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-box.modal-lg { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { cursor: pointer; color: var(--text-muted); background: none; border: none; padding: 4px; }
.modal-close:hover { color: var(--text); }

/* ---------------------------------------------------------------- Drawer */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(8, 12, 24, 0.45); z-index: 150;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 151;
  transform: translateX(100%); transition: transform var(--transition);
  display: flex; flex-direction: column;
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

/* ---------------------------------------------------------------- Command palette / search */
.palette-overlay { position: fixed; inset: 0; background: rgba(8,12,24,0.5); z-index: 180; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.palette-overlay.open { opacity: 1; pointer-events: auto; }
.palette-box { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(6px); transition: transform var(--transition); }
.palette-overlay.open .palette-box { transform: translateY(0); }
.palette-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-input-wrap svg { width: 18px; height: 18px; color: var(--text-muted); }
.palette-input-wrap input { border: none; padding: 0; font-size: 15px; }
.palette-input-wrap input:focus { box-shadow: none; }
.palette-results { max-height: 360px; overflow-y: auto; padding: 8px; }
.palette-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 8px 10px 4px; }
.palette-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.palette-item:hover, .palette-item.active { background: var(--primary-soft); color: var(--primary); }
.palette-item .meta { font-size: 12px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Skeleton loaders */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg) 37%, var(--border) 63%); background-size: 400% 100%; animation: skeleton 1.3s ease infinite; border-radius: 6px; }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-row { height: 44px; margin-bottom: 8px; border-radius: var(--radius-sm); }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab-btn { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; background:none; border-top:none; border-left:none; border-right:none; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------------------------------------------------------- Kanban */
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; flex-direction: column; min-height: 200px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.kanban-col-body { padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition); }
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card .title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.kanban-card .meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }
.kanban-col-body.drag-over { background: var(--primary-soft); border-radius: var(--radius-sm); }

/* ---------------------------------------------------------------- Auth layout */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 32px 28px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 22px; }
.auth-logo img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 10px; }
.auth-logo .title { font-size: 18px; font-weight: 700; }
.auth-logo .sub { font-size: 12.5px; color: var(--text-muted); }
.auth-error { background: var(--danger-soft); color: var(--danger); font-size: 12.5px; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; }

/* ---------------------------------------------------------------- Attendance timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -26px; top: 2px; width: 12px; height: 12px; border-radius: 99px; background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--primary); }
.timeline-item .time { font-size: 12.5px; font-weight: 700; }
.timeline-item .label { font-size: 12.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Misc */
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 99px; padding: 5px 11px; font-size: 12px; font-weight: 600; }
.progress-bar { height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--primary); border-radius: 99px; transition: width var(--transition); }

/* ---------------------------------------------------------------- Mobile */
.mobile-bottom-nav { display: none; }

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: flex; }
  .topbar-search { display: none; }
  .content { padding: 16px 14px 90px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: minmax(240px, 85vw); grid-auto-flow: column; }
  .mobile-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px; z-index: 60;
    background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); justify-content: space-around; align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-muted); font-size: 10px; font-weight: 600; }
  .mobile-bottom-nav a.active { color: var(--primary); }
  .mobile-bottom-nav svg { width: 20px; height: 20px; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(8,12,24,0.4); z-index: 39; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
}
@media (min-width: 981px) {
  .content { padding-bottom: 40px; }
}
