/* ============================================================
   Legends Global - Employee Database - UI Stylesheet
   Brand: Black / White / Neutral. Brand font: Nicky Sans.
   Functional colour used only for success / warning / error / info states.
   ============================================================ */

/* Brand font: Nicky Sans */
@font-face { font-family:'Nicky Sans'; src:url('/assets/fonts/NickySans-Light.woff2') format('woff2');   font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'Nicky Sans'; src:url('/assets/fonts/NickySans-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Nicky Sans'; src:url('/assets/fonts/NickySans-Medium.woff2') format('woff2');  font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Nicky Sans'; src:url('/assets/fonts/NickySans-Bold.woff2') format('woff2');    font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Nicky Sans'; src:url('/assets/fonts/NickySans-Black.woff2') format('woff2');   font-weight:800 900; font-style:normal; font-display:swap; }

:root {
  --black:      #0a0a0a;
  --white:      #ffffff;
  --grey-100:   #f5f5f5;
  --grey-200:   #e8e8e8;
  --grey-300:   #d0d0d0;
  --grey-500:   #8a8a8a;
  --grey-700:   #444444;
  --grey-900:   #1a1a1a;

  /* Functional states only */
  --success:    #2d7a4f;
  --success-bg: #edf7f2;
  --warning:    #8a5c00;
  --warning-bg: #fdf6e3;
  --error:      #a02020;
  --error-bg:   #fdf0f0;
  --info:       #1a5276;
  --info-bg:    #eaf2f8;

  --sidebar-w:  248px;
  --radius:     7px;
  --radius-lg:  12px;
  --font:       'Nicky Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:  'Consolas', 'Courier New', monospace;
  --shadow:     0 1px 2px rgba(16,16,16,0.04), 0 1px 3px rgba(16,16,16,0.06);
  --shadow-md:  0 6px 20px rgba(16,16,16,0.08);
  --shadow-lg:  0 12px 32px rgba(16,16,16,0.12);
  --line:       #ececec;
  --surface:    #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--grey-100);
  color: var(--grey-900);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--grey-900); text-decoration: underline; }
a:hover { color: var(--black); }

/* ============================================================
   LAYOUT
   ============================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}

/*
  LOGO PLACEHOLDER
  Replace .logo-placeholder content with the official Legends Global logo file.
  - Use the white/reversed version on this dark background.
  - Do NOT alter the logo's colours, proportions, orientation, or spacing.
  - Do NOT place any text inside the enso circle.
  - Obtain the approved file from the Legends Global brand team.
*/
.logo-placeholder {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--white);
}
.logo-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--grey-300);
  font-weight: 400;
}
.app-sub {
  display: block;
  font-size: 10px;
  color: var(--grey-500);
  letter-spacing: 0.05em;
  margin-top: 6px;
}

.sidebar-section {
  padding: 8px 0 16px;
  flex: 1;
}

.nav-group-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-500);
  padding: 12px 16px 4px;
  font-weight: 600;
}

.sidebar a {
  display: block;
  padding: 8px 16px;
  color: var(--grey-300);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

.sidebar a.active {
  color: var(--white);
  border-left-color: var(--white);
  background: rgba(255,255,255,0.10);
  font-weight: 600;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar .page-title { font-weight: 600; font-size: 15px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-label {
  font-size: 13px;
  color: var(--grey-700);
}

.content {
  padding: 24px;
  max-width: 1280px;
}

/* ============================================================
   PAGE HEADERS
   ============================================================ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
}

.page-subtitle {
  color: var(--grey-500);
  font-size: 14px;
  margin-top: 2px;
}

.page-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--grey-300);
  background: var(--white);
  color: var(--grey-900);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { background: var(--grey-100); border-color: var(--grey-500); color: var(--grey-900); }

.btn-primary { background: var(--black); color: var(--white); border-color: var(--black); }
.btn-primary:hover { background: var(--grey-900); color: var(--white); border-color: var(--grey-900); }

.btn-outline { background: transparent; }

.btn-error { background: var(--error); color: var(--white); border-color: var(--error); }
.btn-error:hover { background: #880000; color: var(--white); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--grey-900);
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
  font-family: var(--font);
}

/* ============================================================
   ALERTS & BADGES
   ============================================================ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 4px solid;
  line-height: 1.5;
}

.alert a { font-weight: 600; }

.alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.alert-error   { background: var(--error-bg);   border-color: var(--error);   color: var(--error); }
.alert-info    { background: var(--info-bg);     border-color: var(--info);    color: var(--info); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error   { background: var(--error-bg);   color: var(--error); }
.badge-info    { background: var(--info-bg);     color: var(--info); }
.badge-neutral { background: var(--grey-200);    color: var(--grey-700); }

/* ============================================================
   PANELS
   ============================================================ */

.panel {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--grey-100);
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--grey-900);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel > dl,
.panel > p,
.panel > ul { padding: 16px 20px; }

.panel-warning { border-color: var(--warning); }
.panel-error   { border-color: var(--error); }

.mt-4 { margin-top: 16px; }

/* ============================================================
   DATA LISTS
   ============================================================ */

.data-list {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 8px 16px;
  font-size: 14px;
}

.data-list dt { color: var(--grey-700); font-weight: 500; padding-top: 1px; }
.data-list dd { color: var(--grey-900); }

/* ============================================================
   TABLES
   ============================================================ */

.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--grey-100);
  border-bottom: 2px solid var(--grey-200);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-700);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--grey-200);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--grey-100); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table .actions {
  display: flex;
  gap: 10px;
  white-space: nowrap;
  flex-wrap: wrap;
}

.data-table .actions a,
.data-table .actions .btn-link { font-size: 13px; }

.col-narrow { width: 80px; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.row-inactive td { opacity: 0.55; }
.row-current { background: var(--success-bg) !important; }
.text-warning { color: var(--warning); }

/* ============================================================
   FORMS
   ============================================================ */

.form-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--grey-200);
}

.form-section:last-of-type { border-bottom: none; }

.form-section h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-700);
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 180px;
}

.field-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--grey-700);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  color: var(--grey-900);
  background: var(--white);
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(10,10,10,0.08);
}

.field input[readonly] { background: var(--grey-100); cursor: not-allowed; color: var(--grey-700); }

.field-hint { font-size: 12px; color: var(--grey-500); }

.field-error input,
.field-error select,
.field-error textarea { border-color: var(--error); }

.field-msg { font-size: 12px; color: var(--error); }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 16px;
  flex-wrap: wrap;
}

.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
  color: var(--grey-900);
}

.rank-input { width: 72px; text-align: center; }

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
}

.filter-bar input,
.filter-bar select {
  padding: 7px 10px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  background: var(--white);
  color: var(--grey-900);
}

.results-count { font-size: 13px; color: var(--grey-500); margin-bottom: 12px; }

/* ============================================================
   STATS GRID
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--black);
}

.stat-label {
  font-size: 11px;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-error   .stat-value { color: var(--error); }
.stat-info    .stat-value { color: var(--info); }

/* ============================================================
   QUICK LINKS
   ============================================================ */

.quick-links { margin-top: 20px; }
.quick-links h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.quick-link {
  display: block;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-900);
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.quick-link:hover {
  border-color: var(--black);
  box-shadow: var(--shadow-md);
  color: var(--black);
}

/* ============================================================
   PROFILE
   ============================================================ */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.profile-card { display: flex; flex-direction: column; gap: 16px; }

.profile-section {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.profile-section h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-700);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--grey-200);
}

.preferred-name { color: var(--grey-500); font-size: 13px; }

.restricted-label {
  font-size: 10px;
  background: var(--warning-bg);
  color: var(--warning);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  margin-left: 6px;
}

.record-meta {
  font-size: 12px;
  color: var(--grey-500);
  margin-top: 12px;
}

/* ============================================================
   ISSUE LIST
   ============================================================ */

.issue-list {
  list-style: none;
  padding: 0 20px 16px;
}

.issue-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--grey-200);
  font-size: 14px;
  color: var(--grey-900);
}

.issue-list li:first-child { padding-top: 16px; }
.issue-list li:last-child  { border-bottom: none; }

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  font-size: 13px;
  text-decoration: none;
  color: var(--grey-900);
  background: var(--white);
  transition: all 0.15s;
}

.pagination a:hover { background: var(--grey-100); }

.pagination a[aria-current="page"] {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

body.login-page {
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-shell {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 6px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/*
  LOGIN LOGO PLACEHOLDER
  Replace with the official Legends Global logo file (dark/black version on light background).
  Do NOT alter colours, proportions, orientation, or spacing.
*/
.login-logo-placeholder {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--black);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.login-card h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--grey-500);
  margin-bottom: 24px;
}

.login-card .field { margin-bottom: 16px; }

.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--grey-200);
}

.security-note {
  font-size: 11px;
  color: var(--grey-500);
  text-align: center;
  line-height: 1.6;
}

/* ============================================================
   AUDIT TABLE
   ============================================================ */

.audit-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--grey-100);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--grey-900);
}

.detail-cell {
  font-size: 12px;
  color: var(--grey-700);
  max-width: 280px;
  word-break: break-all;
}

.inline-form {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--grey-100);
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
}

.inline-form form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--grey-500);
  font-size: 14px;
  line-height: 1.7;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .content { padding: 16px; }
  .field-row { flex-direction: column; }
  .data-list { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .sidebar, .topbar, .btn, .filter-bar,
  .form-actions, .pagination, .page-actions { display: none !important; }

  .main-content { margin-left: 0 !important; }
  .content      { padding: 0 !important; max-width: 100%; }
  .panel        { box-shadow: none; border: 1px solid #ccc; }

  .data-table th {
    background: #eeeeee !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body { font-size: 12px; }
}

/* ============================================================
   TABS (employee profile)
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-500);
  border-bottom: 2px solid transparent;
  font-family: var(--font);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--black); }
.tab-btn.active {
  color: var(--black);
  border-bottom-color: var(--black);
  font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   PUBLIC LANDING PAGE
   ============================================================ */
body.landing {
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
}
.landing-nav .logo-text { font-size: 18px; }
.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 80px;
}
.landing-hero h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  line-height: 1.1;
}
.landing-hero .sub {
  font-size: 16px;
  color: var(--grey-300);
  margin-bottom: 8px;
}
.landing-hero .loc {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-500);
  margin-bottom: 36px;
}
.landing-hero .btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  padding: 14px 40px;
  font-size: 15px;
  font-weight: 600;
}
.landing-hero .btn-primary:hover { background: var(--grey-200); color: var(--black); }
.landing-features {
  display: flex;
  gap: 40px;
  margin-top: 56px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 760px;
}
.landing-feature {
  flex: 1;
  min-width: 180px;
  text-align: center;
}
.landing-feature h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 6px;
}
.landing-feature p { font-size: 13px; color: var(--grey-500); line-height: 1.5; }
.landing-footer {
  padding: 20px 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: var(--grey-500);
  text-align: center;
  line-height: 1.7;
}
@media (max-width: 600px) {
  .landing-hero h1 { font-size: 30px; }
}

/* Real brand logos */
.sidebar-logo-img { height: auto; width: 150px; max-width: 100%; display: block; margin-bottom: 8px; }
.login-logo { height: auto; width: 200px; max-width: 100%; display: block; margin-bottom: 22px; }

/* Collapsible nav section (Administration drawer) */
.nav-collapse { border: none; }
.nav-collapse > summary {
  list-style: none;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-500);
  padding: 12px 16px 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-collapse > summary::-webkit-details-marker { display: none; }
.nav-collapse > summary::after { content: '+'; font-size: 13px; color: var(--grey-500); }
.nav-collapse[open] > summary::after { content: '\2013'; }
.nav-collapse > summary:hover { color: #fff; }

/* ============================================================
   SCAN OVERLAY
   ============================================================ */
.scan-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.72);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 200;
}
.scan-overlay.show { display: flex; }
.scan-modal {
  background: #fff; border-radius: 6px; padding: 32px;
  margin-top: 15vh; width: 90%; max-width: 460px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.scan-modal h2 { font-size: 18px; margin-bottom: 16px; }
.scan-modal input {
  width: 100%; padding: 14px 16px; font-size: 18px;
  border: 2px solid var(--grey-300); border-radius: 4px;
  text-align: center; letter-spacing: 0.05em; font-family: var(--font);
}
.scan-modal input:focus { outline: none; border-color: var(--black); }
.scan-hint { font-size: 13px; color: var(--grey-500); margin: 12px 0 18px; }

/* ============================================================
   QUICK LAUNCHER (badge scan result)
   ============================================================ */
.quick-id { border-bottom: 3px solid var(--black); padding-bottom: 14px; margin-bottom: 26px; }
.quick-name {
  font-size: clamp(28px, 5vw, 46px); font-weight: 800;
  text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.04; color: var(--black);
}
.quick-sub { font-size: 18px; color: var(--grey-700); margin-top: 10px; font-weight: 500; }
.quick-subsub {
  display: flex; gap: 22px; flex-wrap: wrap; align-items: center;
  margin-top: 12px; font-size: 14px; color: var(--grey-700);
}
.quick-subsub strong { color: var(--grey-500); font-weight: 600; margin-right: 4px; }
.quick-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.quick-tile {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 92px; padding: 16px;
  background: var(--black); color: var(--white); text-decoration: none;
  border-radius: 4px; font-size: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; transition: all 0.15s;
}
.quick-tile:hover { background: var(--grey-900); color: #fff; transform: translateY(-2px); }

/* ============================================================
   Document Template Designer
   ============================================================ */
.tpl-toolbar-row { display:flex; gap:12px; align-items:center; margin:8px 0 14px; }
.tpl-name-input { flex:1; font-size:16px; font-weight:600; padding:8px 10px; border:1px solid #ccc; }
.tpl-designer { display:flex; gap:18px; align-items:flex-start; }
.tpl-main { flex:1; min-width:0; }
.tpl-side { width:280px; flex:none; }

.tpl-format-bar { display:flex; flex-wrap:wrap; gap:4px; padding:6px; border:1px solid #ccc; border-bottom:none; background:#f6f6f6; }
.tpl-format-bar button { min-width:34px; padding:5px 8px; border:1px solid #ccc; background:#fff; cursor:pointer; font-size:13px; }
.tpl-format-bar button:hover { background:#000; color:#fff; }
.tpl-format-bar .sep { width:1px; background:#ccc; margin:0 4px; }

.tpl-editor { min-height:520px; border:1px solid #ccc; padding:28px 34px; background:#fff;
    font-family:'Segoe UI',system-ui,Arial,sans-serif; font-size:14px; line-height:1.6; color:#111;
    box-shadow:0 1px 4px rgba(0,0,0,0.08); overflow-wrap:break-word; }
.tpl-editor:focus { outline:2px solid #000; outline-offset:-2px; }
.tpl-editor h1 { font-size:20px; } .tpl-editor h2 { font-size:16px; }

.merge-chip { display:inline-block; background:#eee; border:1px solid #bbb; border-radius:3px;
    padding:1px 7px; margin:0 1px; font-size:12px; font-weight:600; color:#222; white-space:nowrap;
    cursor:default; user-select:none; }
.merge-chip.chip-component { background:#111; color:#fff; border-color:#111; }

.tpl-panel { border:1px solid #ddd; padding:12px; margin-bottom:14px; background:#fafafa; }
.tpl-panel h3 { margin:0 0 8px; font-size:14px; }
.tpl-panel select { width:100%; margin-bottom:8px; padding:6px; }
.tpl-group-label { font-size:11px; text-transform:uppercase; letter-spacing:0.06em; color:#888; margin:10px 0 4px; }
.palette-chip { display:inline-block; background:#fff; border:1px solid #bbb; border-radius:3px;
    padding:3px 8px; margin:0 4px 4px 0; font-size:12px; cursor:grab; }
.palette-chip:hover { background:#000; color:#fff; border-color:#000; }
.palette-chip.chip-component { border-color:#111; font-weight:600; }

/* Rendered signature block (generated documents) */
.sig-block { display:grid; grid-template-columns:1fr 1fr; gap:26px 36px; margin-top:18px; }
.sig .sig-line { border-bottom:1px solid #000; height:28px; }
.sig .sig-role { font-size:10px; text-transform:uppercase; letter-spacing:0.07em; color:#666; margin-top:3px; }
.sig .sig-name { font-weight:600; min-height:18px; }
.sig .sig-date { font-size:11px; color:#555; }

@media (max-width:880px){ .tpl-designer{flex-direction:column} .tpl-side{width:100%} }

/* ============================================================
   Generated documents (EAN / template output)
   ============================================================ */
.badge.ok { background:#1f7a1f; color:#fff; }
.doc-actionbar { display:flex; gap:10px; align-items:center; margin:6px 0 14px; }
.doc-paper { max-width:820px; background:#fff; border:1px solid #ddd; box-shadow:0 1px 6px rgba(0,0,0,0.10);
    padding:34px 42px; font-family:'Segoe UI',system-ui,Arial,sans-serif; font-size:14px; line-height:1.6; color:#111; }
.doc-paper h1 { font-size:20px; margin:0 0 8px; }
.doc-paper h2 { font-size:13px; text-transform:uppercase; letter-spacing:0.06em; border-bottom:1px solid #000; padding-bottom:3px; margin:18px 0 8px; }
.doc-paper table.hist-table { border-collapse:collapse; width:100%; margin:6px 0; }
.doc-paper table.hist-table th, .doc-paper table.hist-table td { border:1px solid #ccc; padding:4px 8px; text-align:left; font-size:12px; }
.locked-text { background:#f4f4f4; border:1px solid #ddd; border-left:3px solid #888; padding:10px 12px;
    font-size:13px; line-height:1.55; color:#333; white-space:pre-wrap; }

/* ============================================================
   Utility classes (template engine pages)
   ============================================================ */
.muted { color:#666; }
.small { font-size:12px; }
.card { border:1px solid #ddd; background:#fafafa; padding:16px 18px; }
.card-title { margin:0 0 12px; font-size:15px; }
.inline-form { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.btn-ghost { background:#fff; color:#111; border:1px solid #bbb; }
.btn-ghost:hover { background:#111; color:#fff; }
.btn-danger { background:#a02020; color:#fff; border:1px solid #a02020; }
.btn-danger:hover { background:#7d1717; }

/* ============================================================
   Impersonation bar + permissions matrix
   ============================================================ */
.impersonation-bar { display:flex; justify-content:space-between; align-items:center; gap:12px;
    padding:8px 18px; font-size:13px; color:#fff; position:sticky; top:0; z-index:50; }
.impersonation-bar.imp-view { background:#1f5fa8; }   /* blue = safe, read-only */
.impersonation-bar.imp-act  { background:#a02020; }   /* red  = live changes */
.impersonation-bar strong { letter-spacing:0.06em; margin-right:6px; }
.impersonation-bar .imp-roles { opacity:0.85; margin-left:8px; }
.impersonation-bar .imp-real { opacity:0.85; margin-left:12px; font-style:italic; }
.impersonation-bar .imp-actions { display:flex; align-items:center; gap:14px; }
.impersonation-bar .imp-actions a { color:#fff; text-decoration:underline; font-weight:600; }
.impersonation-bar .imp-form { display:inline; margin:0; }
.impersonation-bar .imp-linkbtn { background:none; border:none; color:#fff; text-decoration:underline; cursor:pointer; font-weight:600; font-family:inherit; font-size:13px; padding:0; }
.impersonation-bar .imp-linkbtn.imp-exit { background:rgba(0,0,0,0.25); padding:3px 10px; border-radius:3px; text-decoration:none; }

.impersonate-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.impersonate-grid .radio { display:block; font-weight:400; margin:4px 0; }
@media (max-width:760px){ .impersonate-grid { grid-template-columns:1fr; } }

.matrix-wrap { overflow-x:auto; }
table.matrix { border-collapse:collapse; width:100%; font-size:13px; }
table.matrix th, table.matrix td { border:1px solid #ddd; padding:7px 10px; text-align:center; }
table.matrix th { background:#111; color:#fff; }
table.matrix th.cap-col, table.matrix td.cap-col { text-align:left; min-width:240px; }
table.matrix td.cap-col code { font-size:11px; color:#888; }
table.matrix .cap-label { font-weight:600; }
table.matrix tr.group-row td { background:#f0f0f0; font-weight:700; text-transform:uppercase;
    letter-spacing:0.05em; font-size:11px; text-align:left; }
table.matrix td.cell.yes { background:#e7f5e7; color:#1f7a1f; font-weight:700; }
table.matrix td.cell.no  { background:#fbfbfb; color:#ccc; }

/* ============================================================
   Dashboard (Recent Activity centerpiece)
   ============================================================ */
.dash-welcome h1 { margin:0 0 2px; font-size:22px; }
.dash-welcome { margin-bottom:16px; }

.dash-chips { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.dash-chip { display:flex; flex-direction:column; min-width:120px; padding:12px 16px; background:#fff;
    border:1px solid #e2e2e2; border-radius:6px; text-decoration:none; color:#111; transition:border-color .15s; }
.dash-chip:hover { border-color:#111; }
.dash-chip .chip-num { font-size:24px; font-weight:700; line-height:1; }
.dash-chip .chip-lbl { font-size:12px; color:#666; margin-top:4px; }
.dash-chip.chip-attn { border-left:3px solid #a02020; }
.dash-chip.chip-attn .chip-num { color:#a02020; }

.dash-main { display:grid; grid-template-columns:1fr 300px; gap:20px; align-items:start; }
@media (max-width:840px){ .dash-main { grid-template-columns:1fr; } }

.dash-feed, .dash-rail { background:#fff; border:1px solid #e2e2e2; border-radius:6px; padding:0 0 12px; }
.dash-feed .panel-header, .dash-rail .panel-header { padding:12px 18px; border-bottom:1px solid #eee; }
.dash-feed .panel-header h2, .dash-rail .panel-header h2 { margin:0; font-size:15px; }
.dash-feed .empty-state, .dash-feed > p.small { padding:14px 18px; margin:0; }

.activity-list { list-style:none; margin:0; padding:4px 0; }
.activity-item { display:flex; align-items:baseline; gap:10px; padding:9px 18px; border-bottom:1px solid #f3f3f3; font-size:13px; }
.activity-item:last-child { border-bottom:none; }
.act-dot { width:7px; height:7px; border-radius:50%; background:#111; flex:none; transform:translateY(-1px); }
.act-text { flex:1; line-height:1.45; }
.act-text a { font-weight:600; }
.act-time { color:#999; font-size:12px; white-space:nowrap; }

.rail-links { display:flex; flex-direction:column; padding:8px; }
.rail-link { padding:9px 12px; text-decoration:none; color:#111; border-radius:4px; font-size:13px; }
.rail-link:hover { background:#f3f3f3; }

/* ============================================================
   Template designer - polish
   ============================================================ */
.tpl-toolbar-row { position:sticky; top:0; z-index:20; background:#fff; padding:10px 0; border-bottom:1px solid #eee; }
.tpl-type-tag { font-size:11px; text-transform:uppercase; letter-spacing:0.06em; background:#111; color:#fff; padding:3px 8px; border-radius:3px; }
.tpl-toolbar-row .btn { margin-left:0; }
.tpl-format-bar { position:sticky; top:56px; z-index:15; border-radius:5px 5px 0 0; }
.tpl-format-bar button.is-active { background:#111; color:#fff; }
.tpl-side { position:sticky; top:56px; align-self:flex-start; max-height:calc(100vh - 80px); overflow-y:auto; }
.field-search { width:100%; padding:7px 9px; border:1px solid #ccc; margin-bottom:10px; font-size:13px; }

/* Editor canvas as a sheet of paper */
.tpl-editor { max-width:760px; margin:0 auto; min-height:600px; }

/* Preview modal */
.tpl-modal { position:fixed; inset:0; background:rgba(0,0,0,0.55); display:none; z-index:200; padding:30px 16px; overflow:auto; }
.tpl-modal.show { display:block; }
.tpl-modal-box { max-width:880px; margin:0 auto; background:#f3f3f3; border-radius:8px; overflow:hidden; box-shadow:0 12px 40px rgba(0,0,0,0.4); }
.tpl-modal-head { display:flex; justify-content:space-between; align-items:center; padding:12px 18px; background:#fff; border-bottom:1px solid #e2e2e2; }
.tpl-modal-head h2 { margin:0; font-size:16px; }
.tpl-modal-body { padding:24px; }
.tpl-modal-body .doc-paper { margin:0 auto; }

/* How-to strip (issue discipline) */
.howto-strip { display:flex; gap:8px; list-style:none; counter-reset:step; padding:12px 14px; margin:0 0 16px;
    background:#f6f8fa; border:1px solid #e2e6ea; border-radius:6px; flex-wrap:wrap; }
.howto-strip li { counter-increment:step; font-size:13px; color:#333; padding-left:26px; position:relative; flex:1; min-width:200px; }
.howto-strip li::before { content:counter(step); position:absolute; left:0; top:-1px; width:18px; height:18px;
    background:#111; color:#fff; border-radius:50%; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; }

/* ============================================================
   Dashboard v2 - KPIs, charts (SVG), attention
   ============================================================ */
.kpi-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
@media (max-width:900px){ .kpi-strip { grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .kpi-strip { grid-template-columns:1fr; } }
.kpi-tile { display:block; background:#fff; border:1px solid #e6e6e6; border-radius:8px; padding:16px 18px;
    text-decoration:none; color:#111; transition:box-shadow .15s, border-color .15s; }
a.kpi-tile:hover { border-color:#111; box-shadow:0 3px 12px rgba(0,0,0,0.08); }
.kpi-top { display:flex; align-items:flex-end; justify-content:space-between; gap:8px; }
.kpi-value { font-size:32px; font-weight:700; line-height:1; letter-spacing:-0.01em; }
.kpi-label { font-size:13px; color:#444; margin-top:8px; font-weight:600; }
.kpi-sub { font-size:12px; color:#888; margin-top:2px; }
.kpi-delta { display:inline-block; font-size:12px; margin-top:6px; font-weight:600; }
.kpi-delta.up { color:#2f7d32; } .kpi-delta.down { color:#a02020; } .kpi-delta.flat { color:#999; }
.kpi-tile.kpi-attn { border-left:4px solid #a02020; }
.kpi-tile.kpi-attn .kpi-value { color:#a02020; }
.kpi-tile.kpi-good { border-left:4px solid #2f7d32; }
.spark { width:120px; height:34px; flex:none; }

.chart-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; margin-bottom:18px; }
.chart-grid .chart-wide { grid-column:1 / -1; }
@media (max-width:820px){ .chart-grid { grid-template-columns:1fr; } }

.chart-card { background:#fff; border:1px solid #e6e6e6; border-radius:8px; overflow:hidden; }
.chart-head { display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:12px 16px; border-bottom:1px solid #f0f0f0; }
.chart-head h3 { margin:0; font-size:14px; font-weight:600; }
.chart-body { padding:16px; }

/* Donut */
.donut-body { display:flex; align-items:center; gap:18px; }
.donut { width:150px; height:150px; flex:none; }
.donut-num { font-size:30px; font-weight:700; fill:#111; }
.donut-sub { font-size:11px; fill:#999; text-transform:uppercase; letter-spacing:0.08em; }

/* Legend */
.legend { list-style:none; margin:0; padding:0; flex:1; }
.legend li { display:flex; align-items:center; gap:8px; font-size:13px; padding:3px 0; }
.legend .sw { width:11px; height:11px; border-radius:2px; flex:none; }
.legend .lg-label { flex:1; color:#444; }
.legend .lg-val { font-weight:700; }
.legend.legend-inline { display:flex; gap:16px; }
.legend.legend-inline li { padding:0; font-size:12px; color:#666; }

/* Horizontal bars */
.hbars { display:flex; flex-direction:column; gap:9px; }
.hbar-row { display:grid; grid-template-columns:130px 1fr 38px; align-items:center; gap:10px; font-size:13px; }
.hbar-label { color:#444; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hbar-track { background:#f0f0f0; border-radius:4px; height:14px; overflow:hidden; }
.hbar-fill { display:block; height:100%; border-radius:4px; }
.hbar-val { text-align:right; font-weight:700; }

/* Trend */
.trend { width:100%; height:auto; }
.trend .grid { stroke:#eee; stroke-width:1; }
.trend .trend-area { fill:#141414; opacity:0.06; }
.trend .trend-line-a { fill:none; stroke:#141414; stroke-width:2; }
.trend .trend-line-b { fill:none; stroke:#a02020; stroke-width:2; stroke-dasharray:4 3; }
.trend .axis-x { font-size:11px; fill:#aaa; }

/* Needs attention */
.attn-list { list-style:none; margin:0 0 8px; padding:6px; }
.attn-list li a { display:flex; align-items:center; gap:12px; padding:9px 10px; border-radius:5px; text-decoration:none; color:#111; }
.attn-list li a:hover { background:#fbeeee; }
.attn-num { min-width:30px; height:30px; border-radius:6px; background:#a02020; color:#fff;
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex:none; }
.attn-txt { font-size:13px; color:#333; }
.attn-clear { padding:10px; font-size:13px; color:#2f7d32; }

/* ============================================================
   VISUAL REFRESH LAYER  (loaded last - intentional overrides)
   Elevates the shared shell + core components app-wide.
   ============================================================ */

/* ---- Page canvas ---- */
body {
  background:
    radial-gradient(1100px 520px at 100% -8%, rgba(0,0,0,0.030), transparent 60%),
    #f3f3f4;
}
.content { padding: 28px 32px; width: 100%; }
@media (max-width: 700px){ .content { padding: 18px 16px; } }

/* ---- Sidebar: premium dark, pill active states ---- */
.sidebar {
  background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo { padding: 22px 18px 16px; }
.sidebar-section { padding: 6px 0 16px; }
.sidebar a {
  position: relative;
  margin: 1px 10px;
  padding: 9px 12px;
  border-left: none;
  border-radius: 8px;
  color: #b9b9bd;
  font-weight: 500;
}
.sidebar a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-left: none;
}
.sidebar a.active::before {
  content: "";
  position: absolute;
  left: -3px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: #fff;
}
.nav-group-label { color: #6b6b70; padding: 14px 18px 4px; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }

/* Collapsible Administration drawer summary */
.nav-collapse > summary {
  list-style: none; cursor: pointer;
  color: #6b6b70; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; padding: 14px 18px 6px;
}
.nav-collapse > summary::-webkit-details-marker { display: none; }
.nav-collapse > summary::after { content: " +"; }
.nav-collapse[open] > summary::after { content: " -"; }

/* ---- Topbar: soft elevation, refined avatar ---- */
.topbar {
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16,16,16,0.02);
  padding: 12px 28px;
}
.topbar .page-title { font-size: 15px; letter-spacing: -0.01em; }
.user-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--grey-900);
}
.user-label::before {
  content: ""; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#2a2a2a,#000); flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

/* ---- Headings ---- */
.page-header h1 { font-size: 24px; letter-spacing: -0.02em; }
h1, h2, h3 { letter-spacing: -0.01em; }

/* ---- Buttons: weight, focus, lift ---- */
.btn { font-weight: 600; border-radius: var(--radius); }
.btn:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.btn-primary { box-shadow: 0 1px 2px rgba(0,0,0,0.18); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.22); }
.btn-primary:active { transform: translateY(0); }

/* ---- Panels / cards: rounder, softer, subtle hover ---- */
.panel, .form-card, .filter-bar { border-radius: var(--radius-lg); border-color: var(--line); box-shadow: var(--shadow); }
.panel-header { background: #fff; border-bottom: 1px solid var(--line); padding: 16px 22px; }
.panel-header h2 { font-size: 15px; }
.stat-card, .chart-card, .kpi-tile { border-radius: var(--radius-lg); border-color: var(--line); }
.chart-card { box-shadow: var(--shadow); transition: box-shadow .15s; }
.chart-card:hover { box-shadow: var(--shadow-md); }

/* ---- Tables: refined header, zebra, soft hover ---- */
.data-table th {
  background: #fafafa; border-bottom: 1px solid var(--line);
  color: var(--grey-500); font-size: 11px;
}
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:nth-child(even) { background: #fcfcfc; }
.data-table tbody tr:hover { background: #f3f4f6; }
.data-table td { border-bottom: 1px solid #f1f1f1; }

/* ---- Forms: roomier inputs, soft focus ring ---- */
.field input, .field select, .field textarea,
.filter-bar input, .filter-bar select {
  padding: 10px 12px; border-radius: var(--radius); border-color: var(--grey-300);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--black); box-shadow: 0 0 0 3px rgba(10,10,10,0.10);
}
.field label { font-weight: 600; color: var(--grey-700); }

/* ---- Badges: refined ---- */
.badge { padding: 3px 10px; border-radius: 999px; }

/* ---- Login: depth + brand accent ---- */
body.login-page {
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(180deg,#161616,#000);
}
.login-card {
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  border-top: 4px solid var(--black);
  position: relative;
}
.login-card h1 { letter-spacing: -0.02em; }

/* ---- Flash messages: a touch more presence ---- */
.alert { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ============================================================
   Steward Appointment Board
   ============================================================ */
.appt-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:16px; }
.appt-card { background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:16px 18px;
    box-shadow:var(--shadow); display:flex; flex-direction:column; gap:8px; }
.appt-card.appt-high { border-left:4px solid #a02020; }
.appt-card.appt-mine { border-left:4px solid #141414; }
.appt-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.appt-type { font-weight:700; font-size:15px; }
.appt-when { font-size:14px; color:#111; }
.appt-meta { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:12px; color:#777; }
.appt-meta .appt-urg { color:#a02020; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; }
.appt-note { background:#f6f6f6; border-left:3px solid #bbb; padding:8px 10px; font-size:13px; color:#444; }
.appt-employee { font-size:13px; padding-top:2px; border-top:1px dashed #eee; margin-top:2px; padding-top:8px; }
.appt-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:4px; }
.appt-actions select { padding:6px 8px; border:1px solid var(--grey-300); border-radius:var(--radius); font-size:13px; }

/* ============================================================
   Notifications (bell + inbox)
   ============================================================ */
.notif-bell { position:relative; display:inline-flex; align-items:center; gap:6px; text-decoration:none;
    color:var(--grey-700); font-size:13px; font-weight:600; padding:5px 10px; border:1px solid var(--line); border-radius:var(--radius); }
.notif-bell:hover { color:#000; border-color:var(--grey-500); }
.notif-bell .notif-ico { font-size:10px; color:var(--grey-500); }
.notif-badge { background:#a02020; color:#fff; font-size:11px; font-weight:700; line-height:1;
    padding:2px 6px; border-radius:999px; margin-left:2px; }
.notif-list { list-style:none; margin:0; padding:0; }
.notif-item { display:flex; align-items:center; gap:12px; padding:12px 18px; border-bottom:1px solid #f1f1f1; }
.notif-item:last-child { border-bottom:none; }
.notif-item.unread { background:#fafafe; }
.notif-item.unread .notif-title { font-weight:700; }
.notif-item.unread::before { content:""; width:8px; height:8px; border-radius:50%; background:#a02020; flex:none; }
.notif-item:not(.unread)::before { content:""; width:8px; height:8px; flex:none; }
.notif-main { flex:1; display:flex; flex-direction:column; gap:2px; text-decoration:none; color:#111; }
.notif-title { font-size:14px; }
.notif-body { font-size:13px; color:#666; }
.notif-time { font-size:12px; color:#999; white-space:nowrap; }

/* ============================================================
   Change request stage tracker + policy editor
   ============================================================ */
.cr-track { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 18px; }
.cr-stage { display:flex; align-items:center; gap:8px; padding:8px 14px; border:1px solid var(--line);
    border-radius:999px; background:#fff; font-size:13px; color:#888; }
.cr-stage .cr-dot { width:9px; height:9px; border-radius:50%; background:#ccc; flex:none; }
.cr-stage.done { color:#1f7a1f; border-color:#cfe8cf; } .cr-stage.done .cr-dot { background:#1f7a1f; }
.cr-stage.current { color:#111; border-color:#111; font-weight:700; } .cr-stage.current .cr-dot { background:#111; }
.cr-stage.todo { color:#aaa; }

.policy-row { border:1px solid var(--line); border-radius:var(--radius); padding:12px 14px; margin-bottom:10px; background:#fff; }
.policy-head { margin-bottom:8px; }
.policy-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; margin-bottom:10px; }
.policy-cell { display:flex; flex-direction:column; gap:3px; font-size:11px; color:#666; }
.policy-cell select { padding:5px; font-size:12px; }
.policy-opts { display:flex; flex-wrap:wrap; gap:14px; align-items:center; }
.policy-opts .radio { font-weight:400; font-size:13px; }
@media (max-width:820px){ .policy-grid { grid-template-columns:repeat(3,1fr); } }

/* ============================================================
   Lottery animated draw
   ============================================================ */
.draw-wrap { max-width:820px; }
.draw-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:18px; }
.draw-head h1 { font-size:26px; letter-spacing:-0.02em; }

.draw-stage { background:linear-gradient(180deg,#141414,#000); border-radius:var(--radius-lg);
    padding:46px 28px; min-height:340px; display:flex; flex-direction:column; align-items:center; justify-content:center;
    overflow:hidden; box-shadow:var(--shadow-lg); }
.draw-status { color:#fff; font-size:20px; font-weight:700; letter-spacing:0.04em; margin-bottom:26px; opacity:.9;
    animation:draw-pulse 1.1s ease-in-out infinite; }
@keyframes draw-pulse { 0%,100%{opacity:.45} 50%{opacity:1} }
.draw-cloud { display:flex; flex-wrap:wrap; gap:10px 12px; justify-content:center; max-width:680px; }
.draw-chip { background:rgba(255,255,255,0.10); color:#fff; border:1px solid rgba(255,255,255,0.18);
    border-radius:999px; padding:8px 16px; font-size:14px; font-weight:600; white-space:nowrap;
    animation:draw-jitter .55s ease-in-out infinite; }
@keyframes draw-jitter {
    0%   { transform:translate(0,0) rotate(0deg); }
    20%  { transform:translate(-3px,2px) rotate(-3deg); }
    40%  { transform:translate(3px,-2px) rotate(2deg); }
    60%  { transform:translate(-2px,-3px) rotate(-2deg); }
    80%  { transform:translate(2px,3px) rotate(3deg); }
    100% { transform:translate(0,0) rotate(0deg); }
}

.draw-result { background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:24px 26px; box-shadow:var(--shadow); }
.draw-result-title { font-size:18px; margin-bottom:14px; }
.draw-order { list-style:none; margin:0; padding:0; }
.reveal-row { display:flex; align-items:center; gap:16px; padding:12px 14px; border-bottom:1px solid #f1f1f1;
    opacity:0; transform:translateY(14px) scale(.98); transition:opacity .4s ease, transform .4s ease; }
.reveal-row.show { opacity:1; transform:none; }
.reveal-row:last-child { border-bottom:none; }
.reveal-row[data-rank="1"] { background:#fbfbf4; }
.draw-rank { min-width:48px; height:38px; border-radius:8px; background:#111; color:#fff; font-weight:800; font-size:16px;
    display:flex; align-items:center; justify-content:center; flex:none; }
.reveal-row[data-rank="1"] .draw-rank { background:#9a7b1f; }
.draw-name { font-weight:600; flex:1; }
.draw-num { color:#999; font-size:13px; }
.draw-actions { display:flex; gap:10px; margin-top:18px; }

/* ============================================================
   Department drill-down tiles
   ============================================================ */
.dept-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px,1fr)); gap:16px; }
.dept-tile { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
    background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:22px 16px;
    text-decoration:none; color:#111; min-height:150px; text-align:center; transition:border-color .15s, box-shadow .15s, transform .1s; }
.dept-tile:hover { border-color:#111; box-shadow:var(--shadow-md); transform:translateY(-2px); }
.dept-logo { width:64px; height:64px; display:flex; align-items:center; justify-content:center; }
.dept-logo img { max-width:64px; max-height:64px; object-fit:contain; }
.dept-logo-fallback { background:#111; color:#fff; border-radius:12px; font-weight:800; font-size:20px; letter-spacing:0.04em; }
.dept-name { font-weight:700; font-size:15px; }
.dept-count { font-size:12px; color:#888; }
.dept-tile-class { min-height:96px; }
.dept-tile-class .dept-name { font-size:14px; }
