/* ── Design Tokens ─────────────────────────────────── */
:root {
  --primary:        #2563EB;
  --primary-dark:   #1D4ED8;
  --primary-light:  #EFF6FF;
  --primary-50:     #EFF6FF;
  --secondary:      #64748B;
  --success:        #10B981;
  --success-light:  #ECFDF5;
  --warning:        #F59E0B;
  --warning-light:  #FFFBEB;
  --danger:         #EF4444;
  --danger-light:   #FEF2F2;
  --sidebar-bg:     #0F172A;
  --sidebar-hover:  #1E293B;
  --sidebar-text:   #94A3B8;
  --sidebar-active: #2563EB;
  --card-bg:        #FFFFFF;
  --body-bg:        #F1F5F9;
  --border:         #E2E8F0;
  --text-primary:   #1E293B;
  --text-secondary: #64748B;
  --text-muted:     #94A3B8;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
  --shadow:         0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg:      0 10px 15px rgba(0,0,0,0.10), 0 4px 6px rgba(0,0,0,0.05);
  --sidebar-width:  250px;
  --header-height:  64px;
  --transition:     150ms ease;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: var(--body-bg); color: var(--text-primary); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff; font-weight: 700; font-size: 16px;
}
.sidebar-logo-text { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.3; }
.sidebar-logo-sub  { color: var(--sidebar-text); font-size: 11px; }

.sidebar-section { padding: 20px 12px 8px; }
.sidebar-section-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-text); padding: 0 8px; margin-bottom: 6px; }

.sidebar-nav { list-style: none; }
.sidebar-nav li + li { margin-top: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: var(--sidebar-active); color: #fff; }
.sidebar-nav a svg { flex-shrink: 0; opacity: .8; }

.sidebar-user {
  margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-user-name  { color: #fff; font-size: 13px; font-weight: 500; }
.sidebar-user-role  { color: var(--sidebar-text); font-size: 11px; }
.sidebar-user-logout a { color: var(--sidebar-text); font-size: 11px; }
.sidebar-user-logout a:hover { color: var(--danger); }

/* ── Main ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}

/* ── Top Header ────────────────────────────────────── */
.topbar {
  height: var(--header-height); background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.topbar-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* ── Page Content ──────────────────────────────────── */
.page-content { padding: 28px; flex: 1; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-title  { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-desc   { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card:hover::before {
  transform: scaleX(1);
}
.card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.card-title   { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-subtitle{ font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.card-body    { padding: 22px; }
.card-footer  { padding: 14px 22px; border-top: 1px solid var(--border); background: #FAFAFA; border-radius: 0 0 var(--radius) var(--radius); }

/* ── Stat Cards ────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { 
  background: #fff; border-radius: var(--radius); border: 1px solid var(--border); 
  padding: 20px; box-shadow: var(--shadow-sm);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(37,99,235,0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}
.stat-card:hover::after {
  opacity: 1;
}
.stat-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stat-card-icon.blue   { background: var(--primary-50); color: var(--primary); }
.stat-card-icon.green  { background: var(--success-light); color: var(--success); }
.stat-card-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-card-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-card-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.4; white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 600ms, height 600ms;
}
.btn:hover::before {
  width: 300px; height: 300px;
}
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled::before { display: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: var(--primary); box-shadow: 0 2px 4px rgba(37,99,235,0.2); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: 0 4px 8px rgba(37,99,235,0.3); transform: translateY(-1px); text-decoration: none; }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: #fff; border-color: var(--success); box-shadow: 0 2px 4px rgba(16,185,129,0.2); }
.btn-success:hover { background: linear-gradient(135deg, #059669, var(--success)); box-shadow: 0 4px 8px rgba(16,185,129,0.3); transform: translateY(-1px); }
.btn-danger  { background: linear-gradient(135deg, var(--danger), #DC2626); color: #fff; border-color: var(--danger); box-shadow: 0 2px 4px rgba(239,68,68,0.2); }
.btn-danger:hover { background: linear-gradient(135deg, #DC2626, var(--danger)); box-shadow: 0 4px 8px rgba(239,68,68,0.3); transform: translateY(-1px); }
.btn-warning { background: linear-gradient(135deg, var(--warning), #D97706); color: #fff; border-color: var(--warning); box-shadow: 0 2px 4px rgba(245,158,11,0.2); }
.btn-warning:hover { background: linear-gradient(135deg, #D97706, var(--warning)); box-shadow: 0 4px 8px rgba(245,158,11,0.3); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-outline:hover { background: var(--body-bg); border-color: var(--primary); color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 7px; }

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-gray   { background: #F1F5F9; color: #475569; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }

/* ── Forms ─────────────────────────────────────────── */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text-primary);
  font-size: 13.5px; transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11.5px; color: var(--text-secondary); margin-top: 5px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.form-check-label { font-size: 13px; color: var(--text-primary); }

/* ── File Upload ────────────────────────────────────── */
.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 36px; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: #FAFAFA;
}
.file-drop:hover, .file-drop.drag-over { border-color: var(--primary); background: var(--primary-light); }
.file-drop-icon { font-size: 40px; margin-bottom: 12px; color: var(--text-muted); }
.file-drop p  { color: var(--text-secondary); font-size: 13px; }
.file-drop strong { color: var(--primary); }
.file-drop input[type=file] { display: none; }
.file-chosen  { display: flex; align-items: center; gap: 10px; background: var(--success-light); border: 1px solid #6EE7B7; border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 10px; }
.file-chosen-name { font-size: 13px; color: #065F46; font-weight: 500; flex: 1; }

/* ── Tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table  { width: 100%; border-collapse: collapse; }
table.table th { background: #F8FAFC; text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); padding: 11px 16px; border-bottom: 1px solid var(--border); }
table.table td { padding: 12px 16px; border-bottom: 1px solid #F1F5F9; font-size: 13.5px; vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: #FAFAFA; }
table.table .actions { display: flex; gap: 8px; }

/* ── Timesheet Calendar ─────────────────────────────── */
.ts-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.ts-day-header { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); padding: 6px; }
.ts-day {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 6px; text-align: center; min-height: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff; position: relative;
}
.ts-day.weekend   { background: #F8FAFC; }
.ts-day.holiday   { background: #FEF3C7; border-color: #FDE68A; }
.ts-day.empty     { background: transparent; border-color: transparent; }
.ts-day-num  { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.ts-day.holiday .ts-day-num { color: #92400E; }
.ts-day-label{ font-size: 9px; color: var(--text-muted); text-transform: uppercase; }
.ts-day.holiday .ts-day-label { color: #B45309; font-weight: 600; }
.ts-hours-input {
  width: 52px; padding: 4px; border: 1px solid var(--border); border-radius: 4px;
  text-align: center; font-size: 13px; font-weight: 500; color: var(--text-primary);
  background: #fff;
}
.ts-hours-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.ts-hours-input:disabled { background: #F1F5F9; color: var(--text-muted); cursor: not-allowed; border-color: #E2E8F0; }
.ts-total-bar { background: var(--primary-50); border-radius: var(--radius-sm); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ts-total-label { font-size: 13px; color: var(--primary); font-weight: 500; }
.ts-total-value { font-size: 26px; font-weight: 700; color: var(--primary); }

/* ── Month picker ───────────────────────────────────── */
.month-picker { display: flex; align-items: center; gap: 10px; }
.month-picker select { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: 13px; }

/* ── Onboarding ─────────────────────────────────────── */
.doc-list  { display: flex; flex-direction: column; gap: 12px; }
.doc-item  {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; background: #fff;
  transition: box-shadow var(--transition);
}
.doc-item:hover { box-shadow: var(--shadow-md); }
.doc-item-icon  { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-item-icon.pending  { background: #F1F5F9; color: var(--text-muted); }
.doc-item-icon.uploaded { background: var(--primary-50); color: var(--primary); }
.doc-item-icon.verified { background: var(--success-light); color: var(--success); }
.doc-item-icon.rejected { background: var(--danger-light); color: var(--danger); }
.doc-item-info  { flex: 1; min-width: 0; }
.doc-item-name  { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.doc-item-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.doc-item-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.doc-progress-bar { height: 8px; background: var(--border); border-radius: 20px; overflow: hidden; margin-bottom: 4px; }
.doc-progress-fill{ height: 100%; background: var(--primary); border-radius: 20px; transition: width .5s ease; }

/* ── Tickets ────────────────────────────────────────── */
.ticket-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; background: #fff; margin-bottom: 12px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: box-shadow var(--transition);
}
.ticket-card:hover { box-shadow: var(--shadow-md); }
.ticket-num   { font-size: 11px; font-weight: 600; color: var(--text-muted); font-family: monospace; white-space: nowrap; }
.ticket-subj  { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.ticket-meta  { font-size: 12px; color: var(--text-secondary); display: flex; gap: 12px; flex-wrap: wrap; }
.priority-high   { color: var(--danger); font-weight: 600; }
.priority-medium { color: var(--warning); font-weight: 600; }
.priority-low    { color: var(--success); font-weight: 600; }

/* ── Alerts ─────────────────────────────────────────── */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--success-light); border: 1px solid #6EE7B7; color: #065F46; }
.alert-error   { background: var(--danger-light);  border: 1px solid #FCA5A5; color: #991B1B; }
.alert-warning { background: var(--warning-light); border: 1px solid #FDE68A; color: #92400E; }
.alert-info    { background: var(--primary-50);    border: 1px solid #BFDBFE; color: #1D4ED8; }

/* ── Modals ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  transform: scale(.95) translateY(10px); transition: transform .2s;
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header { padding: 22px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close  { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--body-bg); color: var(--text-primary); }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Tabs ───────────────────────────────────────────── */
.tabs        { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn     { padding: 10px 20px; font-size: 13.5px; font-weight: 500; color: var(--text-secondary); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color var(--transition); }
.tab-btn:hover  { color: var(--text-primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel   { display: none; }
.tab-panel.active { display: block; }

/* ── Login Page ─────────────────────────────────────── */
.login-page  { min-height: 100vh; background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card  { background: #fff; border-radius: 16px; box-shadow: 0 25px 50px rgba(0,0,0,.25); padding: 48px 44px; width: 100%; max-width: 420px; }
.login-logo  { text-align: center; margin-bottom: 32px; }
.login-logo-icon { width: 60px; height: 60px; background: var(--primary); border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.login-sub   { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── Empty State ────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-icon  { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.empty-desc  { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* ── Divider ────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Chips / Tags ───────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: var(--body-bg); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text-secondary); }

/* ── Loading Spinner ──────────────────────────────────── */
.loading-spinner {
  display: flex; justify-content: center; align-items: center;
  width: 40px; height: 40px; margin: 20px auto;
}
.spinner-ring {
  width: 100%; height: 100%; border: 3px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.spinner-ring:nth-child(2) {
  border-top-color: var(--success);
  animation-delay: -0.4s;
  width: 80%; height: 80%; position: absolute;
}
.spinner-ring:nth-child(3) {
  border-top-color: var(--warning);
  animation-delay: -0.8s;
  width: 60%; height: 60%; position: absolute;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Toast ──────────────────────────────────────────── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; min-width: 260px; animation: slideIn .25s ease; }
.toast-success { background: #065F46; color: #fff; }
.toast-error   { background: #991B1B; color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }
.toast-warning { background: #92400E; color: #fff; }
.toast-content { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.toast-close { background: none; border: none; color: white; font-size: 18px; cursor: pointer; padding: 0; margin-left: 12px; opacity: 0.8; }
.toast-close:hover { opacity: 1; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Modal Enhancements ───────────────────────────────── */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-backdrop.open {
  opacity: 1; pointer-events: auto;
}
.modal {
  background: white; border-radius: var(--radius);
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  max-width: 90vw; max-height: 90vh; overflow: auto;
  transform: scale(0.95) translateY(-10px);
  opacity: 0;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Alerts ─────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: var(--danger-light); color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: var(--primary-50); color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── Sidebar Overlay ─────────────────────────────────── */
.sidebar-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 99; opacity: 0; pointer-events: none;
  transition: opacity 300ms ease;
}
.sidebar-overlay.active {
  opacity: 1; pointer-events: auto;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { 
    transform: translateX(-100%); 
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .ts-calendar { grid-template-columns: repeat(4, 1fr); }
  
  /* Show mobile toggle button */
  #sidebar-toggle { display: inline-flex !important; }
  
  /* Adjust topbar for mobile */
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 16px; }
  
  /* Cards on mobile */
  .card-header { padding: 14px 16px; }
  .card-body { padding: 16px; }
  
  /* Tables on mobile */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }
  
  /* Stats on small screens */
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .page-title { font-size: 18px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .btn span { display: none; }
  
  /* Two column grid to single */
  .grid-2 { grid-template-columns: 1fr !important; }
  
  /* Timesheet calendar */
  .ts-calendar { grid-template-columns: repeat(3, 1fr); }
  
  /* Make buttons more touch-friendly */
  .btn { padding: 10px 16px; }
  .btn-sm { padding: 8px 12px; }
}

/* ── Utilities ──────────────────────────────────────── */
.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.mt-1   { margin-top: 6px; }
.mt-2   { margin-top: 12px; }
.mt-3   { margin-top: 20px; }
.mb-1   { margin-bottom: 6px; }
.mb-2   { margin-bottom: 12px; }
.mb-3   { margin-bottom: 20px; }
.text-sm   { font-size: 12px; }
.text-muted{ color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full{ width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.rounded{ border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }
.p-0    { padding: 0 !important; }

/* Text utilities */
.text-sm { font-size: 12px; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
