:root {
  --navy-950: #061a35;
  --navy-900: #09264b;
  --navy-800: #103c70;
  --royal: #155bd7;
  --royal-dark: #0e47ad;
  --sky: #eaf3ff;
  --emerald: #0b8a70;
  --emerald-soft: #e6f7f2;
  --gold: #c69a3a;
  --ink: #14243a;
  --muted: #697a91;
  --line: #e1e8f1;
  --line-strong: #d3deea;
  --surface: #fff;
  --surface-soft: #f7f9fc;
  --bg: #f1f5fa;
  --shadow-sm: 0 7px 24px rgba(20, 42, 76, .06);
  --shadow-md: 0 14px 42px rgba(20, 42, 76, .1);
  --shadow-lg: 0 28px 80px rgba(8, 35, 70, .16);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 4% 0, rgba(21, 91, 215, .055), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--royal); }
img { max-width: 100%; }
:focus-visible {
  outline: 3px solid rgba(21, 91, 215, .28);
  outline-offset: 2px;
}

main.container-fluid {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding: 28px clamp(18px, 3vw, 48px) 48px !important;
}

/* Premium government topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 70px;
  padding-block: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: linear-gradient(108deg, var(--navy-950), var(--navy-800) 67%, #0b5f63 130%);
  box-shadow: 0 10px 32px rgba(5, 26, 53, .2);
}
.topbar-ornament,
.national-surface::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(45deg, transparent 47%, rgba(255, 255, 255, .055) 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(255, 255, 255, .04) 48% 52%, transparent 53%);
  background-size: 40px 40px;
}
.topbar-ornament { opacity: .5; overflow: hidden; }
.topbar > .container-fluid {
  position: relative;
  z-index: 1;
  max-width: 1740px;
  padding-inline: clamp(14px, 2.4vw, 40px);
}
.navbar-brand {
  display: flex;
  min-width: 0;
  max-width: 320px;
  align-items: center;
  gap: 11px;
  margin-right: 24px;
}
.brand-emblem {
  display: block;
  width: auto;
  height: 46px;
  max-width: 53px;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .25));
}
.brand-copy { min-width: 0; line-height: 1.15; white-space: normal; }
.brand-title { display: block; color: #fff; font-size: 13.5px; font-weight: 760; }
.navbar-brand small {
  display: block;
  margin-top: 3px;
  color: #b9cde6;
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: .025em;
}
.topbar .navbar-nav { gap: 2px; }
.topbar .nav-link {
  position: relative;
  padding: 10px 9px !important;
  border-radius: 10px;
  color: rgba(235, 244, 255, .78);
  font-size: 12.5px;
  font-weight: 620;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.topbar .nav-link:hover,
.topbar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}
.topbar .nav-link.active::after {
  position: absolute;
  right: 9px;
  bottom: 3px;
  left: 9px;
  height: 2px;
  border-radius: 99px;
  background: #62d8bb;
  content: "";
}
.topbar .dropdown-menu {
  margin-top: 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.topbar .dropdown-item { padding: 8px 11px; border-radius: 9px; font-size: 12.5px; }
.topbar .dropdown-item:hover { background: var(--sky); color: var(--royal-dark); }
.topbar-actions { min-width: max-content; }
.topbar-user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.topbar .btn-outline-light { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .04); }
.topbar .btn-outline-light:hover { border-color: rgba(255, 255, 255, .7); background: #fff; color: var(--navy-900); }
.navbar-toggler { flex: none; border-color: rgba(255, 255, 255, .28); border-radius: 10px; }
.notification-menu { width: min(390px, 92vw); min-width: 320px; max-height: 480px; overflow-y: auto; }
.notification-unread { background: #eef5ff; }

/* Shared surfaces and typography */
.national-surface { position: relative; overflow: hidden; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 0 22px;
}
.page-heading h1,
.appeal-heading h1 {
  margin: 4px 0;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 790;
  letter-spacing: -.025em;
}
.page-heading p,
.panel-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.eyebrow {
  color: var(--royal);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow.light { color: #91e0ca; }
.live-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid #bfe9dc;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: #08745e;
  font-size: 11px;
  font-weight: 750;
}
.filter-panel,
.panel,
.card,
.kpi-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-sm);
}
.filter-panel,
.panel { border-radius: var(--radius); }
.panel { min-width: 0; padding: 20px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-head h2,
.card-header {
  margin: 0 0 3px;
  color: #18304f;
  font-size: 15px;
  font-weight: 760;
}
.panel-head a { font-size: 11.5px; font-weight: 700; text-decoration: none; }
.card { overflow: hidden; border-radius: 16px; }
.card-header {
  padding: 14px 17px;
  border-bottom: 1px solid #e8edf4;
  background: linear-gradient(180deg, #fff, #fbfcfe) !important;
}
.card-body { padding: 17px; }

/* Controls */
.form-label { margin-bottom: 6px; color: #344a65; font-size: 12px; font-weight: 680; }
.form-control,
.form-select {
  min-height: 42px;
  border-color: #d8e2ed;
  border-radius: 11px;
  background-color: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control:hover,
.form-select:hover { border-color: #bdcbdb; }
.form-control:focus,
.form-select:focus {
  border-color: #75a1eb;
  box-shadow: 0 0 0 4px rgba(21, 91, 215, .11);
}
.btn {
  min-height: 38px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  transition: transform .17s ease, box-shadow .17s ease, background .17s ease, border-color .17s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-brand,
.btn-primary { border-color: var(--royal); background: linear-gradient(135deg, #1a66e4, #1253c8); color: #fff; }
.btn-brand:hover,
.btn-primary:hover { border-color: var(--royal-dark); background: linear-gradient(135deg, #155bd7, #0d43a6); color: #fff; box-shadow: 0 8px 20px rgba(21, 91, 215, .2); }
.btn-success { background: linear-gradient(135deg, #15977b, #08745e); border-color: #08745e; }
.btn-soft { background: #edf2f8; color: #445d78; }
.alert { border-radius: 13px; }

/* Login */
.official-login-page { min-height: 100vh; background: #edf2f8; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.03fr) minmax(420px, .97fr); }
.login-identity {
  display: grid;
  place-items: center;
  padding: clamp(38px, 6vw, 78px);
  background:
    radial-gradient(circle at 12% 12%, rgba(55, 143, 234, .2), transparent 24rem),
    linear-gradient(145deg, #061e3d, #0d477a 67%, #08705d);
  color: #fff;
}
.login-identity::after {
  position: absolute;
  right: -170px;
  bottom: -180px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(255, 255, 255, .022), 0 0 0 80px rgba(255, 255, 255, .015);
  content: "";
}
.identity-content { position: relative; z-index: 1; max-width: 560px; text-align: center; }
.login-emblem {
  display: block;
  width: auto;
  height: 92px;
  max-width: 108px;
  margin: 0 auto 18px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .28));
}
.identity-rule { display: flex; align-items: center; justify-content: center; gap: 10px; }
.identity-rule span { width: 54px; height: 1px; background: rgba(255, 255, 255, .3); }
.identity-rule i { width: 8px; height: 8px; border: 2px solid #64d8ba; transform: rotate(45deg); }
.identity-kicker { margin: 17px 0 9px; color: #91e0ca; font-size: 10px; font-weight: 850; letter-spacing: .2em; }
.identity-content h1 { margin: 0; font-size: clamp(30px, 3.7vw, 48px); font-weight: 790; line-height: 1.14; letter-spacing: -.025em; }
.identity-system { margin: 14px 0 26px; color: #cbdef0; font-size: 17px; }
.identity-note { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid rgba(255, 255, 255, .17); border-radius: 999px; background: rgba(255, 255, 255, .055); color: #dbe8f4; font-size: 11.5px; }
.login-form-side { display: grid; place-items: center; padding: clamp(24px, 5vw, 68px); background: radial-gradient(circle at 100% 0, #d9eafa, transparent 36%), #f6f8fb; }
.login-card-official { width: min(500px, 100%); padding: clamp(28px, 4vw, 42px); border: 1px solid #dce5ef; border-radius: var(--radius-lg); background: rgba(255, 255, 255, .97); box-shadow: var(--shadow-lg); }
.login-card-heading { display: flex; align-items: flex-start; gap: 15px; }
.login-icon { display: grid; width: 48px; height: 48px; flex: none; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #e5efff, #ddf7ef); color: #0b5aa7; font-size: 20px; }
.login-card-heading p { margin: 2px 0 5px; color: #08775f; font-size: 9.5px; font-weight: 850; letter-spacing: .15em; }
.login-card-heading h2 { margin: 0; font-size: clamp(22px, 2vw, 26px); font-weight: 780; line-height: 1.28; letter-spacing: -.015em; }
.login-help { margin: 20px 0 25px; color: var(--muted); font-size: 12.5px; }
.official-input { position: relative; }
.official-input > i { position: absolute; top: 50%; left: 15px; z-index: 2; color: #71839b; transform: translateY(-50%); }
.official-input .form-control { height: 50px; padding-left: 43px; font-size: 14px; }
.official-input-password .form-control { padding-right: 52px; }
.official-input-password .form-control::-ms-reveal,
.official-input-password .form-control::-ms-clear { display: none; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  z-index: 3;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #71839b;
  font-size: 17px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.password-toggle:hover { background: #edf4fc; color: #155bd7; }
.password-toggle:focus-visible {
  outline: 0;
  background: #e8f1ff;
  color: #155bd7;
  box-shadow: 0 0 0 3px rgba(21, 91, 215, .24);
}
.login-card-official .btn-lg { height: 50px; }
.login-security { margin-top: 19px; color: #7a899d; text-align: center; font-size: 10.5px; }

/* Welcome, actions and dashboard */
.welcome-panel {
  display: flex;
  min-height: 148px;
  align-items: center;
  justify-content: space-between;
  padding: 26px clamp(24px, 3vw, 36px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: linear-gradient(118deg, #082a55, #125792 62%, #07806c 125%);
  box-shadow: 0 18px 45px rgba(8, 42, 87, .18);
  color: #fff;
}
.welcome-copy { position: relative; z-index: 1; min-width: 0; }
.welcome-copy h1 { margin: 5px 0; font-size: clamp(25px, 3vw, 37px); font-weight: 790; letter-spacing: -.025em; }
.welcome-copy p { margin: 0 0 15px; color: #d5e5f5; }
.welcome-copy > strong { font-size: 12.5px; }
.welcome-emblem {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: 72px;
  max-width: 84px;
  flex: none;
  object-fit: contain;
  opacity: .9;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .22));
}
.filter-panel { margin-bottom: 18px; padding: 17px; }
.filter-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 750; }
.filter-title i { color: var(--royal); }
.filter-grid { display: grid; grid-template-columns: repeat(5, minmax(135px, 1fr)); gap: 9px; }
.quick-actions { display: grid; gap: 10px; }
.quick-actions.horizontal { grid-template-columns: repeat(5, minmax(135px, 1fr)); }
.quick-actions a {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, #fbfcfe, #f5f8fc);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 680;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.quick-actions a:hover { transform: translateY(-2px); border-color: #b8cbe2; box-shadow: var(--shadow-sm); color: var(--royal); }
.quick-actions i { display: grid; width: 31px; height: 31px; flex: none; place-items: center; border-radius: 9px; background: var(--emerald-soft); color: var(--emerald); font-size: 15px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi-card {
  position: relative;
  display: flex;
  min-height: 104px;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  padding: 17px;
  border-radius: 16px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.kpi-card::after { position: absolute; top: 0; right: 0; width: 52px; height: 3px; border-radius: 0 0 0 6px; background: linear-gradient(90deg, var(--royal), var(--emerald)); content: ""; opacity: .7; }
.kpi-card:hover { transform: translateY(-3px); border-color: #cfdae7; box-shadow: var(--shadow-md); }
.kpi-icon { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border-radius: 13px; font-size: 18px; }
.kpi-main { min-width: 0; }
.kpi-main span { display: block; overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.kpi-main strong { display: block; margin-top: 1px; font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 800; line-height: 1.2; }
.kpi-main small { font-size: 9.5px; }
.blue { background: #e6efff; color: #1764dc; }.cyan { background: #e3f8fc; color: #078ca5; }.violet { background: #f0eaff; color: #7048ce; }.navy { background: #e7edf5; color: #213d63; }.orange { background: #fff0df; color: #d66e0c; }.indigo { background: #ebeaff; color: #5653d4; }.green { background: #e4f8ef; color: #138b5c; }.gray { background: #eff2f5; color: #637286; }.amber { background: #fff5d9; color: #a97500; }.red { background: #ffe7e8; color: #ce3542; }.teal { background: #e2f7f5; color: #0d8279; }.rose { background: #fde8f1; color: #b9346c; }
.up { color: #13865e; }.down { color: #c83c49; }
.deadline-alert-stack { display: grid; gap: 10px; }
.deadline-alert {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}
.deadline-alert > i { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; font-size: 18px; }
.deadline-alert strong { display: block; color: var(--ink); font-size: 13px; }
.deadline-alert span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.deadline-alert > a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; font-size: 11.5px; font-weight: 750; text-decoration: none; }
.deadline-alert-danger { border-color: #efc1c6; background: linear-gradient(135deg, #fff7f7, #fdebed); }
.deadline-alert-danger > i { background: #f9dce0; color: #bd2f3e; }
.deadline-alert-danger > a { background: #be3543; color: #fff; }
.deadline-alert-warning { border-color: #efd89e; background: linear-gradient(135deg, #fffdf7, #fff3d8); }
.deadline-alert-warning > i { background: #ffe9ae; color: #946400; }
.deadline-alert-warning > a { background: #9d700a; color: #fff; }
.deadline-kpi { animation: deadline-soft-glow 2.8s ease-in-out infinite; }
.deadline-kpi-warning { border-color: #e8cc82; background: linear-gradient(145deg, #fffdf8, #fff8e7); }
.deadline-kpi-danger { border-color: #e8aeb5; background: linear-gradient(145deg, #fffafa, #fff0f2); }
.deadline-kpi-warning::after { background: #d19a16; opacity: 1; }
.deadline-kpi-danger::after { background: #c83c49; opacity: 1; }
@keyframes deadline-soft-glow {
  0%, 100% { box-shadow: 0 4px 14px rgba(17, 45, 78, .05); }
  50% { box-shadow: 0 8px 23px rgba(199, 61, 73, .11); }
}
.analytics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.panel.wide { grid-column: span 2; }
.chart-box { position: relative; height: 270px; }
.quality-grid,
.bottom-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 15px; margin-top: 15px; }
.bottom-grid { grid-template-columns: 2fr 1fr; }
.rating-score { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.rating-score > strong { font-size: 46px; line-height: 1; }
.stars,
.comment-stars { color: #e9a112; letter-spacing: 2px; }
.rating-score span { display: block; color: var(--muted); font-size: 10.5px; }
.rating-summary canvas { max-height: 145px; }
.response-stat { display: flex; align-items: center; gap: 11px; margin-top: 12px; padding: 12px; border: 1px solid #e8edf4; border-radius: 12px; background: #f5f8fc; }
.response-stat i { color: var(--royal); font-size: 21px; }
.response-stat span,
.rank-person span { display: block; color: var(--muted); font-size: 10.5px; }
.response-stat strong { font-size: 14px; }
.rank-row { display: grid; grid-template-columns: 40px 1fr 50px; align-items: center; gap: 12px; padding: 10px 3px; border-bottom: 1px solid #edf1f6; }
.rank { font-size: 17px; font-weight: 800; text-align: center; }
.rank-person strong { font-size: 12.5px; }
.progress { height: 5px; margin-top: 6px; background: #e7edf5; }
.progress-bar { background: linear-gradient(90deg, var(--royal), #18a887); }

/* Tables and lists */
.table-responsive { scrollbar-color: #c7d4e2 transparent; }
.table { --bs-table-bg: transparent; margin: 0; font-size: 12px; }
.table > :not(caption) > * > * { padding: 12px 10px; border-bottom-color: #e9eef4; vertical-align: middle; }
.table thead th,
.modern-table th { color: #718096; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: #f5f8fc; }
.status-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #eaf1ff; color: #235eb6; font-size: 9.5px; font-weight: 750; }
.badge { font-weight: 700; }
.appeal-row-overdue > td { background: rgba(202, 53, 68, .035); }
.appeal-row-overdue > td:first-child { box-shadow: inset 4px 0 #c83c49; }
.appeal-row-due-soon > td { background: rgba(219, 158, 18, .04); }
.appeal-row-due-soon > td:first-child { box-shadow: inset 4px 0 #d39a15; }
.deadline-badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; }
.deadline-badge-danger { border-color: #e7aeb5; background: #fde6e9; color: #a92d3a; }
.deadline-badge-warning { border-color: #e8cf8d; background: #fff2cf; color: #805900; }
.staff-actions-cell { min-width: 144px; }
.staff-action-group {
  display: inline-flex;
  max-width: 150px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.staff-action-form { display: inline-flex; margin: 0; }
.staff-action-btn {
  display: inline-grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f2f5f9;
  color: #53677f;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.staff-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgba(20, 42, 76, .13);
}
.staff-action-btn:focus-visible {
  outline: 3px solid rgba(21, 91, 215, .24);
  outline-offset: 2px;
}
.action-view { border-color: #c9dcfa; background: #eaf3ff; color: #155bd7; }
.action-view:hover { border-color: #9cbff1; background: #dfeeff; color: #0d47ad; }
.action-edit { border-color: #d9e1ea; background: #f2f5f8; color: #52667e; }
.action-edit:hover { border-color: #bcc8d6; background: #e9eef4; color: #31475f; }
.action-password { border-color: #d4dde7; background: #e9eef4; color: #273c55; }
.action-password:hover { border-color: #aebdcd; background: #dfe6ee; color: #102842; }
.action-deactivate { border-color: #efdba6; background: #fff5dc; color: #a56e00; }
.action-deactivate:hover { border-color: #dfbd65; background: #ffedbe; color: #805400; }
.action-activate,
.action-restore { border-color: #bfe8da; background: #e5f7f1; color: #08775f; }
.action-activate:hover,
.action-restore:hover { border-color: #8fd3bd; background: #d8f2e9; color: #04634e; }
.action-delete { border-color: #f0c9b7; background: #fff0e8; color: #b7532d; }
.action-delete:hover { border-color: #dfab93; background: #ffe4d7; color: #963b1b; }
.action-hard-delete { border-color: #efc2c7; background: #fdebed; color: #c33e4b; }
.action-hard-delete:hover { border-color: #dc929b; background: #f9dce0; color: #a52532; }
.tooltip .tooltip-inner { max-width: 250px; padding: 7px 10px; border-radius: 8px; background: #09264b; font-size: 11px; font-weight: 650; box-shadow: 0 8px 22px rgba(8, 35, 70, .2); }
.comment { padding: 12px 0; border-bottom: 1px solid #edf1f6; }
.comment p { margin: 5px 0; font-size: 12.5px; }
.comment small { color: var(--muted); font-size: 10px; }
.empty { padding: 28px; color: #8493a7; text-align: center; }
.empty i { font-size: 28px; }
.text-prewrap { white-space: pre-wrap; }

/* Personal workspace */
.personal-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.personal-kpi {
  position: relative;
  display: grid;
  min-height: 94px;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  overflow: hidden;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.personal-kpi:hover { transform: translateY(-3px); border-color: #bfd0e4; box-shadow: var(--shadow-md); color: var(--royal); }
.personal-kpi > i { display: grid; width: 40px; height: 40px; grid-row: span 2; place-items: center; border-radius: 12px; background: #e9f1ff; color: #1764dc; font-size: 16px; }
.personal-kpi span { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; }
.personal-kpi strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.personal-kpi.tone-danger > i { background: #ffe9ea; color: #cc3d49; }
.personal-kpi.tone-warning > i { background: #fff3d5; color: #a87400; }
.personal-kpi.tone-success > i { background: #e3f6ee; color: #11825a; }
.task-list { display: flex; flex-direction: column; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 14px 6px; border-bottom: 1px solid #edf1f6; color: var(--ink); text-decoration: none; transition: padding .18s ease, background .18s ease, color .18s ease; }
.task-row:hover { padding-inline: 11px; border-radius: 11px; background: #f6f9fc; color: var(--royal); }
.task-row p { margin: 3px 0 7px; color: var(--muted); font-size: 11.5px; }
.task-time { display: flex; min-width: 125px; flex-direction: column; align-items: flex-end; text-align: right; font-size: 10.5px; }
.task-time strong { margin: 3px 0; font-size: 11.5px; }
.task-time small { color: var(--muted); }
.task-open { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; color: var(--royal); font-size: 10.5px; font-weight: 750; }
.profile-grid { display: grid; grid-template-columns: 145px 1fr; gap: 9px 15px; font-size: 12.5px; }
.profile-grid dt { color: var(--muted); font-weight: 550; }
.profile-grid dd { margin: 0; font-weight: 680; }
.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.profile-stats > div { padding: 13px; border: 1px solid #e8edf4; border-radius: 12px; background: #f5f8fc; }
.profile-stats span { display: block; color: var(--muted); font-size: 10.5px; }
.profile-stats strong { display: block; margin-top: 3px; font-size: 18px; }

/* Appeal detail */
.appeal-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.appeal-heading-copy { min-width: 0; }
.appeal-heading-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.appeal-context-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.appeal-context-grid > span { min-width: 0; padding: 13px 15px; border-right: 1px solid #e8edf4; border-bottom: 1px solid #e8edf4; color: var(--muted); font-size: 11px; }
.appeal-context-grid > span strong { display: block; margin-bottom: 3px; color: #29415f; font-size: 10px; letter-spacing: .035em; text-transform: uppercase; }
.appeal-detail-layout > .appeal-side-column > .card { position: relative; }
.appeal-side-column .card-header { font-size: 13.5px; }
.appeal-side-column .card-body { font-size: 12px; }
.appeal-main-column .card-header { display: flex; align-items: center; min-height: 50px; }
.appeal-main-column .text-prewrap { line-height: 1.68; }
.appeal-progress { padding: 14px 18px; }
.progress-track { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.progress-track::-webkit-scrollbar { display: none; }
.progress-step { display: flex; min-width: max-content; align-items: center; gap: 7px; color: #8695a7; }
.progress-step > span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #edf1f5; font-size: 10.5px; font-weight: 800; }
.progress-step small { font-size: 10.5px; font-weight: 680; }
.progress-step.complete { color: #08745e; }
.progress-step.complete > span { background: #dff5ed; }
.progress-step.current { color: var(--royal); }
.progress-step.current > span { background: var(--royal); box-shadow: 0 0 0 4px #e3edff; color: #fff; }
.progress-arrow { flex: none; color: #c3ceda; font-size: 9px; }

/* Assignment picker */
.responsibility-panel { overflow: hidden; }
.responsibility-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid #e8edf4; }
.responsibility-heading h2 { margin: 2px 0 0; color: var(--ink); font-size: 18px; }
.responsibility-region { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: #edf4ff; color: #245ca8; font-size: 11px; font-weight: 720; }
.responsibility-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; background: #f7f9fc; }
.responsibility-card { display: grid; min-width: 0; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid #e0e7f0; border-radius: 15px; background: #fff; box-shadow: 0 7px 22px rgba(20, 48, 83, .055); }
.responsibility-card-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: #e7f0ff; color: #175fc9; font-size: 18px; }
.responsibility-card-icon.regional { background: #e4f6ef; color: #08765d; }
.responsibility-card-copy { display: flex; min-width: 0; flex-direction: column; }
.responsibility-card-copy strong,
.responsibility-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.responsibility-card-copy strong { color: #183451; font-size: 13px; }
.responsibility-card-copy small { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.responsibility-label { margin-bottom: 4px; color: #75869a; font-size: 8.5px; font-weight: 820; letter-spacing: .08em; }
.responsibility-actions { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.responsibility-actions form { text-align: center; }
.responsibility-action { white-space: nowrap; }

.assignment-picker-dialog { max-width: 880px; }
.assignment-picker-modal .modal-content { overflow: hidden; border: 0; border-radius: 20px; box-shadow: 0 28px 80px rgba(4, 24, 48, .28); }
.assignment-picker-header { padding: 20px 22px; border-bottom-color: #e6ebf2; background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%); }
.assignment-picker-header p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.assignment-picker-body { min-height: 520px; padding: 0; background: #f7f9fc; }
.assignment-picker-tools { position: sticky; z-index: 5; top: 0; padding: 16px 18px 14px; border-bottom: 1px solid #e5ebf2; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); }
.assignment-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 4px; border-radius: 13px; background: #eef2f7; }
.assignment-tab { display: inline-flex; min-width: 0; align-items: center; justify-content: center; gap: 7px; padding: 10px 13px; border: 0; border-radius: 10px; background: transparent; color: #64758a; font-size: 11.5px; font-weight: 760; transition: background .16s ease, box-shadow .16s ease, color .16s ease; }
.assignment-tab:hover:not(:disabled) { color: #174f9c; }
.assignment-tab.active { background: #fff; box-shadow: 0 3px 12px rgba(20, 54, 91, .11); color: #155ab8; }
.assignment-tab:focus-visible { outline: 3px solid rgba(31, 111, 235, .25); outline-offset: 2px; }
.assignment-tab:disabled { cursor: not-allowed; opacity: .46; }
.assignment-search { margin-top: 13px; }
.assignment-search label { display: block; margin-bottom: 6px; color: #425970; font-size: 10px; font-weight: 750; }
.assignment-search .input-group-text { border-color: #ccd8e7; background: #fff; color: #728398; }
.assignment-search .form-control { border-left: 0; }
.assignment-panel { padding: 16px 18px 0; }
.assignment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 14px; }
.assignment-card { position: relative; display: grid; min-width: 0; grid-template-columns: auto 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #dce5ef; border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.assignment-card:hover { transform: translateY(-1px); border-color: #9ab8de; box-shadow: 0 8px 20px rgba(25, 63, 104, .09); }
.assignment-card:focus-within { border-color: #2b72cc; box-shadow: 0 0 0 3px rgba(31, 111, 235, .16); }
.assignment-card.selected { border-color: #1767ca; background: #f2f7ff; box-shadow: 0 0 0 2px rgba(31, 111, 235, .13); }
.assignment-card.current { cursor: default; background: #f7f9fb; }
.assignment-card > input { width: 16px; height: 16px; margin: 0; accent-color: #1767ca; }
.assignment-card > input:disabled { opacity: .55; }
.assignment-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #dceaff, #eef5ff); color: #185eba; font-size: 16px; font-weight: 820; }
.assignment-avatar.regional { background: linear-gradient(145deg, #d7f1e7, #ecfaf5); color: #08745d; }
.assignment-person { display: flex; min-width: 0; flex-direction: column; }
.assignment-person strong,
.assignment-person small,
.assignment-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-person strong { color: #16324e; font-size: 12px; }
.assignment-person small { margin-top: 2px; color: #38536f; font-size: 10px; font-weight: 680; }
.assignment-person span { margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.assignment-working { display: inline-flex; align-items: center; gap: 5px; align-self: start; padding: 4px 7px; border-radius: 999px; background: #e8f7f0; color: #087357; font-size: 8.5px; font-weight: 760; white-space: nowrap; }
.assignment-working i { font-size: 5px; }
.assignment-card.current .assignment-working { background: #e8eef6; color: #50677f; }
.assignment-scope-note { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #cde8dc; border-radius: 11px; background: #edf9f4; color: #24634f; font-size: 10.5px; }
.assignment-empty { display: flex; min-height: 205px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 25px; color: #79899b; text-align: center; }
.assignment-empty i { margin-bottom: 5px; color: #9aabba; font-size: 32px; }
.assignment-empty strong { color: #445b72; font-size: 13px; }
.assignment-empty span { font-size: 10.5px; }
.assignment-modal-actions { position: sticky; z-index: 4; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-inline: -18px; padding: 13px 18px; border-top: 1px solid #e0e7ef; background: rgba(255, 255, 255, .98); box-shadow: 0 -7px 22px rgba(20, 48, 83, .07); backdrop-filter: blur(9px); }
.assignment-selection { display: flex; min-width: 0; flex-direction: column; }
.assignment-selection span { color: #7a8a9c; font-size: 8.5px; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.assignment-selection strong,
.assignment-selection small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-selection strong { color: #183551; font-size: 12px; }
.assignment-selection small { color: var(--muted); font-size: 9.5px; }
.assignment-modal-actions .btn { min-width: 165px; }
.assignment-modal-actions .btn:disabled { cursor: not-allowed; opacity: .48; }

.execution-summary { display: flex; flex-direction: column; gap: 6px; padding: 11px; border: 1px solid #e2e8ef; border-radius: 11px; background: #f8fafc; }
.execution-summary > strong { margin-bottom: 2px; color: #435971; font-size: 10px; }
.execution-summary span { display: flex; align-items: center; gap: 6px; font-size: 9.5px; }
.execution-summary .complete { color: #087357; }
.execution-summary .missing { color: #b23a45; }
.execution-status-warning { display: flex; align-items: center; gap: 6px; margin: -2px 0 9px; padding: 8px 9px; border: 1px solid #e6aeb4; border-radius: 9px; background: #fff1f2; color: #a82f3b; font-size: 10px; font-weight: 720; }
.execution-status-invalid { padding: 10px; border: 1px solid #e3a4ab; border-radius: 11px; background: #fff7f7; }
.execution-status-invalid .form-select { border-color: #d94f5c; background-color: #fff4f5; box-shadow: 0 0 0 3px rgba(217, 79, 92, .12); }
.execution-status-invalid .form-select:focus { border-color: #c53644; box-shadow: 0 0 0 3px rgba(217, 79, 92, .2); }

/* Subtle motion */
@keyframes section-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes badge-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .28); } 50% { box-shadow: 0 0 0 5px rgba(220, 53, 69, 0); } }
body.ui-ready main > * { animation: section-in .38s ease both; }
body.ui-ready main > *:nth-child(2) { animation-delay: .035s; }
body.ui-ready main > *:nth-child(3) { animation-delay: .07s; }
.topbar .badge:not(.d-none) { animation: badge-pulse 2.4s ease-in-out infinite; }

@media (max-width: 1399.98px) {
  .navbar-brand { max-width: 270px; margin-right: 14px; }
  .brand-title { font-size: 12.5px; }
  .navbar-brand small { font-size: 8.2px; }
  .topbar .nav-link { padding-inline: 7px !important; font-size: 11.5px; }
  .navbar-collapse { margin-top: 10px; padding: 13px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 15px; background: rgba(5, 28, 55, .96); box-shadow: var(--shadow-lg); }
  .topbar .nav-link { padding: 9px 11px !important; font-size: 12.5px; }
  .topbar-actions { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
  .filter-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1199.98px) {
  .topbar { min-height: 64px; }
  .brand-emblem { height: 42px; max-width: 48px; }
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel.wide { grid-column: span 2; }
  .personal-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-actions.horizontal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-identity { min-height: 310px; padding: 30px 22px; }
  .login-emblem { height: 70px; max-width: 82px; margin-bottom: 13px; }
  .identity-content h1 { font-size: 29px; }
  .identity-system { margin-bottom: 17px; font-size: 14px; }
  .login-form-side { padding: 30px 18px; }
  .quality-grid,
  .bottom-grid { grid-template-columns: 1fr; }
  .appeal-context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appeal-side-column { order: 2; }
  .responsibility-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  main.container-fluid { padding: 18px 14px 34px !important; }
  .navbar-brand { max-width: calc(100% - 62px); margin-right: 0; gap: 8px; }
  .brand-emblem { height: 36px; max-width: 41px; }
  .brand-copy { max-width: calc(100vw - 120px); }
  .brand-title { font-size: 11.5px; }
  .navbar-brand small { font-size: 7.6px; }
  .page-heading,
  .appeal-heading { align-items: flex-start; }
  .live-pill { display: none; }
  .filter-grid,
  .analytics-grid { grid-template-columns: 1fr; }
  .panel.wide { grid-column: span 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-box { height: 235px; }
  .welcome-panel { min-height: 138px; padding: 22px; }
  .welcome-emblem { height: 58px; max-width: 67px; }
  .quick-actions.horizontal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table { min-width: 720px; }
  .assignment-picker-dialog { width: calc(100% - 18px); max-width: none; height: calc(100% - 18px); margin: 9px; }
  .assignment-picker-dialog .modal-content { height: 100%; border-radius: 17px; }
  .assignment-picker-body { min-height: 0; }
  .assignment-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { min-height: 58px; }
  .brand-emblem { height: 32px; max-width: 37px; }
  .page-heading,
  .appeal-heading { flex-direction: column; }
  .page-heading h1,
  .appeal-heading h1 { font-size: 25px; }
  .welcome-emblem { position: absolute; right: 18px; bottom: 14px; height: 54px; opacity: .18; }
  .welcome-copy { max-width: 100%; }
  .welcome-copy h1 { font-size: 25px; }
  .personal-kpi-grid,
  .kpi-grid { grid-template-columns: 1fr; }
  .personal-kpi,
  .kpi-card { min-height: 84px; }
  .task-row { grid-template-columns: 1fr; }
  .task-time { min-width: 0; align-items: flex-start; text-align: left; }
  .quick-actions.horizontal { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; gap: 3px; }
  .profile-grid dd { margin-bottom: 8px; }
  .profile-stats { grid-template-columns: 1fr; }
  .appeal-context-grid { grid-template-columns: 1fr; }
  .responsibility-heading { align-items: flex-start; flex-direction: column; padding: 16px; }
  .responsibility-grid { padding: 11px; }
  .responsibility-card { grid-template-columns: 40px minmax(0, 1fr); }
  .responsibility-card-icon { width: 40px; height: 40px; }
  .responsibility-action,
  .responsibility-actions { grid-column: 1 / -1; width: 100%; }
  .responsibility-actions .btn { width: 100%; }
  .assignment-picker-header { padding: 16px; }
  .assignment-picker-header p { display: none; }
  .assignment-picker-tools { padding: 12px; }
  .assignment-tab { padding: 9px 7px; font-size: 10px; }
  .assignment-panel { padding: 12px 12px 0; }
  .assignment-card { grid-template-columns: auto 38px minmax(0, 1fr); }
  .assignment-avatar { width: 38px; height: 38px; }
  .assignment-working { grid-column: 2 / -1; justify-self: start; }
  .assignment-modal-actions { align-items: stretch; flex-direction: column; gap: 9px; margin-inline: -12px; padding: 11px 12px; }
  .assignment-modal-actions .btn { width: 100%; min-width: 0; }
  .login-identity { min-height: 265px; }
  .login-emblem { height: 58px; max-width: 68px; }
  .identity-kicker { margin-top: 12px; }
  .identity-content h1 { font-size: 25px; }
  .identity-note { display: none; }
  .login-card-heading h2 { font-size: 21px; }
  .login-card-official { padding: 26px 21px; }
  .notification-menu { min-width: min(320px, 88vw); }
  .staff-actions-cell { min-width: 132px; }
  .staff-action-group { max-width: 132px; gap: 4px; }
  .staff-action-btn { width: 30px; min-width: 30px; height: 30px; min-height: 30px; border-radius: 8px; }
  .deadline-alert { grid-template-columns: 38px minmax(0, 1fr); padding: 12px; }
  .deadline-alert > i { width: 38px; height: 38px; }
  .deadline-alert > a { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 390px) {
  .brand-title { font-size: 10.5px; }
  .navbar-brand small { font-size: 7px; }
  .login-form-side { padding-inline: 13px; }
  .login-card-official { border-radius: 19px; }
  .login-card-heading { gap: 11px; }
  .login-icon { width: 42px; height: 42px; }
  .panel,
  .filter-panel { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .quick-actions, .filter-panel, .btn { display: none !important; }
  body { background: #fff; }
  main.container-fluid { max-width: none; padding: 0 !important; }
  .panel, .card, .kpi-card { box-shadow: none; }
}
