/* ============================================================
   GMAO ARGOS OCEAN INDIEN — Feuille de styles
   Charte: #1f769e
   ============================================================ */

:root {
  --brand: #1f769e;
  --brand-dark: #155a7a;
  --brand-light: #e8f1f7;
  --brand-lighter: #f5f9fc;

  --text: #1a2332;
  --text-muted: #5a6b7a;
  --text-light: #8a98a5;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e3e8ee;
  --border-strong: #cfd6de;

  --success: #2e9e5b;
  --success-bg: #e6f5ec;
  --warning: #d97a00;
  --warning-bg: #fdf2e0;
  --danger: #c8362d;
  --danger-bg: #fbe9e7;
  --info: #1f769e;
  --info-bg: #e8f1f7;
  --neutral: #6b7280;
  --neutral-bg: #eef0f3;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(15, 32, 50, .06);
  --shadow: 0 2px 8px rgba(15, 32, 50, .08);
  --shadow-lg: 0 8px 24px rgba(15, 32, 50, .12);

  --sidebar-w: 240px;
  --header-h: 60px;

  --font: "Georgia", "Times New Roman", "Cambria", "Liberation Serif", serif;
  --font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; }
h1,h2,h3,h4 { font-family: var(--font); margin: 0; line-height: 1.25; color: var(--text); }
h1 svg, h2 svg, h3 svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--brand); }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f769e 0%, #0f3a52 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img {
  max-height: 96px;
  max-width: 80%;
  height: auto;
  width: auto;
  object-fit: contain;
  display: inline-block;
}
.login-title {
  text-align: center;
  font-family: var(--font);
  font-size: 18px;
  margin-bottom: 24px;
  color: var(--text-muted);
}
.login-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}
.login-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all .15s;
}
.login-tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.login-form .form-group { margin-bottom: 16px; }
.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.login-hint {
  margin-top: 16px;
  padding: 12px;
  background: var(--brand-lighter);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.login-hint strong { color: var(--brand); }

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

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform .25s;
}
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header img {
  max-height: 56px;
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  padding: 12px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  margin: 2px 0;
}
.nav-item:hover { background: var(--brand-lighter); text-decoration: none; }
.nav-item.active { background: var(--brand); color: #fff; }
.nav-item.active svg { stroke: #fff; }
.nav-item svg { width: 18px; height: 18px; stroke: var(--text-muted); flex-shrink: 0; }
.nav-count {
  display: inline-block;
  margin-left: 6px;
  background: var(--warning);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}
.nav-item.active .nav-count { background: rgba(255,255,255,0.25); color: #fff; }
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-btn {
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.logout-btn:hover { background: var(--danger-bg); color: var(--danger); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 18px; flex: 1; }
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
}
.menu-toggle:hover { background: var(--bg); }

.content { padding: 24px; flex: 1; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-header h2 { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--brand-light);
  color: var(--brand);
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.success { background: var(--success-bg); color: var(--success); }
.kpi-icon.warning { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.danger  { background: var(--danger-bg); color: var(--danger); }
.kpi-value { font-family: var(--font); font-size: 24px; font-weight: 700; line-height: 1; }
.kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a52a22; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 118, 158, 0.15);
}
.textarea { resize: vertical; min-height: 80px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%235a6b7a' stroke-width='1.5' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  padding-right: 32px;
}

/* ---------- Tables ---------- */
.data-table { width: 100%; }
.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--brand-lighter);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover { background: var(--brand-lighter); }
.data-table .actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.data-table .ticket-link {
  font-weight: 700;
  color: var(--brand);
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.empty svg { width: 48px; height: 48px; opacity: .3; margin-bottom: 8px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  background: var(--neutral-bg);
  color: var(--neutral);
}
.badge.dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.status-nouveau { background: var(--info-bg); color: var(--info); }
.badge.status-planifie { background: #ede9fe; color: #6d28d9; }
.badge.status-en_cours { background: var(--warning-bg); color: var(--warning); }
.badge.status-resolu { background: var(--success-bg); color: var(--success); }
.badge.status-cloture { background: var(--neutral-bg); color: var(--neutral); }

.badge.priority-basse { background: var(--neutral-bg); color: var(--neutral); }
.badge.priority-normale { background: var(--info-bg); color: var(--info); }
.badge.priority-haute { background: var(--warning-bg); color: var(--warning); }
.badge.priority-urgente { background: var(--danger-bg); color: var(--danger); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--brand-lighter);
}
.toolbar .search {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.toolbar .search svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-light);
}
.toolbar .search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}
.toolbar .filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar .select { padding: 7px 28px 7px 10px; min-width: 130px; font-size: 13px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 50, .55);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 16px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s;
}
.modal.lg { max-width: 900px; }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-header h2 { flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--brand-lighter);
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
  max-width: 400px;
  animation: toastIn .2s;
}
@keyframes toastIn { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ---------- Detail page ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 18px;
  padding: 18px;
  background: var(--brand-lighter);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.meta-item .meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .3px;
}
.meta-item .meta-value {
  font-size: 14px;
  margin-top: 2px;
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.meta-item { min-width: 0; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.comment {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
}
.comment.client { border-left-color: var(--warning); }
.comment-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.comment-author { font-weight: 700; }
.comment-date { color: var(--text-muted); }

/* ---------- Planning ---------- */
.planning-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.planning-grid {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
}
.planning-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}
.planning-table th, .planning-table td {
  border: 1px solid var(--border);
  padding: 8px;
  vertical-align: top;
  min-width: 110px;
}
.planning-table th {
  background: var(--brand-lighter);
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  position: sticky;
  top: 0;
}
.planning-table th.tech-col, .planning-table td.tech-col {
  background: var(--brand-lighter);
  position: sticky;
  left: 0;
  z-index: 5;
  width: 130px;
  min-width: 130px;
  text-align: left;
}
.planning-table th.tech-col { z-index: 6; }
.planning-cell { min-height: 70px; }
.planning-event {
  background: var(--brand);
  color: #fff;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 11px;
  margin-bottom: 4px;
  cursor: pointer;
  border-left: 3px solid rgba(255,255,255,.3);
  display: block;
}
.planning-event:hover { opacity: .9; text-decoration: none; }
.planning-event .num { font-weight: 700; font-family: ui-monospace, monospace; }
.planning-event .title { display: block; opacity: .9; font-size: 10px; }

.planning-chantier {
  background: repeating-linear-gradient(45deg, #6d28d9, #6d28d9 5px, #5b1fb6 5px, #5b1fb6 10px);
  color: #fff;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 11px;
  margin-bottom: 4px;
  cursor: pointer;
  border-left: 3px solid rgba(255,255,255,.5);
  display: block;
}
.planning-chantier:hover { opacity: .9; text-decoration: none; }
.planning-chantier .num   { font-weight: 700; font-family: ui-monospace, monospace; }
.planning-chantier .title { display: block; opacity: .95; font-size: 10px; }
.planning-chantier .tag   { display: inline-block; background: rgba(255,255,255,.2); padding: 0 4px; border-radius: 3px; font-size: 9px; margin-left: 4px; }

.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.tech-color {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

/* Tooltip permanent sur les markers de la map équipements */
.leaflet-equip-tip {
  background: #1f769e;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  max-width: 220px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.leaflet-equip-tip code {
  background: rgba(255,255,255,.18);
  color: #fff;
  padding: 0 3px;
  border-radius: 2px;
  font-size: 10px;
}
.leaflet-equip-tip::before {
  border-top-color: #1f769e !important;
}

/* Planning — jours fériés, week-end, congés (semaine) */
.planning-table th.pl-holiday {
  background: #fde8e7;
}
.planning-cell.pl-weekend { background: #fafbfc; }
.planning-cell.pl-holiday {
  background: repeating-linear-gradient(45deg, #fde8e7, #fde8e7 6px, #fff0ef 6px, #fff0ef 12px);
}
.planning-cell.pl-leave {
  background: repeating-linear-gradient(135deg, #fff4e6, #fff4e6 6px, #fef0d8 6px, #fef0d8 12px);
}
.pl-leave-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--warning);
  background: rgba(217,122,0,.12);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Planning — vue mois */
.planning-month {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pl-month-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--brand-lighter);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.pl-month-head > div {
  padding: 8px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.pl-month-head > div:last-child { border-right: 0; }
.pl-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.pl-month-cell {
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: 6px;
  min-height: 100px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
}
.pl-month-cell:nth-child(7n) { border-right: 0; }
.pl-month-cell.pl-out { background: #fafbfc; opacity: .65; }
.pl-month-cell.pl-today { background: #eaf3f8; }
.pl-month-cell.pl-holiday {
  background: repeating-linear-gradient(45deg, #fde8e7, #fde8e7 8px, #fff0ef 8px, #fff0ef 16px);
}
.pl-month-day {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
}
.pl-day-num { font-weight: 700; color: var(--text); }
.pl-month-cell.pl-out .pl-day-num { color: var(--text-light); }
.pl-day-holiday {
  font-size: 10px;
  color: var(--danger);
  font-weight: 600;
}
.pl-month-event {
  display: block;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.pl-month-event:hover { opacity: .85; text-decoration: none; }
.pl-month-event .tag {
  display: inline-block;
  font-size: 9px;
  background: rgba(255,255,255,.25);
  padding: 0 3px;
  border-radius: 2px;
  margin-right: 3px;
}
.pl-month-event .num { font-family: ui-monospace, monospace; font-weight: 700; }
.pl-month-more {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 1px 5px;
}
.pl-month-leaves {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.pl-leave-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: var(--warning);
  background: rgba(217,122,0,.12);
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .pl-month-cell { min-height: 70px; padding: 4px; }
  .pl-month-event { font-size: 9px; }
}

/* ---------- Charts ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.chart-wrap {
  position: relative;
  height: 280px;
}

/* ---------- Misc ---------- */
.muted { color: var(--text-muted); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gap-sm { gap: 6px; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.full-width { width: 100%; }
.hide { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar h1 { font-size: 16px; }
  .modal { max-height: 100vh; border-radius: 0; }
  .modal-backdrop { padding: 0; }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }
  .toolbar { padding: 12px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 20px; }
}

@media (max-width: 600px) {
  .login-card { padding: 24px 20px; }
  .data-table thead { display: none; }
  .data-table tr {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    border: 0;
    padding: 5px 0;
  }
  .data-table td:before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 12px;
  }
  .data-table td.actions { justify-content: flex-start; padding-top: 10px; }
  .data-table td.actions:before { display: none; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 50, .4);
  z-index: 40;
}
.sidebar-overlay.show { display: block; }
