/* ── Variabler & reset ────────────────────────────────────────────────────── */
:root {
  --jom-dark:   #312C6F;
  --jom-mid1:   #334581;
  --jom-mid2:   #395093;
  --jom-light1: #336699;
  --jom-light2: #3F75B9;
  --jom-bg:     #f4f6fb;
  --jom-surface:#ffffff;
  --jom-border: #dde3f0;
  --jom-text:   #1a1a2e;
  --jom-muted:  #6b7a99;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Lato', Arial, sans-serif; font-size: 14px; color: var(--jom-text); background: var(--jom-bg); line-height: 1.5; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.layout    { display: flex; flex: 1; }
.main-content { flex: 1; padding: 24px; overflow: auto; background: var(--jom-bg); }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar { background: var(--jom-dark); color: white; height: 52px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-logo  { width: 32px; height: 32px; border-radius: 50%; background: var(--jom-light2); display: flex; align-items: center; justify-content: center; font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 600; color: white; }
.topbar-title { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600; }
.topbar-sub   { font-size: 11px; opacity: 0.7; margin-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user  { font-size: 13px; opacity: 0.85; }
.btn-logout   { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); color: white; padding: 5px 14px; border-radius: 6px; text-decoration: none; font-size: 12px; font-family: 'Lato', sans-serif; }
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar     { width: 195px; background: var(--jom-dark); padding: 16px 0; flex-shrink: 0; }
.nav-section { padding: 4px 16px; font-family: 'Montserrat', sans-serif; font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.4); letter-spacing: 1px; text-transform: uppercase; margin-top: 14px; margin-bottom: 4px; }
.nav-item    { display: flex; align-items: center; gap: 9px; padding: 9px 16px; font-size: 13px; color: rgba(255,255,255,0.7); border-left: 3px solid transparent; text-decoration: none; transition: all 0.12s; }
.nav-item.active { color: white; border-left-color: var(--jom-light2); background: rgba(255,255,255,0.1); font-weight: 700; }
.nav-item:hover:not(.active) { color: white; background: rgba(255,255,255,0.07); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card       { background: var(--jom-surface); border: 1px solid var(--jom-border); border-radius: 10px; padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(49,44,111,0.06); }
.card-title { font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 600; color: var(--jom-dark); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.page-title { font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 600; color: var(--jom-dark); margin-bottom: 18px; }

/* ── Stats ────────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card  { background: var(--jom-surface); border: 1px solid var(--jom-border); border-top: 3px solid var(--jom-dark); border-radius: 10px; padding: 16px; text-align: center; }
.stat-num   { font-family: 'Montserrat', sans-serif; font-size: 28px; font-weight: 300; color: var(--jom-dark); }
.stat-label { font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 600; color: var(--jom-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn         { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 7px; border: 1px solid var(--jom-border); background: white; cursor: pointer; font-size: 13px; font-family: 'Lato', sans-serif; font-weight: 700; color: var(--jom-text); text-decoration: none; }
.btn:hover   { background: var(--jom-bg); }
.btn-primary { background: var(--jom-dark); color: white; border-color: var(--jom-dark); }
.btn-primary:hover { background: var(--jom-mid1); }
.btn-success { background: #2d7a3a; color: white; border-color: #2d7a3a; }
.btn-danger  { background: #c0392b; color: white; border-color: #c0392b; }
.btn-sm      { padding: 5px 10px; font-size: 12px; }
.btn-block   { width: 100%; justify-content: center; margin-top: 4px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-row    { margin-bottom: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label        { display: block; font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 600; color: var(--jom-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--jom-border); border-radius: 7px; background: white; color: var(--jom-text); font-size: 13px; font-family: 'Lato', sans-serif;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--jom-light2); box-shadow: 0 0 0 3px rgba(63,117,185,0.15); }

/* ── Table ────────────────────────────────────────────────────────────────── */
table   { width: 100%; border-collapse: collapse; font-size: 13px; }
th      { text-align: left; padding: 9px 10px; font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 600; color: var(--jom-muted); border-bottom: 1px solid var(--jom-border); text-transform: uppercase; letter-spacing: 0.4px; }
td      { padding: 9px 10px; border-bottom: 1px solid var(--jom-border); vertical-align: middle; }
.muted  { color: var(--jom-muted); }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge          { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.badge-pending  { background: #fff3cd; color: #7a5c00; }
.badge-approved { background: #d4edda; color: #1d5c2d; }
.badge-denied   { background: #fde8e8; color: #8b1c1c; }
.badge-admin    { background: var(--jom-dark); color: white; }
.badge-chef     { background: #e8e6f7; color: #312C6F; }
.badge-employee { background: #f1f5f9; color: #64748b; }
.badge-auto     { background: #e8e6f7; color: #312C6F; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert         { padding: 10px 14px; border-radius: 7px; margin-bottom: 14px; font-size: 13px; }
.alert-success { background: #d4edda; color: #1d5c2d; border: 1px solid #b7d9c2; }
.alert-error   { background: #fde8e8; color: #8b1c1c; border: 1px solid #f5c6c6; }
.alert-info    { background: #dbeafe; color: #1e3a8a; border: 1px solid #bfdbfe; }

/* ── Info box ─────────────────────────────────────────────────────────────── */
.info-box      { background: #e8e6f7; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--jom-dark); margin-bottom: 16px; }
.info-warn     { background: #fff3cd; color: #7a5c00; }
.day-count-label { font-size: 13px; color: var(--jom-muted); margin-bottom: 14px; }

/* ── Activity feed ────────────────────────────────────────────────────────── */
.activity-row   { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--jom-border); }
.activity-info  { flex: 1; }
.activity-dates { font-size: 12px; color: var(--jom-muted); margin-left: 6px; }
.avatar-row     { display: flex; align-items: center; gap: 8px; }
.action-btns    { display: flex; gap: 6px; }

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--jom-light2); color: white; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; font-family: 'Montserrat', sans-serif; }

/* ── Calendar ─────────────────────────────────────────────────────────────── */
.cal-nav       { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal-nav-btn   { background: none; border: 1px solid var(--jom-border); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 18px; color: var(--jom-dark); line-height: 1; }
.cal-nav-btn:hover { background: var(--jom-bg); }
.cal-month-label { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600; color: var(--jom-dark); min-width: 170px; text-align: center; }
.cal-wrap      { overflow-x: auto; }
.cal-table     { border-collapse: collapse; font-size: 12px; width: 100%; }
.cal-table th  { background: var(--jom-dark); color: rgba(255,255,255,0.85); padding: 7px 4px; text-align: center; font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; }
.cal-table th.wn-th { background: var(--jom-mid1); color: rgba(255,255,255,0.6); font-size: 9px; }
.cal-table td  { padding: 3px; border: 1px solid var(--jom-border); text-align: center; vertical-align: top; min-width: 32px; background: white; }
.cal-table td.wn-cell { background: var(--jom-bg); color: var(--jom-muted); font-size: 9px; font-weight: 600; }
.cal-day-num   { font-size: 11px; font-weight: 700; display: block; padding: 2px 0; }
.day-holiday   { background: #fde8e8 !important; }
.day-holiday .cal-day-num { color: #8b1c1c; }
.day-closed    { background: #e8e6f7 !important; }
.day-closed .cal-day-num { color: #312C6F; }
.day-today .cal-day-num  { background: var(--jom-dark); color: white; border-radius: 50%; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; }
.day-approved  { background: #d4f0e4 !important; }
.day-pending   { background: #fff3cd !important; }
.day-weekend   { color: var(--jom-muted); }
.day-dot       { font-size: 9px; color: #1d5c2d; display: block; line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 2px; }
.day-dot-p     { color: #7a5c00; }
.legend        { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 11px; color: var(--jom-muted); }
.legend-box    { width: 12px; height: 12px; border-radius: 2px; display: inline-block; margin-right: 4px; border: 1px solid rgba(0,0,0,0.1); vertical-align: middle; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tab-bar     { display: flex; gap: 2px; margin-bottom: 16px; background: var(--jom-surface); border: 1px solid var(--jom-border); border-radius: 8px; padding: 4px; }
.tab         { padding: 7px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; font-family: 'Montserrat', sans-serif; font-weight: 600; color: var(--jom-muted); border: none; background: none; }
.tab.active  { background: var(--jom-dark); color: white; }
.tab:hover:not(.active) { background: var(--jom-bg); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Dept cards ───────────────────────────────────────────────────────────── */
.dept-card       { border: 1px solid var(--jom-border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.dept-header     { background: var(--jom-dark); color: white; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; }
.dept-header-name{ font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 600; }
.dept-header-sub { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.dept-body       { }
.member-row      { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--jom-border); }
.member-row:last-child { border-bottom: none; }
.member-info     { flex: 1; }
.member-name     { font-size: 13px; font-weight: 700; }
.member-email    { font-size: 11px; color: var(--jom-muted); }
.empty-dept      { padding: 14px 16px; color: var(--jom-muted); font-size: 13px; }

/* ── Closed/holiday rows ──────────────────────────────────────────────────── */
.closed-item  { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--jom-border); }
.holiday-row  { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--jom-border); font-size: 13px; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-bg     { display: none; position: fixed; inset: 0; background: rgba(20,18,50,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-bg.open{ display: flex; }
.modal        { background: white; border-radius: 12px; padding: 24px; width: 440px; max-width: 95vw; border: 1px solid var(--jom-border); box-shadow: 0 12px 40px rgba(49,44,111,0.2); max-height: 90vh; overflow-y: auto; }
.modal h3     { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600; color: var(--jom-dark); margin-bottom: 16px; }
.modal-actions{ display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.empty-state  { color: var(--jom-muted); text-align: center; padding: 24px; font-size: 13px; }
.empty-card   { text-align: center; padding: 36px; }
.empty-icon   { font-size: 36px; color: #2d7a3a; margin-bottom: 10px; }

/* ── Egen datumväljare ────────────────────────────────────────────────────── */
.datepicker-wrap     { position: relative; }
.datepicker-display  { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--jom-border); border-radius: 7px; background: white; cursor: pointer; font-size: 13px; }
.datepicker-display:hover { border-color: var(--jom-light2); }
.datepicker-dropdown { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 300; background: white; border: 1px solid var(--jom-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(49,44,111,0.15); padding: 12px; min-width: 260px; }
.datepicker-dropdown.open { display: block; }
.picker-nav          { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.picker-nav span     { font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 600; color: var(--jom-dark); }
.picker-nav button   { background: none; border: 1px solid var(--jom-border); border-radius: 5px; padding: 3px 8px; cursor: pointer; font-size: 16px; color: var(--jom-dark); line-height: 1; }
.picker-nav button:hover { background: var(--jom-bg); }
.picker-table        { border-collapse: collapse; width: 100%; }
.picker-table th     { font-family: 'Montserrat', sans-serif; font-size: 9px; font-weight: 600; color: var(--jom-muted); text-align: center; padding: 3px 1px; text-transform: uppercase; }
.picker-table td     { text-align: center; padding: 1px; }
.picker-wn           { font-size: 8px; color: var(--jom-light2); font-family: 'Montserrat', sans-serif; font-weight: 600; min-width: 22px; }
.pday                { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; font-family: 'Lato', sans-serif; font-weight: 700; color: var(--jom-text); }
.pday:hover          { background: var(--jom-bg); }
.pday-sel            { background: var(--jom-dark) !important; color: white !important; }
.pday-hol            { color: #8b1c1c; background: #fde8e8; }
.pday-closed         { color: #312C6F; background: #e8e6f7; }
.pday-we             { color: var(--jom-muted); }
.pday-today          { border: 2px solid var(--jom-light2); }
.auth-body  { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--jom-dark); }
.auth-wrap  { display: flex; align-items: center; justify-content: center; width: 100%; padding: 20px; }
.auth-box   { background: white; border-radius: 14px; padding: 36px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-logo  { width: 140px; height: 80px; border-radius: 12px; background: white; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; overflow:hidden; }
.auth-title { font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 600; color: var(--jom-dark); margin-bottom: 4px; }
.auth-sub   { font-size: 12px; color: var(--jom-muted); margin-bottom: 24px; }
.auth-link  { font-size: 13px; color: var(--jom-light2); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-box .form-row { text-align: left; }

/* ── Mobilanpassning ──────────────────────────────────────────────────────── */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 4px 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: white; margin: 5px 0; border-radius: 2px; transition: all 0.2s; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.sidebar-overlay.open { display: block; }

@media (max-width: 700px) {
  /* Topbar */
  .topbar { padding: 0 12px; height: 52px; }
  .topbar-sub { display: none; }
  .topbar-user { display: none; }
  .hamburger { display: block; }

  /* Sidebar — dold som drawer */
  .sidebar { position: fixed; top: 0; left: -220px; height: 100vh; z-index: 100; width: 220px; transition: left 0.25s ease; padding-top: 60px; }
  .sidebar.open { left: 0; }

  /* Main content */
  .main-content { padding: 14px; }
  .page-title { font-size: 15px; margin-bottom: 12px; }

  /* Stats — en kolumn */
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 9px; }

  /* Formulär — en kolumn */
  .form-grid-2 { grid-template-columns: 1fr; gap: 0; }

  /* Tabeller — scrollbara */
  .card { padding: 12px; overflow-x: auto; }
  table { font-size: 12px; min-width: 500px; }
  th, td { padding: 7px 6px; }

  /* Knappar större på mobil */
  .btn { padding: 10px 14px; font-size: 13px; }
  .btn-sm { padding: 7px 10px; font-size: 12px; }
  .btn-block { padding: 12px; font-size: 15px; }

  /* Kalender */
  .cal-table { font-size: 10px; }
  .cal-table td { min-width: 24px; padding: 2px; }
  .cal-month-label { font-size: 13px; min-width: 130px; }

  /* Datumväljare — full bredd */
  .datepicker-dropdown { min-width: 240px; left: 0; right: 0; }

  /* Modal — full bredd */
  .modal { width: 95vw; padding: 16px; }

  /* Tabs — scrollbara */
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; padding: 7px 12px; font-size: 12px; }

  /* Card title — stapla på mobil */
  .card-title { flex-wrap: wrap; gap: 8px; }
}
.hidden { display: none !important; }

.day-overflow { background: var(--jom-bg) !important; }
.day-overflow .cal-day-num { color: var(--jom-muted); }
