/* ============================================================
   UFM Cases Portal — base styles & design tokens
   Recreated from the BITS design handoff (navy + gold).
   ============================================================ */

:root {
  /* Brand navy */
  --navy-1: #0C2C4E;
  --navy-2: #0A2645;
  --navy-3: #0B2240;
  --navy-4: #08203A;
  /* Gold / accent */
  --gold: #D4AF37;
  --gold-1: #E6C04A;
  --gold-2: #C2932B;
  /* Surfaces & text */
  --page-bg: #EEF2F8;
  --ink: #16273B;
  --ink-2: #5B6B7F;
  --ink-3: #7C8896;
  --line: #E4EAF1;
  /* Status / type accents */
  --danger: #D14B4B;
  --success: #1F9D6B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--page-bg);
  color: var(--ink);
}
textarea, input, button, select { font-family: inherit; }
a { color: inherit; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C7D2E0; border-radius: 6px; border: 2px solid var(--page-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Animations (from the design) ---------- */
@keyframes fadeUp      { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes loginRise   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes panelInRight{ from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes photoZoom   { from { transform: scale(1.12); } to { transform: scale(1); } }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login { height: 100vh; width: 100vw; overflow: hidden; position: relative; color: #16273B; }
.login__photo {
  position: absolute; inset: 0;
  background: #0A2240 url("../img/clock-hero-3.6290ad9ab91a.png") center/cover no-repeat;
  animation: photoZoom 1.8s cubic-bezier(.22,1,.36,1) both;
}
.login__tint  { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(5,14,30,.42) 0%, rgba(5,14,30,.12) 26%, rgba(5,14,30,0) 48%, rgba(5,14,30,0) 64%, rgba(7,18,38,.24) 100%); }
.login__glow  { position: absolute; inset: 0; background: radial-gradient(120% 85% at 87% 8%, rgba(212,175,55,.2), transparent 52%); }
.login__scroll{ position: absolute; inset: 0; z-index: 2; overflow-y: auto; }

.login__logo { width: 171px; height: 65px; display: block; position: absolute; left: 73px; top: 23px; }

.lg-wrap {
  min-height: 100%; display: flex; align-items: flex-end; justify-content: space-between;
  gap: clamp(28px,5vw,80px); padding: 48px clamp(34px,6vw,76px); flex-wrap: wrap; position: relative;
}

/* Brand block */
.lg-brand { flex: 1 1 360px; max-width: 540px; min-width: 240px; display: flex; flex-direction: column; animation: loginRise .8s ease .15s both; }
.lg-eyebrow { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.lg-eyebrow span:first-child { width: 28px; height: 2px; border-radius: 2px; background: linear-gradient(90deg,#E6C04A,rgba(230,192,74,.12)); }
.lg-eyebrow span:last-child  { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgba(232,196,86,.95); text-shadow: 0 1px 8px rgba(4,11,24,.5); }
.lg-brand h1 { font-family: 'IBM Plex Serif', Georgia, serif; font-weight: 600; font-size: clamp(27px,5.4vw,50px); line-height: 1.06; color: #fff; letter-spacing: -.012em; text-shadow: 0 2px 18px rgba(4,11,24,.6); }
.lg-brand p  { font-size: clamp(13.5px,1.5vw,15px); color: #C6D6E6; margin-top: 16px; max-width: 420px; line-height: 1.55; text-shadow: 0 1px 10px rgba(4,11,24,.55); }
.lg-pills { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.lg-pill  { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.2); color: #E8F0FA; font-size: 12px; font-weight: 500; padding: 7px 13px; border-radius: 20px; }

/* Glass sign-in card */
.lg-card {
  flex: 0 0 auto; width: 396px; max-width: 100%; align-self: center;
  background: linear-gradient(155deg, rgba(20,40,66,.44), rgba(9,23,43,.34));
  backdrop-filter: blur(26px) saturate(135%); -webkit-backdrop-filter: blur(26px) saturate(135%);
  border: 1px solid rgba(255,255,255,.22); border-radius: 24px; padding: 30px 30px 26px;
  box-shadow: 0 44px 90px -34px rgba(3,10,22,.82), inset 0 1px 0 rgba(255,255,255,.2);
  animation: panelInRight .85s cubic-bezier(.22,1,.36,1) both;
}
.lg-eyebrow-sm { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(230,192,74,.92); }
.lg-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; color: #fff; letter-spacing: -.01em; margin-top: 7px; }
.lg-sub   { font-size: 13px; color: rgba(226,236,247,.72); margin-top: 6px; line-height: 1.5; }

.lg-field { margin-top: 16px; }
.lg-label { display: block; font-size: 12px; font-weight: 500; color: rgba(226,236,247,.82); margin-bottom: 7px; }
.lg-inputwrap { display: flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 11px; padding: 11px 14px; background: rgba(255,255,255,.09); }
.lg-inputwrap:focus-within { border-color: rgba(230,192,74,.7); }
.lg-inputwrap span { color: rgba(255,255,255,.6); font-size: 14px; }
.lg-input { border: none; outline: none; flex: 1; font-size: 13.5px; color: #fff; background: transparent; }
.lg-input::placeholder { color: rgba(226,236,247,.45); }

.lg-btn {
  width: 100%; margin-top: 22px; border: none; cursor: pointer;
  background: linear-gradient(135deg,#E6C04A,#C2932B); color: #0B2240;
  font-weight: 700; font-size: 14.5px; padding: 13px; border-radius: 12px;
  box-shadow: 0 14px 30px -10px rgba(212,175,55,.7); font-family: 'Space Grotesk', sans-serif;
}
.lg-btn:hover { filter: brightness(1.03); }

.lg-error { background: rgba(209,75,75,.18); border: 1px solid rgba(209,75,75,.5); color: #FFE0E0; font-size: 12.5px; border-radius: 10px; padding: 9px 12px; margin-top: 16px; }

.lg-foot { margin-top: 18px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; gap: 8px; }
.lg-foot span { font-size: 11px; color: rgba(214,226,240,.62); letter-spacing: .02em; }
.lg-foot b { color: rgba(232,196,86,.9); font-weight: 600; }

/* Responsive: stack brand above card */
@media (max-width: 900px) {
  .lg-wrap { flex-direction: column; align-items: stretch; justify-content: flex-start; padding-top: 100px; gap: 30px; }
  .lg-brand { order: 1; flex: 0 0 auto; max-width: 600px; align-self: flex-start; }
  .lg-card  { order: 2; align-self: flex-start; }
}
@media (max-width: 560px) {
  .lg-wrap { padding-left: 20px; padding-right: 20px; padding-bottom: 32px; }
  .lg-card { width: 100%; align-self: stretch; }
  .lg-brand h1 { font-size: clamp(28px,9vw,40px); }
  .login__logo { left: 24px; top: 18px; width: 140px; height: auto; }
}

/* ============================================================
   APP SHELL (top nav + content)
   ============================================================ */
.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topnav { height: 60px; flex: none; background: linear-gradient(135deg,#0C2C4E,#0A2645); display: flex; align-items: center; padding: 0 18px; gap: 14px; position: relative; z-index: 30; box-shadow: inset 0 -1px 0 rgba(255,255,255,.07); }
.topnav__logo { height: 40px; width: auto; display: block; }
.navtabs { display: flex; align-items: stretch; gap: 2px; height: 100%; overflow-x: auto; overflow-y: hidden; flex: 1 1 auto; min-width: 0; margin-left: 10px; scrollbar-width: none; }
.navtabs::-webkit-scrollbar { display: none; }
.nav-tab { display: flex; align-items: center; height: 100%; padding: 0 14px; border: none; background: none; color: #9FB6CE; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; font-family: inherit; text-decoration: none; }
.nav-tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-tab--active { color: #fff; border-bottom-color: #D4AF37; }
.nav-badge { margin-left: 7px; background: #D4AF37; color: #0B2240; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; font-family: 'IBM Plex Mono', monospace; }
.topnav__right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.divider-v { width: 1px; height: 27px; background: rgba(255,255,255,.12); }
/* Notification bell dropdown */
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #D14B4B; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1.5px solid #0B2240; }
.notif-menu { position: absolute; right: 0; top: 46px; width: 322px; max-height: 424px; overflow-y: auto; background: #fff; border: 1px solid #E4EAF1; border-radius: 14px; box-shadow: 0 18px 44px rgba(11,34,64,.18); padding: 6px; z-index: 60; }
.notif-menu__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px; font-size: 12px; font-weight: 700; color: #0B2A4A; text-transform: uppercase; letter-spacing: .04em; }
.notif-readall { border: none; background: none; color: #2D6BD4; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; text-transform: none; letter-spacing: 0; }
.notif-readall:hover { text-decoration: underline; }
.notif-item { display: flex; gap: 9px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; text-decoration: none; }
.notif-item:hover { background: #F3F7FC; }
.notif-item--unread { background: #EEF4FD; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: #CBD6E4; margin-top: 6px; flex: none; }
.notif-item--unread .notif-dot { background: #2D6BD4; }
.notif-body { display: flex; flex-direction: column; gap: 2px; }
.notif-msg { font-size: 12.5px; line-height: 1.4; color: #213347; }
.notif-time { font-size: 11px; color: #8091A2; }
.notif-empty { padding: 22px 12px; text-align: center; font-size: 12.5px; color: #8091A2; }

/* HTMX loading indicator: hidden by default, shown while a request is in flight */
.htmx-indicator { opacity: 0; transition: opacity .2s ease-in; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* Alpine: hide x-cloak elements until Alpine initializes (prevents a flash of content) */
[x-cloak] { display: none !important; }

/* Responsive: stack the Appeals decision cards to one column on small screens */
@media (max-width: 720px) {
  .r-appeal { grid-template-columns: 1fr !important; gap: 14px !important; }
  .r-appeal__mid { border-left: none !important; padding-left: 0 !important; }
  .r-appeal__actions { align-items: flex-start !important; }
}
/* Responsive: let the wide Discussion-items table scroll sideways in its card on small screens */
@media (max-width: 820px) {
  .r-table { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .r-disc-row { min-width: 760px; }
}
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.07); color: #CFE0F7; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; position: relative; }
.icon-btn:hover { background: rgba(255,255,255,.15); }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: #D14B4B; color: #fff; font-size: 9.5px; font-weight: 700; font-family: 'IBM Plex Mono', monospace; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #0A2645; }
.avatar-btn { display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13); border-radius: 30px; padding: 4px 12px 4px 4px; cursor: pointer; }
.avatar-btn:hover { background: rgba(255,255,255,.13); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#D4AF37,#B8862A); display: flex; align-items: center; justify-content: center; color: #0B2A4A; font-weight: 700; font-size: 12px; font-family: 'Space Grotesk', sans-serif; flex: none; }
.avatar-name { font-size: 11.5px; color: #fff; font-weight: 500; line-height: 1.15; }
.avatar-role { font-size: 10px; color: #9FB6CE; }
.menu { position: absolute; right: 0; top: 48px; width: 230px; background: #fff; border: 1px solid #E4EAF1; border-radius: 13px; box-shadow: 0 18px 40px -16px rgba(11,34,64,.4); padding: 7px; z-index: 50; animation: fadeUp .16s ease; }
.menu__label { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #9AA7B5; padding: 8px 10px 6px; }
.menu a, .menu button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: none; background: none; cursor: pointer; border-radius: 8px; font-size: 12.5px; color: #16273B; font-weight: 500; text-decoration: none; font-family: inherit; text-align: left; }
.menu a:hover, .menu button:hover { background: #F6F9FD; }
.menu .danger { color: #D14B4B; }
.menu hr { border: none; height: 1px; background: #EEF2F7; margin: 6px 4px; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; background: #EEF2F8; }

/* ============================================================
   SHARED PIECES
   ============================================================ */
/* Center width-limited content so leftover space is balanced (not dumped on the right).
   Has no effect on full-width screens: auto margins on a full-width block resolve to 0. */
.r-pad { padding-left: 34px; padding-right: 34px; margin-left: auto; margin-right: auto; }
.card { background: #fff; border: 1px solid #E8EEF5; border-radius: 16px; box-shadow: 0 8px 24px -20px rgba(11,34,64,.4); }
.card__head { display: flex; align-items: center; padding: 17px 22px; border-bottom: 1px solid #EEF3F8; }
.card__title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15px; color: #0B2240; }
.link-btn { margin-left: auto; border: none; background: none; color: #2D6BD4; font-size: 12.5px; font-weight: 500; cursor: pointer; text-decoration: none; }
.badge-pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 500; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.mono { font-family: 'IBM Plex Mono', monospace; }
.muted { color: #7C8896; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.page-head { display: flex; align-items: flex-end; margin-bottom: 20px; }
.page-eyebrow { font-size: 12px; color: #7C8896; letter-spacing: .02em; }
.page-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 23px; color: #0B2240; margin-top: 3px; }
.btn-light { border: 1px solid #D7DFE9; background: #fff; color: #0B2240; font-weight: 500; font-size: 12.5px; padding: 9px 15px; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-light:hover { border-color: #0B2A4A; }
.btn-dark { border: none; background: linear-gradient(135deg,#0C2C4E,#0A2645); color: #fff; font-weight: 500; font-size: 12.5px; padding: 10px 16px; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 0 6px 14px -8px rgba(11,34,64,.6); }
.btn-gold { border: none; background: linear-gradient(135deg,#E6C04A,#C2932B); color: #0B2240; font-weight: 700; font-size: 13px; padding: 10px 16px; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-block; font-family: 'Space Grotesk', sans-serif; }

/* ===== DASHBOARD ===== */
.hero { background: linear-gradient(135deg,#0C2C4E 0%,#08203A 60%,#0A2747 100%); padding: 26px 34px 76px; position: relative; overflow: hidden; }
.hero__glow1 { position: absolute; top: -90px; right: -30px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle,rgba(212,175,55,.18),transparent 70%); }
.hero__glow2 { position: absolute; bottom: 0; left: 34%; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle,rgba(45,107,212,.16),transparent 70%); }
.hero__inner { position: relative; z-index: 2; }
.hero__eyebrow { font-size: 12.5px; color: #9FB6CE; letter-spacing: .03em; }
.hero h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 26px; color: #fff; margin-top: 6px; letter-spacing: -.01em; }
.hero p { font-size: 13.5px; color: #AFC2D6; margin-top: 7px; max-width: 560px; }
.stat-row { padding: 0 34px; margin-top: -50px; position: relative; z-index: 3; display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat-card { background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.9); border-radius: 15px; padding: 17px 19px; box-shadow: 0 14px 32px -16px rgba(11,34,64,.42); }
.stat-card__label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #5B6B7F; }
.stat-card__dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.stat-card__value { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 29px; color: #0B2240; margin-top: 11px; line-height: 1; }
.stat-card__sub { font-size: 11px; font-weight: 600; margin-top: 6px; }
.grid2 { padding: 24px 34px 40px; display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
.dist-bar { height: 7px; border-radius: 4px; background: #EEF3F8; overflow: hidden; }
.dist-bar > div { height: 100%; border-radius: 4px; }

/* ===== TABLES & FILTERS (Cases/Archive/etc.) ===== */
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #E1E8F1; border-radius: 10px; padding: 9px 14px; font-size: 12.5px; color: #0B2240; font-weight: 500; }
.type-filter { border: 1px solid #E1E8F1; background: #fff; color: #5B6B7F; font-size: 12px; font-weight: 500; padding: 8px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-block; }
.type-filter--active { background: #0B2240; color: #fff; border-color: #0B2240; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #E1E8F1; border-radius: 10px; padding: 9px 14px; font-size: 12.5px; color: #8593A2; min-width: 230px; }
.table-wrap { background: #fff; border: 1px solid #E8EEF5; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px -20px rgba(11,34,64,.4); }
.tbl-head { display: grid; gap: 12px; padding: 14px 22px; border-bottom: 1px solid #EEF3F8; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #8593A2; font-weight: 600; }
.tbl-row { width: 100%; display: grid; gap: 12px; padding: 14px 22px; border: none; border-bottom: 1px solid #F3F7FB; background: #fff; cursor: pointer; align-items: center; text-align: left; text-decoration: none; color: inherit; font-family: inherit; }
.tbl-row:hover { background: #F7FAFD; }

/* ============================================================
   RESPONSIVE — phones, tablets, laptops.
   !important overrides the design's inline grid styles where needed.
   ============================================================ */

/* Any data table sits in a horizontal-scroll container on small screens
   (the parent card scrolls; the table keeps usable column widths). */
@media (max-width: 900px) {
  .card, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.table-wrap { overflow-x: auto; }
@media (max-width: 760px) {
  .tbl-head, .tbl-row { min-width: 700px; }
}

/* Laptops / small desktops: stack the two-column content regions */
@media (max-width: 1024px) {
  .grid2, .r-g2 { grid-template-columns: 1fr !important; }
}

/* Tablets */
@media (max-width: 860px) {
  .stat-row, .r-stat { grid-template-columns: repeat(2, 1fr) !important; }
  .page-head { flex-wrap: wrap; row-gap: 12px; }
  .filters { flex-wrap: wrap; }
  .search { margin-left: 0 !important; min-width: 0 !important; width: 100%; }
}

/* Compact the top nav so the notification bell + avatar menu always fit */
@media (max-width: 680px) {
  .topnav { padding: 0 10px; gap: 8px; }
  .avatar-name, .avatar-role { display: none !important; }
  .avatar-btn { padding: 4px !important; }
}

/* Phones */
@media (max-width: 560px) {
  .r-pad, .hero, .stat-row, .grid2, .r-stat { padding-left: 16px !important; padding-right: 16px !important; }
  .stat-row, .r-stat { grid-template-columns: 1fr !important; }
}

/* --- Simple form controls (New case form, add-evidence) --- */
.f-card { background: #fff; border: 1px solid #E8EEF5; border-radius: 16px; padding: 20px 22px; box-shadow: 0 8px 24px -20px rgba(11,34,64,.4); }
.f-card + .f-card { margin-top: 16px; }
.f-card__title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14.5px; color: #0B2240; margin-bottom: 14px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.f-field { display: flex; flex-direction: column; gap: 6px; }
.f-field.f-wide { grid-column: 1 / -1; }
.f-label { font-size: 11.5px; font-weight: 600; color: #5B6B7F; }
.f-label .req { color: #C0392B; }
.f-in, .f-ta, .f-sel { width: 100%; border: 1px solid #D7DFE9; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #16273B; background: #FAFCFE; outline: none; }
.f-in:focus, .f-ta:focus, .f-sel:focus { border-color: #0B2A4A; background: #fff; }
.f-ta { resize: vertical; min-height: 88px; }
.f-in.f-err, .f-ta.f-err { border-color: #E0A9A2; background: #FCF4F3; }
@media (max-width: 720px) { .f-grid { grid-template-columns: 1fr; } }

