:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f6fb;
  --ink: #172033;
  --green: #2563eb;
  --green-dark: #1d4ed8;
  --blue: #2468d3;
  --muted: #64748b;
  --line: #dce4ef;
  --surface: #ffffff;
  --soft: #f3f7fc;
  --warning: #9a6805;
  --danger: #a32d24;
  --shadow: 0 18px 50px rgba(30, 58, 138, .09);
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 0 0, #dbeafe, transparent 30rem), #f3f6fb; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

/* Six-digit mobile gate, following ep-new's remembered-access pattern. */
.gate-page { display: grid; min-height: 100svh; padding: 20px; place-items: center; background: radial-gradient(circle at 50% 0, #dbeafe, transparent 42%), #f3f6fb; }
.gate-shell { width: min(420px, 100%); }
.gate-card { padding: 27px 22px; border: 1px solid #d4e2dc; border-radius: 24px; background: #fff; box-shadow: 0 24px 65px rgba(23,59,47,.15); }
.gate-logo { display: grid; width: 58px; height: 58px; margin: 0 auto 18px; place-items: center; border-radius: 18px; color: #fff; background: linear-gradient(135deg,#172554,#2563eb); font-size: 1.5rem; font-weight: 950; }
.gate-card .eyebrow { text-align: center; }
.gate-card h1 { margin: 7px 0 8px; text-align: center; font-size: 1.75rem; letter-spacing: -.045em; }
.gate-copy { max-width: 330px; margin: 0 auto 20px; color: var(--muted); text-align: center; font-size: .86rem; line-height: 1.55; }
.gate-error { margin-bottom: 13px; padding: 11px 12px; border: 1px solid #efbdb7; border-radius: 11px; color: #9a281f; background: #fff0ee; font-size: .78rem; }
.gate-form label { display: block; margin-bottom: 7px; color: #56665f; text-align: center; font-size: .72rem; font-weight: 900; }
.gate-form input { width: 100%; height: 60px; padding: 0 12px; border: 1px solid #d3dfda; border-radius: 14px; outline: 0; text-align: center; font-size: 1.55rem; font-weight: 950; letter-spacing: .48em; text-indent: .48em; }
.gate-form input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(8,113,90,.11); }
.gate-form small { display: block; margin-top: 7px; color: #7b8882; text-align: center; font-size: .67rem; }
.gate-form button { width: 100%; min-height: 51px; margin-top: 15px; border: 0; border-radius: 13px; color: #fff; background: var(--green); font-weight: 950; cursor: pointer; }
.gate-form button:hover { background: var(--green-dark); }
.gate-note { margin: 17px 0 0; padding: 10px; border-radius: 10px; color: #66756f; background: #f1f6f4; text-align: center; font-size: .69rem; line-height: 1.45; }

/* Root application is intentionally mobile-first; admin tools live separately. */
.mobile-workspace .app-header { padding-inline: max(12px, calc((100vw - 760px) / 2)); }
.mobile-workspace .app-main, .mobile-workspace .app-footer { width: min(760px, 100%); }
.mobile-account { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mobile-account form { margin: 0; }
.mobile-user-name { max-width: 130px; overflow: hidden; color: #d9e7e2; font-size: .7rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.mobile-data-button { min-height: 36px; padding: 0 10px; border: 1px solid #60a5fa; border-radius: 9px; color: #fff; background: #2563eb; font-size: .7rem; font-weight: 900; cursor: pointer; }
.mobile-data-button:hover { background: #1d4ed8; }
.mobile-report-link { min-height: 36px; padding: 0 9px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 9px; color: #fff; text-decoration: none; font-size: .7rem; font-weight: 900; }
.mobile-signout { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 9px; color: #fff; background: transparent; font-weight: 950; cursor: pointer; }
.mobile-intro { margin: 3px 2px 18px; }
.mobile-intro h1 { margin: 0; font-size: clamp(1.9rem, 9vw, 2.6rem); letter-spacing: -.055em; }
.mobile-intro p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.mobile-workspace .global-search-panel { grid-template-columns: 1fr; gap: 12px; }
.mobile-workspace .selection-grid { grid-template-columns: 1fr; }
.mobile-workspace .selection-grid .field:last-child { grid-column: auto; }
.mobile-workspace .result-card { grid-template-columns: 1fr; }
.mobile-workspace .open-result { width: 100%; }

.data-import-modal { width: min(430px,calc(100vw - 24px)); max-width: none; padding: 0; border: 0; border-radius: 20px; color: #172033; background: #fff; box-shadow: 0 28px 80px rgba(15,23,42,.3); }
.data-import-modal::backdrop { background: rgba(15,23,42,.62); backdrop-filter: blur(3px); }
.data-import-modal form { padding: 20px; }
.data-modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.data-modal-heading small { display: block; margin-bottom: 4px; color: #2563eb; font-size: .6rem; font-weight: 950; letter-spacing: .1em; }
.data-modal-heading h2 { margin: 0; color: #172554; font-size: 1.25rem; letter-spacing: -.025em; }
.data-modal-heading > button { width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid #dce4ef; border-radius: 11px; color: #475569; background: #f8fafc; font-size: 1.25rem; cursor: pointer; }
.data-import-modal > form > p { margin: 11px 0 17px; color: #64748b; font-size: .76rem; line-height: 1.5; }
.data-import-modal label { display: block; margin-bottom: 7px; color: #334155; font-size: .72rem; font-weight: 900; }
.data-import-modal input[type=date] { width: 100%; min-height: 50px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 12px; outline: 0; color: #172033; background: #fff; }
.data-import-modal input[type=date]:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.11); }
.data-import-status { margin-top: 11px; padding: 10px 11px; border-radius: 11px; color: #475569; background: #f1f5f9; font-size: .68rem; line-height: 1.4; }
.data-import-status.success { color: #166534; background: #dcfce7; }
.data-import-status.warning { color: #92400e; background: #fef3c7; }
.data-import-status.error { color: #b91c1c; background: #fee2e2; }
.data-modal-actions { margin-top: 17px; display: grid; grid-template-columns: .72fr 1.28fr; gap: 8px; }
.data-modal-actions button { min-height: 48px; border: 0; border-radius: 12px; font-weight: 900; cursor: pointer; }
.data-cancel-button { color: #475569; background: #e2e8f0; }
.data-import-button { color: #fff; background: #2563eb; }
.data-import-button:disabled { opacity: .55; cursor: wait; }

.import-progress-modal { width: min(390px,calc(100vw - 24px)); max-width: none; padding: 0; overflow: hidden; border: 0; border-radius: 24px; color: #172033; background: #fff; box-shadow: 0 30px 90px rgba(15,23,42,.38); }
.import-progress-modal::backdrop { background: rgba(15,23,42,.72); backdrop-filter: blur(5px); }
.import-progress-card { padding: 27px 20px 20px; text-align: center; }
.import-progress-visual { position: relative; width: 86px; height: 86px; margin: 0 auto 15px; display: grid; place-items: center; }
.import-progress-icon { position: relative; z-index: 2; display: grid; width: 52px; height: 52px; place-items: center; border-radius: 18px; color: #fff; background: linear-gradient(145deg,#2563eb,#1d4ed8); box-shadow: 0 13px 28px rgba(37,99,235,.32); font-size: 1.65rem; font-weight: 950; animation: importIconPulse 1.4s ease-in-out infinite; }
.import-orbit { position: absolute; inset: 0; border: 2px solid transparent; border-top-color: #2563eb; border-right-color: #93c5fd; border-radius: 50%; animation: importOrbit 1.15s linear infinite; }
.import-orbit-two { inset: 8px; border-top-color: transparent; border-right-color: #60a5fa; border-bottom-color: #dbeafe; animation-duration: 1.8s; animation-direction: reverse; }
.import-progress-kicker { margin: 0 0 5px; color: #2563eb; font-size: .62rem; font-weight: 950; letter-spacing: .13em; }
.import-progress-card h2 { margin: 0; color: #172554; font-size: 1.35rem; letter-spacing: -.03em; }
.import-progress-message { min-height: 38px; margin: 8px auto 15px; color: #64748b; font-size: .76rem; line-height: 1.45; }
.import-progress-bar { height: 7px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.import-progress-bar span { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#2563eb,#60a5fa,#2563eb); animation: importProgressSlide 1.35s ease-in-out infinite; }
.import-progress-steps { margin: 17px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; list-style: none; }
.import-progress-steps li { position: relative; display: grid; justify-items: center; gap: 6px; color: #94a3b8; font-size: .6rem; }
.import-progress-steps li span { display: grid; width: 27px; height: 27px; place-items: center; border: 2px solid #e2e8f0; border-radius: 50%; background: #fff; font-size: .66rem; font-weight: 950; }
.import-progress-steps li strong { font-weight: 850; }
.import-progress-steps li.active { color: #1d4ed8; }
.import-progress-steps li.active span { border-color: #2563eb; color: #fff; background: #2563eb; box-shadow: 0 0 0 5px rgba(37,99,235,.1); }
.import-progress-steps li.complete { color: #15803d; }
.import-progress-steps li.complete span { border-color: #16a34a; color: #fff; background: #16a34a; }
.import-progress-time { margin: 15px 0 0; color: #94a3b8; font-size: .63rem; font-weight: 750; }
.import-progress-result { margin-top: 15px; padding: 11px; border-radius: 12px; color: #166534; background: #dcfce7; font-size: .72rem; line-height: 1.45; }
.import-progress-result.error { color: #b91c1c; background: #fee2e2; }
.import-progress-close { width: 100%; min-height: 47px; margin-top: 14px; border: 0; border-radius: 12px; color: #fff; background: #2563eb; font-weight: 900; cursor: pointer; }
.import-progress-modal.finished .import-orbit { display: none; }
.import-progress-modal.finished .import-progress-icon { background: #16945f; animation: importResultPop .36s ease-out both; }
.import-progress-modal.failed .import-orbit { display: none; }
.import-progress-modal.failed .import-progress-icon { background: #dc2626; animation: importResultPop .36s ease-out both; }
.import-progress-modal.finished .import-progress-bar span { width: 100%; background: #16a34a; animation: none; }
.import-progress-modal.failed .import-progress-bar span { width: 100%; background: #dc2626; animation: none; }
@keyframes importOrbit { to { transform: rotate(360deg); } }
@keyframes importIconPulse { 50% { transform: scale(.92); } }
@keyframes importProgressSlide { from { transform: translateX(-115%); } to { transform: translateX(245%); } }
@keyframes importResultPop { from { opacity: .3; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .import-orbit, .import-progress-icon, .import-progress-bar span { animation-duration: 3s; }
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 72px; padding: 10px max(18px, calc((100vw - 1480px) / 2));
  color: #fff; background: linear-gradient(120deg,rgba(15,31,70,.99),rgba(30,64,175,.98)); box-shadow: 0 8px 24px rgba(30,58,138,.18);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #fff; background: rgba(255,255,255,.14); font-size: 1.15rem; font-weight: 950; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: -.015em; }
.brand small { margin-top: 1px; color: #bfdbfe; font-size: .67rem; font-weight: 700; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.header-actions a, .action-button { min-height: 38px; padding: 0 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 9px; color: #fff; background: transparent; text-decoration: none; font-size: .74rem; font-weight: 850; cursor: pointer; }
.header-actions a { display: inline-flex; align-items: center; }
.header-actions form { margin: 0; }
.action-button.green { border-color: var(--green); background: var(--green); }
.action-button.blue { border-color: var(--blue); background: var(--blue); }
.action-button.signout { border-color: #d86057; color: #ffd9d5; }
.header-actions a:hover, .action-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.session-badge { display: inline-flex; align-items: center; gap: 6px; margin-right: 3px; padding: 7px 9px; border-radius: 999px; color: #d9e9e4; background: rgba(255,255,255,.08); font-size: .67rem; font-weight: 850; }
.session-badge i { width: 8px; height: 8px; border-radius: 50%; background: #f0b433; }
.session-badge.ready i { background: #46cf96; box-shadow: 0 0 0 4px rgba(70,207,150,.12); }

.app-main { width: min(1480px, 100%); margin: 0 auto; padding: 28px 18px 54px; flex: 1; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 4px 0 20px; }
.eyebrow { margin: 0 0 6px; color: #2563eb; font-size: .69rem; font-weight: 950; letter-spacing: .12em; }
.welcome-row h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.055em; line-height: 1; }
.welcome-row p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px 7px 7px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #52615b; font-size: .74rem; font-weight: 800; box-shadow: 0 8px 22px rgba(30,65,52,.06); }
.user-chip span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); }
.flash { margin-bottom: 16px; padding: 13px 15px; border-radius: 12px; font-size: .84rem; font-weight: 800; }
.flash.success { border: 1px solid #a9dac8; color: #075a47; background: #e5f7f0; }
.flash.error { border: 1px solid #efb9b3; color: #98291f; background: #fff0ee; }
.app-toast { position: fixed; z-index: 1000; right: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 15px; border-radius: 12px; color: #fff; background: #087159; box-shadow: 0 14px 40px rgba(0,0,0,.22); font-size: .8rem; font-weight: 850; opacity: 0; transform: translateY(12px); transition: .2s ease; }
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast.error { background: #a32d24; }

.global-search-panel, .selection-panel, .detail-panel, .search-results {
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
}
.global-search-panel { display: grid; grid-template-columns: minmax(220px, .62fr) minmax(320px, 1.38fr); gap: 24px; align-items: center; margin-bottom: 16px; padding: 19px 21px; }
.global-search-copy label { display: block; font-size: 1rem; font-weight: 950; }
.global-search-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.search-wrap { display: flex; align-items: center; min-height: 50px; padding: 0 10px 0 15px; border: 1px solid #cddbd5; border-radius: 14px; background: #f9fbfa; }
.search-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(8,113,89,.10); background: #fff; }
.search-wrap > span { color: #718079; font-size: 1.45rem; }
.search-wrap input { width: 100%; min-width: 0; padding: 0 11px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-wrap button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #5b6a64; background: #e9f0ed; font-size: 1.2rem; cursor: pointer; }

.selection-panel { padding: 21px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.quick-dates { display: flex; gap: 7px; }
.quick-dates button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: #45564f; background: var(--soft); font-size: .75rem; font-weight: 850; cursor: pointer; }
.quick-dates button:hover { border-color: var(--green); color: var(--green); }
.selection-grid { display: grid; grid-template-columns: minmax(190px, .72fr) minmax(280px, 1.15fr) minmax(340px, 1.45fr); gap: 13px; }
.field span { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: #46574f; font-size: .77rem; font-weight: 900; }
.field b { color: var(--green); font-size: .7rem; }
.field input, .field select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: #1a2a24; background: #fff; }
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,113,89,.10); }
.field select:disabled { color: #87938e; background: #f2f5f4; }
.department-picker { display: grid; gap: 7px; }
.department-search-input { min-height: 42px !important; padding-left: 38px !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2368766f' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center !important; }
.department-search-input:disabled { color: #87938e; background-color: #f2f5f4 !important; }
.selection-status { min-height: 20px; margin: 13px 0 0; color: var(--muted); font-size: .76rem; }
.selection-status.error { color: var(--danger); font-weight: 800; }

.search-results { margin-top: 16px; padding: 19px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.results-heading h2 { margin: 0; font-size: 1.12rem; }
.results-heading span { color: var(--muted); font-size: .75rem; }
.result-list { display: grid; gap: 9px; }
.result-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.result-number { margin: 0 0 4px; color: var(--green); font-size: .72rem; font-weight: 950; }
.result-card h3 { margin: 0; font-size: .96rem; line-height: 1.4; }
.result-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: .7rem; }
.open-result { min-height: 40px; padding: 0 15px; border: 0; border-radius: 10px; color: #fff; background: var(--green); font-size: .75rem; font-weight: 900; cursor: pointer; }

.detail-panel { margin-top: 16px; overflow: hidden; }
.detail-hero { padding: clamp(22px, 4vw, 34px); color: #fff; background: linear-gradient(125deg, #1d3e78 0%, #2c66a8 100%); }
.detail-hero-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.detail-hero-top > div:first-child { min-width: 0; }
.detail-number { color: #d7e7ff; font-size: .76rem; font-weight: 950; letter-spacing: .06em; }
.detail-hero h2 { max-width: 1050px; margin: 12px 0 10px; font-size: clamp(1.45rem, 4vw, 2.35rem); letter-spacing: -.035em; line-height: 1.16; overflow-wrap: anywhere; text-transform: uppercase; }
.detail-hero p { margin: 0; color: #e2edff; font-size: .9rem; }
.close-detail { flex: 0 0 39px; width: 39px; height: 39px; border: 1px solid rgba(255,255,255,.35); border-radius: 11px; color: #fff; background: rgba(255,255,255,.08); font-size: 1.25rem; cursor: pointer; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; border-top: 1px solid rgba(255,255,255,.25); margin-top: 22px; padding-top: 18px; }
.metric { min-width: 0; padding: 13px 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 13px; background: rgba(9,33,77,.16); }
.metric:first-child { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.22); }
.metric small { display: block; color: #d4e5ff; font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.metric strong { display: block; margin-top: 6px; font-size: .86rem; overflow-wrap: anywhere; }
.detail-body { padding: 21px; }
.detail-section + .detail-section { margin-top: 20px; }
.detail-section h3 { margin: 0 0 11px; font-size: 1rem; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.info-item { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.info-item small { display: block; margin-bottom: 4px; color: var(--muted); font-size: .63rem; font-weight: 900; letter-spacing: .05em; }
.info-item strong { font-size: .82rem; overflow-wrap: anywhere; }
.description { margin: 10px 0 0; color: #475850; font-size: .8rem; line-height: 1.65; white-space: pre-line; }
.files-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.files-heading h3 { margin: 0; }
.share-list-button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 10px; color: #fff; background: #168b55; font-size: .72rem; font-weight: 900; cursor: pointer; }
.share-list-button:hover { background: #087340; }
.share-list-button:disabled { opacity: .45; cursor: not-allowed; }
.status-summary { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.summary-pill { padding: 6px 9px; border-radius: 999px; color: #456057; background: #eaf2ef; font-size: .67rem; font-weight: 850; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.status-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.status-table th, .status-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: .77rem; }
.status-table th { color: #fff; background: var(--ink); font-size: .7rem; letter-spacing: .02em; }
.status-table tbody tr:last-child td { border-bottom: 0; }
.status-table tbody tr:nth-child(odd) { background: #f7faf8; }
.status-table .center { text-align: center; }
.file-check, .file-missing { display: inline-grid; min-width: 29px; min-height: 25px; padding: 0 8px; place-items: center; border-radius: 8px; color: #fff; font-size: .72rem; font-weight: 950; }
.file-check { background: #12885e; }
.file-missing { background: #dc3e4e; }
.file-actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.file-download-form { display: inline; margin: 0; }
.file-action { display: inline-flex; min-height: 34px; padding: 0 10px; align-items: center; justify-content: center; border: 0; border-radius: 9px; color: #fff; text-decoration: none; font-size: .68rem; font-weight: 900; line-height: 1.15; cursor: pointer; white-space: nowrap; }
.file-action.view { background: #176caa; }
.file-action.download { background: #2563eb; }
.file-action.whatsapp { background: #168b55; }
.file-action:hover { color: #fff; filter: brightness(1.08); }
.file-action:disabled { opacity: .55; cursor: wait; }
.empty-state, .loading-state { padding: 30px 18px; color: var(--muted); text-align: center; }
.spinner { display: inline-block; width: 22px; height: 22px; margin-bottom: 8px; border: 3px solid #d9e5e0; border-top-color: var(--green); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1480px, 100%); margin: auto auto 0; padding: 18px; color: #728079; font-size: .68rem; }

.settings-main { max-width: 1240px; }
.settings-status-card { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--line); box-shadow: var(--shadow); }
.settings-status-card > div { min-width: 0; padding: 17px; background: #fff; }
.settings-status-card small { display: block; margin-bottom: 6px; color: var(--muted); font-size: .65rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.settings-status-card strong { display: block; font-size: .86rem; overflow-wrap: anywhere; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 16px; align-items: start; }
.settings-side { display: grid; gap: 16px; }
.settings-card { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.settings-card-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.settings-card h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.settings-copy { margin: 8px 0 18px; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.secure-note { padding: 6px 8px; border-radius: 999px; color: #075945; background: #e4f5ef; font-size: .64rem; font-weight: 900; white-space: nowrap; }
.settings-form { display: grid; gap: 13px; }
.settings-form label span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #46574f; font-size: .75rem; font-weight: 900; }
.settings-form label em { color: var(--muted); font-style: normal; font-weight: 700; }
.settings-form textarea { width: 100%; padding: 11px 12px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: #1a2a24; background: #fbfdfc; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.settings-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,113,89,.10); background: #fff; }
.settings-primary, .session-actions button { min-height: 44px; border: 0; border-radius: 11px; color: #fff; background: var(--green); font-weight: 900; cursor: pointer; }
.settings-primary:hover, .session-actions button:hover { background: var(--green-dark); }
.session-actions { display: grid; gap: 9px; }
.session-actions form { margin: 0; }
.session-actions button { width: 100%; color: var(--ink); background: #e9f2ef; }
.session-actions button:hover { color: #fff; }
.account-shortcut a { display: inline-flex; min-height: 42px; padding: 0 14px; align-items: center; border-radius: 10px; color: #fff; background: var(--blue); text-decoration: none; font-size: .76rem; font-weight: 900; }

@media (max-width: 1100px) {
  .app-header { position: static; align-items: flex-start; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .selection-grid { grid-template-columns: 1fr 1fr; }
  .selection-grid .field:last-child { grid-column: 1 / -1; }
  .info-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
  .settings-status-card { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { padding-left: 0; border-left: 0; }
}

@media (max-width: 720px) {
  .app-main { padding: 18px 10px 40px; }
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .user-chip { display: none; }
  .global-search-panel { grid-template-columns: 1fr; gap: 11px; padding: 16px; }
  .selection-panel { padding: 16px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .selection-grid { grid-template-columns: 1fr; }
  .selection-grid .field:last-child { grid-column: auto; }
  .result-card { grid-template-columns: 1fr; }
  .open-result { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 14px 0; }
  .metric { padding-left: 0; border-left: 0; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .detail-hero, .detail-body { padding: 17px; }
  .files-heading { align-items: stretch; flex-direction: column; }
  .share-list-button { width: 100%; }
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .status-table { display: block; min-width: 0; }
  .status-table thead { display: none; }
  .status-table tbody { display: grid; gap: 10px; }
  .status-table tr { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff !important; }
  .status-table td { display: grid; grid-template-columns: minmax(88px, .42fr) minmax(0, 1fr); gap: 10px; align-items: center; min-height: 45px; padding: 10px 12px; text-align: left !important; }
  .status-table td::before { content: attr(data-label); color: var(--muted); font-size: .64rem; font-weight: 950; letter-spacing: .035em; text-transform: uppercase; }
  .status-table td.supplier-cell { color: var(--ink); font-weight: 900; }
  .file-actions { justify-content: flex-start; }
  .file-action { flex: 1 1 auto; min-height: 38px; }
  .app-footer { flex-direction: column; gap: 4px; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand { width: 100%; }
  .session-badge { width: 100%; justify-content: center; }
  .header-actions a, .header-actions form { flex: 1 1 calc(50% - 7px); }
  .header-actions a, .action-button { width: 100%; justify-content: center; text-align: center; }
  .quick-dates { width: 100%; }
  .quick-dates button { flex: 1; }
  .info-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .detail-hero h2 { font-size: 1.35rem; }
  .settings-status-card { grid-template-columns: 1fr; }
  .settings-card { padding: 17px; }
}

@media (max-width: 1100px) {
  .mobile-workspace .app-header { position: sticky; align-items: center; flex-direction: row; }
}

@media (max-width: 480px) {
  .mobile-workspace .brand { width: auto; min-width: 0; }
  .mobile-workspace .brand small { display: none; }
  .mobile-workspace .brand-mark { width: 38px; height: 38px; }
  .mobile-user-name { display: none; }
  .mobile-workspace .app-main { padding-top: 20px; }
  .mobile-workspace .global-search-panel, .mobile-workspace .selection-panel, .mobile-workspace .search-results { border-radius: 16px; }
}

/* Mobile tender detail follows ep-new's full-screen, card-first flow. */
body.detail-page-open { overflow-x: hidden; background: #f3f6fb; }
.mobile-workspace.detail-mode .app-header,
.mobile-workspace.detail-mode .mobile-intro,
.mobile-workspace.detail-mode .global-search-panel,
.mobile-workspace.detail-mode .selection-panel,
.mobile-workspace.detail-mode .search-results,
.mobile-workspace.detail-mode .app-footer { display: none; }
.mobile-workspace.detail-mode .app-main { width: 100%; max-width: none; padding: 0; }
.mobile-workspace.detail-mode .detail-panel { min-height: 100vh; min-height: 100dvh; margin: 0; overflow: visible; border: 0; border-radius: 0; background: #f3f6fb; box-shadow: none; }
.detail-topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #dce4ef; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.back-button { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid #cbd5e1; border-radius: 13px; color: #172554; background: #fff; font-size: 1.25rem; }
.detail-topbar-copy { min-width: 0; }
.detail-topbar-copy strong, .detail-topbar-copy small { display: block; }
.detail-topbar-copy strong { color: #172554; font-size: .92rem; }
.detail-topbar-copy small { margin-top: 2px; color: #64748b; font-size: .66rem; }
.detail-wrap { width: min(760px, 100%); margin: 0 auto; padding: 12px 12px max(18px, env(safe-area-inset-bottom)); }
.detail-wrap .detail-hero { padding: 13px; border-radius: 16px; color: #fff; background: linear-gradient(135deg,#193a7a,#2866ac); box-shadow: 0 10px 24px rgba(30,58,138,.16); }
.detail-wrap .detail-number { font-size: .62rem; }
.detail-wrap .detail-hero h1 { margin: 4px 0 5px; color: #fff; font-size: clamp(1.05rem, 4.8vw, 1.38rem); line-height: 1.2; letter-spacing: -.018em; overflow-wrap: anywhere; text-transform: none; }
.detail-department { margin: 0; color: #dbeafe; font-size: .7rem; line-height: 1.35; }
.detail-wrap .metric-grid { margin-top: 10px; padding-top: 9px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.detail-wrap .metric { min-width: 0; min-height: 52px; padding: 7px 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: rgba(15,35,78,.16); }
.detail-wrap .metric:first-child { padding-left: 8px; }
.detail-wrap .metric small { color: #bfdbfe; font-size: .5rem; line-height: 1.1; }
.detail-wrap .metric strong { margin-top: 3px; font-size: .67rem; line-height: 1.25; }
.detail-card { margin-top: 12px; padding: 13px; border: 1px solid #dce4ef; border-radius: 18px; background: #fff; box-shadow: 0 7px 22px rgba(15,23,42,.05); }
.files-heading { align-items: flex-start; margin-bottom: 10px; }
.files-heading h2 { margin: 0; color: #172554; font-size: 1rem; }
.files-heading p { margin: 4px 0 0; color: #64748b; font-size: .68rem; line-height: 1.4; }
.files-heading-actions { display: flex; align-items: center; gap: 7px; }
.refresh-bidders-button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(110deg,#1d4ed8,#2563eb); box-shadow: 0 7px 17px rgba(37,99,235,.18); white-space: nowrap; font-size: .72rem; font-weight: 900; cursor: pointer; }
.refresh-bidders-button::before { content: '↻'; margin-right: 5px; }
.refresh-bidders-button:disabled { opacity: .6; cursor: wait; }
.share-list-button { min-height: 44px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(110deg,#15803d,#16a34a); box-shadow: 0 7px 17px rgba(22,163,74,.17); white-space: nowrap; }
.share-list-button::before { content: '↗'; margin-right: 5px; }
.snapshot-share-status { margin: 0 0 11px; padding: 9px 10px; border-radius: 11px; color: #334155; background: #f1f5f9; font-size: .68rem; line-height: 1.4; }
.snapshot-share-status.success { color: #166534; background: #dcfce7; }
.snapshot-share-status.warning { color: #92400e; background: #fef3c7; }
.snapshot-share-status.error { color: #b91c1c; background: #fee2e2; }
.bidder-refresh-status { margin: 0 0 11px; padding: 11px; border: 1px solid #bfdbfe; border-radius: 12px; color: #1e3a8a; background: #eff6ff; font-size: .7rem; line-height: 1.45; }
.bidder-refresh-status.success { border-color: #bbf7d0; color: #166534; background: #dcfce7; }
.bidder-refresh-status.warning { border-color: #fde68a; color: #92400e; background: #fef3c7; }
.bidder-refresh-status.error { border-color: #fecaca; color: #b91c1c; background: #fee2e2; }
.bidder-refresh-status strong { display: block; margin-bottom: 3px; font-size: .75rem; }
.bidder-refresh-meta { color: inherit; opacity: .78; font-size: .64rem; }
.bidder-refresh-list { margin: 8px 0 0; padding: 0; display: grid; gap: 5px; list-style: none; }
.bidder-refresh-list li { padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.68); }
.bidder-import-log-button { width: 100%; min-height: 42px; margin-top: 9px; border: 0; border-radius: 10px; color: #fff; background: #d97706; font-weight: 900; cursor: pointer; }
.bidder-file-list { display: grid; gap: 10px; }
.bidder-file-card { min-width: 0; overflow: hidden; border: 1px solid #d9e3f0; border-radius: 16px; background: #fff; box-shadow: 0 5px 15px rgba(15,23,42,.045); }
.bidder-file-header { min-height: 68px; padding: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #1e40af; background: linear-gradient(120deg,#172554,#1d4ed8); }
.bidder-file-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.bidder-avatar { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 12px; color: #1d4ed8; background: #fff; box-shadow: 0 5px 14px rgba(15,23,42,.22); font-size: .7rem; font-weight: 950; }
.bidder-file-identity > div { min-width: 0; }
.bidder-file-identity h3 { margin: 0; color: #fff; font-size: .8rem; line-height: 1.3; overflow-wrap: anywhere; }
.bidder-file-identity small { display: block; margin-top: 3px; color: #dbeafe; font-size: .61rem; }
.bidder-file-count { flex: 0 0 auto; padding: 5px 7px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: #fff; background: rgba(255,255,255,.14); font-size: .56rem; font-weight: 900; }
.bidder-lot-group + .bidder-lot-group { border-top: 6px solid #f1f5f9; }
.bidder-lot-heading { min-height: 38px; padding: 8px 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #1e3a8a; background: #eff6ff; border-bottom: 1px solid #dbeafe; }
.bidder-lot-heading strong { font-size: .7rem; }
.bidder-lot-heading span { padding: 4px 7px; border-radius: 999px; color: #475569; background: #fff; font-size: .55rem; font-weight: 850; }
.bidder-document-row { padding: 11px; display: grid; grid-template-columns: minmax(0,.8fr) minmax(180px,1.2fr); gap: 9px; align-items: center; border-top: 1px solid #eef2f7; }
.bidder-document-row:first-of-type { border-top: 0; }
.bidder-document-copy { min-width: 0; display: flex; align-items: center; gap: 8px; }
.bidder-document-icon { width: 38px; height: 34px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 9px; color: #92400e; background: #fef3c7; font-size: .52rem; font-weight: 950; letter-spacing: -.02em; }
.bidder-document-icon.available { color: #fff; }
.bidder-document-icon.technical.available { background: linear-gradient(135deg,#1d4ed8,#3b82f6); }
.bidder-document-icon.financial.available { background: linear-gradient(135deg,#047857,#10b981); }
.bidder-document-icon.combined.available { background: linear-gradient(135deg,#6d28d9,#8b5cf6); }
.bidder-document-copy strong, .bidder-document-copy small { display: block; }
.bidder-document-copy strong { color: #1e293b; font-size: .7rem; line-height: 1.3; }
.bidder-document-copy small { margin-top: 2px; color: #64748b; font-size: .56rem; }
.bidder-document-row .file-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.bidder-document-row .file-download-form { grid-column: 1 / -1; }
.bidder-document-row .file-action { width: 100%; min-height: 44px; padding: 8px; border-radius: 10px; font-size: .72rem; white-space: normal; }
.bidder-document-row .file-action.whatsapp:last-child:nth-child(odd) { grid-column: 1 / -1; }
.more-details { padding: 0; }
.more-details summary { min-height: 50px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; color: #172554; font-size: .8rem; font-weight: 900; cursor: pointer; list-style: none; }
.more-details summary::-webkit-details-marker { display: none; }
.more-details summary::after { content: '+'; color: #2563eb; font-size: 1.2rem; }
.more-details[open] summary::after { content: '−'; }
.more-details .info-grid { padding: 0 13px 13px; grid-template-columns: 1fr 1fr; }
.more-details .description { margin: 0 13px 13px; }

@media (max-width: 520px) {
  .detail-wrap { padding-inline: 10px; }
  .detail-wrap .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .files-heading { align-items: stretch; flex-direction: column; }
  .files-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .share-list-button, .refresh-bidders-button { width: 100%; padding-inline: 7px; font-size: .65rem; }
  .bidder-document-row { grid-template-columns: 1fr; align-items: stretch; }
  .bidder-document-row .file-actions { width: 100%; }
  .more-details .info-grid { grid-template-columns: 1fr; }
}
