/* ============================================================
   Shree Airlines Payroll — front-end theme
   Palette + type from Shree Airlines Brand Guidelines (Jan 2017).
   Primary Red #da2424 · Maroon #a50c13 · Deep Yellow #f7a41e
   Type: Lato (primary) with Arial fallback, per the guidelines.
   ============================================================ */
:root {
  --red:    #da2424;   /* Primary Red   (Pantone 2035 C) */
  --maroon: #a50c13;   /* Secondary Red (Pantone 484 C)  */
  --yellow: #f7a41e;   /* Deep Yellow   (Pantone 130 C)  */
  --black:  #111111;
  --ink:    #1f2328;
  --gray:   #a7a9ac;   /* Cool Gray 6 C */
  --g-bg:   #f4f6f7;
  --g-soft: #ecf0f1;
  --line:   #d0d3d4;
  --muted:  #7b7d7d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Lato', Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--g-bg);
  -webkit-font-smoothing: antialiased;
}

/* red -> yellow accent, echoing the brand's header motif */
.accentbar { height: 3px; background: linear-gradient(90deg, var(--red) 0%, var(--maroon) 55%, var(--yellow) 100%); }

/* wordmark: lowercase, 'shree' red + 'airlines' black */
.wordmark { font-weight: 700; letter-spacing: .1px; font-size: 20px; text-transform: lowercase; white-space: nowrap; }
.wordmark .s { color: var(--red); }
.wordmark .a { color: var(--black); font-weight: 400; }
.wordmark.on-dark .a { color: #fff; }

.topbar { display: flex; align-items: center; gap: 26px; background: #fff; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; gap: 20px; flex: 1; }
.topbar nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; padding: 4px 2px; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--red); }
.topbar nav a.active { color: var(--red); border-bottom-color: var(--red); }
.topbar .who { font-size: 13px; text-align: right; color: var(--ink); }
.topbar .who .roles { display: block; font-size: 11px; color: var(--muted); }

main { max-width: 1000px; margin: 26px auto; padding: 0 22px; }
h1 { font-size: 24px; font-weight: 700; color: var(--black); margin: 0 0 14px; }
h1 .muted { font-weight: 400; }
h2 { font-size: 16px; font-weight: 700; color: var(--maroon); margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 13px; }
.section-label { color: var(--red); font-weight: 700; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }

.cards { display: flex; gap: 16px; margin: 18px 0; }
.card { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 10px; padding: 18px 22px; flex: 1; }
.card .num { font-size: 32px; font-weight: 800; color: var(--red); line-height: 1.1; }
.card div:last-child { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--g-soft); font-size: 14px; }
th { background: var(--g-soft); color: var(--maroon); font-weight: 700; }
tbody tr:hover { background: #fafbfc; }

.login-wrap { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; box-shadow: 0 8px 30px rgba(17,17,17,.06); }
.login-card .wordmark { font-size: 26px; display: block; margin-bottom: 6px; }
.login-card h1 { font-size: 17px; color: var(--ink); font-weight: 600; margin: 4px 0 16px; }

label { display: block; margin: 12px 0; font-size: 13px; font-weight: 600; color: var(--ink); }
input { width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(218,36,36,.12); }
.check { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 4px 14px 4px 0; font-size: 13px; font-weight: 400; }
.check input { width: auto; margin: 0; }

button.primary, .btn.primary { background: var(--red); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary:hover, .btn.primary:hover { background: var(--maroon); }
button.primary { width: 100%; margin-top: 8px; }
.btn.primary { width: auto; font-size: 13px; margin-left: 10px; padding: 7px 14px; }
button.link { background: none; border: none; color: var(--red); cursor: pointer; font-size: 14px; font-weight: 600; padding: 0; }
button.link:hover { color: var(--maroon); }
.inline { display: inline; }

.stack label, .stack fieldset { max-width: 440px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 10px 14px; }
legend { color: var(--maroon); font-weight: 700; font-size: 13px; padding: 0 6px; }
.rolecard { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; padding: 16px 18px; margin: 14px 0; }
.permgrid { display: flex; flex-wrap: wrap; margin: 8px 0 12px; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.flash.error { background: #fdecea; color: var(--maroon); border: 1px solid #f5c6c2; }
.flash.ok { background: #e7f6ec; color: #12622d; border: 1px solid #bfe6cb; }

/* Phase 3 — staff master */
.pill { text-decoration:none; font-size:13px; font-weight:600; color:var(--ink); border:1px solid var(--line); border-radius:999px; padding:4px 12px; background:#fff; }
.pill.on { background:var(--red); color:#fff; border-color:var(--red); }
.btn.ghost { background:#fff; color:var(--ink); border:1px solid var(--line); padding:7px 14px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-block; }
.btn.ghost:hover { border-color:var(--red); color:var(--red); }
th.sens, td.sens { display:none; }
table.reveal th.sens, table.reveal td.sens { display:table-cell; background:#fff7f7; }
table.kv td:first-child { color:var(--muted); width:160px; }
table.kv { border:none; }
table.kv td { border-bottom:1px solid var(--g-soft); }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.grid2 label { margin:8px 0; }
select { width:100%; margin-top:5px; padding:9px 11px; border:1px solid var(--line); border-radius:8px; font-size:14px; font-family:inherit; background:#fff; }

main.wide { max-width: 1600px; margin: 26px auto 26px 28px; }

.logo-img { height: 30px; width: auto; display: block; }
.login-logo { height: 40px; margin: 0 auto 10px; }

/* configuration: collapsible, compact */
.cfg-sec { background:#fff; border:1px solid var(--line); border-radius:10px; padding:10px 16px; margin:12px 0; max-width:100%; }
.cfg-sec > summary { cursor:pointer; font-weight:700; color:var(--maroon); font-size:15px; padding:4px 0; list-style:revert; }
.cfg-sec[open] > summary { border-bottom:1px solid var(--g-soft); margin-bottom:8px; padding-bottom:8px; }
table.cfg th, table.cfg td { padding:3px 6px; font-size:12px; }
table.cfg input { padding:3px 5px; font-size:12px; }

td.r, th.r { text-align: right; }

/* compact + zebra tables (dashboard, staff master) */
table.tight th, table.tight td { padding: 4px 9px; font-size: 13px; }
table.zebra tbody tr:nth-child(even) { background: #faf6f6; }
table.zebra tbody tr:hover { background: #fdeeee; }
.grade-groups { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.grade-groups table { width: max-content; flex: 0 0 auto; }
.grade-groups table.tight th, .grade-groups table.tight td { padding: 3px 10px; white-space: nowrap; }

.th-hidden .th-col { display: none !important; }

.roles-table thead th { position: sticky; top: 0; background: #f4eeee; z-index: 2; }
.save-btn:disabled { opacity: .45; cursor: not-allowed; }

/* vertical separators so role columns line up with their headers */
.roles-table th, .roles-table td { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.roles-table th:first-child, .roles-table td:first-child { border-left: none; }
.roles-table th, .roles-table td { text-align: center; }
.roles-table th:first-child, .roles-table td:first-child { text-align: left; }
