/* Danone Scheduling Tool - shared stylesheet. Every page loads this first; a page's own <style>
   only adds what is specific to it. Colours and sizes come from the tokens below. */
:root {
  --navy: #1a3a5c; --blue: #2563eb; --blue-light: #60a5fa; --green: #16a34a; --red: #dc2626; --amber: #f59e0b;
  --ink: #1e293b; --muted: #6b7280; --line: #e5e7eb; --ground: #f0f4f8; --card: #ffffff;
  --gray-light: #f3f4f6; --border: #e5e7eb; --radius: 12px; --shadow: 0 4px 6px rgba(0,0,0,.07);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }   /* the scrollbar never shifts the toolbar between short and long pages */

  :root {
    --blue-dark: #1a3a5c;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --green: #16a34a;
    --green-light: #dcfce7;
    --red: #dc2626;
    --red-light: #fee2e2;
    --yellow: #ca8a04;
    --yellow-light: #fef9c3;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --border: #e5e7eb;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Segoe UI', sans-serif; background: #f0f4f8; color: #1e293b; min-height: 100vh; }

  .navbar {
    background: var(--blue-dark); color: white; padding: 0 24px;
    display: flex; align-items: center; height: 56px; gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); position: sticky; top: 0; z-index: 100;
  }
  .navbar-brand { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; text-decoration: none; color: white; }
  .navbar-brand span { color: #60a5fa; }
  .navbar-tabs { display: flex; gap: 4px; margin-left: auto; align-items: center; }
  .nav-tab {
    padding: 8px 16px; border-radius: 6px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: #93c5fd;
    transition: all 0.15s; border: none; background: none; text-decoration: none;
  }
  .nav-tab:hover { background: rgba(255,255,255,0.1); color: white; }
  .nav-tab.active { background: #2563eb; color: white; }
  .nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; z-index: 1000;
    background: white; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    min-width: 160px; padding: 6px 0; margin-top: 4px;
  }
  .nav-dropdown-menu.show { display: block; }
  .nav-dropdown-menu a {
    display: block; padding: 8px 16px; color: #1e293b; text-decoration: none;
    font-size: 13px; font-weight: 500;
  }
  .nav-dropdown-menu a:hover { background: #f1f5f9; color: #2563eb; }
  .navbar-user {
    margin-left: 16px; padding: 6px 12px; background: rgba(255,255,255,0.1);
    border-radius: 20px; font-size: 13px; display: flex; align-items: center; gap: 8px;
  }
  .user-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; }
  .avatar-chip { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 26px; border: 2px solid rgba(255,255,255,.35); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; background: #2563eb; letter-spacing: .3px; vertical-align: middle; }
  .avatar-big { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid #e5e7eb; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: #fff; background: #2563eb; }

  .main { padding: 20px 24px; max-width: 1600px; margin: 0 auto; }

  .card {
    background: white; border-radius: 12px; box-shadow: var(--shadow-md);
    border: 1px solid var(--border); margin-bottom: 16px;
  }
  .card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
  }
  .card-title { font-size: 15px; font-weight: 600; color: var(--blue-dark); }
  .card-body { padding: 20px; }

  .stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
  .stat-card {
    background: white; border-radius: 12px; padding: 20px;
    border: 1px solid var(--border); box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 6px;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
  .stat-label { font-size: 12px; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
  .stat-value { font-size: 28px; font-weight: 700; color: var(--blue-dark); }
  .stat-sub { font-size: 12px; color: var(--gray); }

  .btn {
    padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; transition: all 0.15s; display: inline-flex;
    align-items: center; gap: 6px; text-decoration: none;
  }
  .btn-primary { background: var(--blue); color: white; }
  .btn-primary:hover { background: #1d4ed8; }
  .btn-success { background: var(--green); color: white; }
  .btn-success:hover { background: #15803d; }
  .btn-danger { background: var(--red); color: white; }
  .btn-danger:hover { background: #b91c1c; }
  .btn-warning { background: #f59e0b; color: white; }
  .btn-warning:hover { background: #d97706; }
  .btn-outline { background: white; color: var(--blue); border: 1px solid var(--blue); }
  .btn-outline:hover { background: var(--blue-light); }
  .btn-sm { padding: 5px 10px; font-size: 12px; }
  .btn-gray { background: var(--gray-light); color: #374151; border: 1px solid var(--border); }
  .btn-gray:hover { background: #e5e7eb; }
  .btn:disabled { opacity: 0.6; cursor: not-allowed; }
  .btn:active:not(:disabled) { transform: scale(0.97); }

  .filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .filter-select, .filter-input {
    padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; background: white; color: #374151; outline: none;
  }
  .filter-select:focus, .filter-input:focus { border-color: var(--blue); }
  input::-ms-reveal, input::-ms-clear { display: none; }
  input::-webkit-credentials-auto-fill-button { display: none !important; }

  .alert {
    padding: 12px 16px; border-radius: 8px; font-size: 13px;
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  }
  .alert-info { background: var(--blue-light); color: #1d4ed8; border: 1px solid #93c5fd; }
  .alert-warning { background: var(--yellow-light); color: #92400e; border: 1px solid #fde68a; }
  .alert-success { background: var(--green-light); color: #15803d; border: 1px solid #86efac; }

  .crew-badge {
    display: inline-block; width: 20px; height: 20px; border-radius: 50%;
    text-align: center; line-height: 20px; font-size: 10px; font-weight: 700;
    color: white; margin-right: 4px;
  }
  .crew-A { background: #3b82f6; }
  .crew-B { background: #10b981; }
  .crew-C { background: #f59e0b; }
  .crew-D { background: #8b5cf6; }

  .status-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 600; text-align: center;
  }
  .s-work { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
  .s-vac, .s-pd { background: #FFFF99; color: #92400e; }
  .s-loa, .s-brv, .s-jury { background: #FFC878; color: #92400e; }
  .s-forced { background: #FF6666; color: white; font-weight: bold; }
  .s-switch { background: #FFC878; color: #92400e; font-weight: bold; }
  .s-linechange { background: #CCB2ED; color: #4a2d7a; font-weight: bold; }
  .s-down { background: #C0C0C0; color: #333; font-weight: bold; }
  .s-off { background: #f9fafb; color: #9ca3af; }
  .s-flex { background: #BDD7EE; color: #1a3a5c; }
  .s-trvl { background: #CCB2ED; color: #4a2d7a; }
  .s-callin { background: #FCA5A5; color: #7f1d1d; }
  .s-proj { background: #FBCFE8; color: #831843; }
  .s-support { background: #C6EFCE; color: #166534; }
  .s-volunteer { background: #C6EFCE; color: #166534; }

  /* Modal */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
    opacity: 0; transition: opacity 0.2s;
  }
  .modal-overlay.show { display: flex; opacity: 1; }
  .modal {
    background: white; border-radius: 16px; width: 100%; max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
    transform: scale(0.95); transition: transform 0.2s;
  }
  .modal-overlay.show .modal { transform: scale(1); }
  .modal-header {
    padding: 20px 24px; background: var(--blue-dark); color: white;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
  }
  .modal-title { font-size: 16px; font-weight: 700; }
  .modal-close { background: none; border: none; color: white; font-size: 20px; cursor: pointer; }
  .modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; flex: 1; min-height: 0; }
  .modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }
  .form-group { display: flex; flex-direction: column; gap: 6px; }
  .form-label { font-size: 13px; font-weight: 600; color: #374151; }
  .form-input, .form-select {
    padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; outline: none;
    width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  }
  .form-group { min-width: 0; }
  .modal-body > div[style*="grid-template-columns"] > * { min-width: 0; }

  /* Toast */
  .toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    background: #1e293b; color: white; padding: 12px 20px; border-radius: 10px;
    font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transform: translateY(100px); opacity: 0; transition: all 0.3s;
  }
  .toast.show { transform: translateY(0); opacity: 1; }
  .toast.success { background: #15803d; }
  .toast.error { background: #dc2626; }

  /* Print */
  .print-brand { display: none; }
  @page { size: letter; margin: 0.4in; }
  @media print {
    .print-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid #1a3a5c; font-size: 11px; color: #374151; }
    .print-brand img { height: 26px; }
    .navbar, .filter-row, .btn, .no-print, .modal-overlay, .toast { display: none !important; }
    .main { padding: 0; max-width: 100%; width: 100%; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; margin: 0 0 8px; }
    .card-body { padding: 8px; }
    .table-wrap, .board-grid, .ts-scroll { overflow: visible !important; max-height: none !important; }
    table { width: 100%; font-size: 10px; }
    th, td { padding: 3px 4px; }
    body { background: white; color: #000; font-size: 11px; }
    a { color: inherit; text-decoration: none; }
  }

  /* Hamburger menu button - hidden on desktop */
  .hamburger-btn {
    display: none; background: none; border: none; color: white; font-size: 24px;
    cursor: pointer; padding: 4px 8px; margin-left: auto;
  }

  @media (max-width: 768px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .main { padding: 10px; }
    body { font-size: 14px; }

    /* Hamburger menu */
    .hamburger-btn { display: block; }
    .navbar { flex-wrap: wrap; height: auto; padding: 10px 16px; }
    .navbar-tabs {
      display: none; flex-direction: column; width: 100%; gap: 2px;
      padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.15); margin-top: 8px;
    }
    .navbar-tabs.mobile-open { display: flex; }
    .nav-tab { padding: 10px 12px; font-size: 14px; border-radius: 6px; text-align: left; }
    .navbar-user { margin-left: 0; margin-top: 0; font-size: 12px; }

    /* Horizontal scroll for tables */
    .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 600px; }

    /* Full-width modals */
    .modal { max-width: 100% !important; border-radius: 12px; margin: 8px; }
    .modal-overlay { padding: 8px; }

    /* Reduce font sizes */
    .card-title { font-size: 14px; }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 11px; }
    .btn { font-size: 12px; padding: 6px 12px; }
    .filter-select, .filter-input { font-size: 12px; padding: 6px 10px; }

    /* Stack filter rows */
    .filter-row { flex-direction: column; align-items: stretch; }
    .card-header { flex-direction: column; align-items: stretch; }
  }

  @media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .stat-value { font-size: 18px; }
  }

/* ─── Shared additions ─────────────────────────────────────────────── */
/* Employee-page status badges (same colours as the supervisor status-badge set) */
.badge { display:inline-block; padding:3px 10px; border-radius:10px; font-size:11px; font-weight:600; }
.b-work { background:#dcfce7; color:#166534; } .b-off { background:#f3f4f6; color:#6b7280; }
.b-vac { background:#fef3c7; color:#92400e; } .b-pd { background:#ede9fe; color:#6d28d9; }
.b-loa, .b-brv, .b-jury { background:#fee2e2; color:#dc2626; } .b-mil { background:#e0e7ff; color:#3730a3; } .b-forced { background:#fee2e2; color:#991b1b; }
.b-volunteer { background:#dbeafe; color:#1d4ed8; } .b-switch { background:#fef3c7; color:#b45309; }
.b-trvl { background:#ede9fe; color:#6d28d9; } .b-callin { background:#fee2e2; color:#991b1b; }
.b-flex { background:#dbeafe; color:#1a3a5c; } .b-proj { background:#fce7f3; color:#9d174d; }

/* Tables: never let a wide table scroll the whole page */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 100%; }

/* Boards: day and night side by side on a wide screen, stacked on a phone */
.board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .board-grid { grid-template-columns: 1fr; } }

/* Buttons show they are working */
.btn.loading, button[disabled].loading { opacity: .6; cursor: progress; }
.btn:focus-visible, .form-input:focus-visible, .form-select:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }

/* Navbar brand with logo */
.navbar-brand img { height: 26px; vertical-align: middle; margin-right: 8px; background: white; border-radius: 6px; padding: 2px 6px; }

/* Error pages */
.error-page { max-width: 520px; margin: 80px auto; text-align: center; padding: 24px; }
.error-page h1 { color: var(--navy); font-size: 40px; margin-bottom: 8px; }
.error-page p { color: var(--muted); margin-bottom: 18px; }

/* Phones: comfortable tap targets and no horizontal page scroll */
@media (max-width: 768px) {
  .main { padding: 10px 10px 40px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .filter-row { flex-wrap: wrap; }
  .btn-sm { padding: 8px 12px; }
  .modal { max-width: 100%; }
}

/* Dashboard sections */
.section-title { font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:18px 0 10px; display:flex; align-items:baseline; gap:10px; }
.section-title span { font-weight:500; letter-spacing:0; text-transform:none; font-size:13px; }
.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.dash-grid > .card { margin-bottom:0; }
@media (max-width: 900px) { .dash-grid { grid-template-columns:1fr; } }

  /* Photo or initials shown beside a person's name on the roster and profile pages */
  .avatar-face { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 32px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; background: #2563eb; vertical-align: middle; }
  .avatar-face.sm { width: 24px; height: 24px; flex-basis: 24px; font-size: 9px; margin-right: 6px; }
  .avatar-face.lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 20px; }
