:root {
  --ef-bg: #f4f7fb;
  --ef-panel: #ffffff;
  --ef-soft: #f7f9fc;
  --ef-soft-strong: #eef3f9;
  --ef-text: #172033;
  --ef-muted: #69768b;
  --ef-line: #e2e8f1;
  --ef-brand: #2764e7;
  --ef-brand-dark: #1748b8;
  --ef-teal: #0e8b83;
  --ef-success: #087a55;
  --ef-warning: #b45f06;
  --ef-danger: #b42318;
  --ef-radius-sm: 10px;
  --ef-radius: 16px;
  --ef-radius-lg: 22px;
  --ef-shadow: 0 18px 50px rgba(27, 43, 77, 0.08);
  --ef-sidebar: 258px;
}

* { box-sizing: border-box; }
html { background: var(--ef-bg); color: var(--ef-text); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--ef-bg);
  color: var(--ef-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.ef-app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--ef-sidebar) minmax(0, 1fr); }
.ef-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 14px 16px;
  background: rgba(255,255,255,.96); border-right: 1px solid var(--ef-line);
  z-index: 20;
}
.ef-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 8px; }
.ef-brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 13px; color: white; text-decoration: none; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(140deg, var(--ef-brand), var(--ef-teal));
  box-shadow: 0 10px 24px rgba(39,100,231,.22);
}
.ef-brand-mark.small { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.ef-brand strong { display: block; font-size: 15px; line-height: 1.2; }
.ef-brand span { display: block; margin-top: 3px; color: var(--ef-muted); font-size: 11px; }
.ef-workspace-switcher {
  width: 100%; display: block; text-align: left; padding: 11px 12px; border: 1px solid var(--ef-line);
  border-radius: 13px; background: var(--ef-soft); color: var(--ef-text); cursor: default;
}
.ef-workspace-switcher span, .ef-workspace-switcher small { display: block; color: var(--ef-muted); font-size: 10px; }
.ef-workspace-switcher strong { display: block; margin: 3px 0; font-size: 13px; }
.ef-navigation { display: grid; gap: 10px; }
.ef-navigation section { display: grid; gap: 2px; }
.ef-navigation h2 { margin: 8px 9px 5px; color: var(--ef-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ef-nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px;
  color: #334057; text-decoration: none; border-radius: 11px; transition: background .16s ease, color .16s ease, transform .16s ease;
}
.ef-nav-item:hover, .ef-nav-item:focus-visible { background: var(--ef-soft-strong); color: var(--ef-brand-dark); outline: none; }
.ef-nav-item:active { transform: translateY(1px); }
.ef-nav-item strong { font-size: 12.5px; font-weight: 650; }
.ef-nav-icon { width: 19px; height: 19px; border: 1.5px solid #90a0b8; border-radius: 6px; position: relative; }
.ef-nav-icon::after { content: ""; position: absolute; inset: 5px; border-radius: 2px; background: #90a0b8; opacity: .5; }
.icon-home { border-radius: 50%; }
.icon-upload::after { inset: 3px 7px 7px; border-radius: 2px 2px 0 0; }
.icon-share { border-radius: 50%; }
.icon-vault { transform: rotate(45deg); border-radius: 5px; }
.icon-vault::after { transform: rotate(-45deg); }
.icon-proof { border-radius: 50%; border-style: double; }
.icon-settings { border-radius: 50%; }
.ef-sidebar-footer { margin-top: auto; display: grid; gap: 4px; border-top: 1px solid var(--ef-line); padding: 12px 8px 0; }
.ef-sidebar-footer a, .ef-sidebar-footer button { border: 0; background: transparent; padding: 7px 0; color: var(--ef-muted); text-decoration: none; text-align: left; font-size: 11px; cursor: pointer; }
.ef-sidebar-footer a:hover, .ef-sidebar-footer button:hover { color: var(--ef-text); }

.ef-main-shell { min-width: 0; }
.ef-topbar {
  position: sticky; top: 0; z-index: 15; min-height: 68px; display: flex; align-items: center; gap: 14px;
  padding: 11px 24px; background: rgba(244,247,251,.88); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226,232,241,.92);
}
.ef-mobile-brand { display: none; align-items: center; gap: 9px; }
.ef-command-search {
  flex: 1; max-width: 700px; min-height: 42px; display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; color: var(--ef-muted); text-decoration: none; background: var(--ef-panel);
  border: 1px solid var(--ef-line); border-radius: 13px; box-shadow: 0 5px 18px rgba(34,47,72,.035);
}
.ef-command-search:hover, .ef-command-search:focus-visible { border-color: #b8c7dc; box-shadow: 0 8px 22px rgba(34,47,72,.08); outline: none; }
.ef-command-search span:nth-child(2) { flex: 1; font-size: 12px; }
.ef-command-search kbd { border: 1px solid var(--ef-line); border-bottom-width: 2px; border-radius: 7px; padding: 3px 6px; background: var(--ef-soft); font-size: 10px; }
.ef-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ef-topbar-link { color: #40506a; text-decoration: none; padding: 9px 10px; border-radius: 10px; font-size: 12px; font-weight: 650; }
.ef-topbar-link:hover { background: var(--ef-panel); }
.ef-profile-button { width: 36px; height: 36px; display: grid; place-items: center; text-decoration: none; color: white; border-radius: 50%; background: linear-gradient(140deg, var(--ef-teal), var(--ef-brand)); font-size: 11px; font-weight: 800; }
.ef-page-canvas { min-height: calc(100vh - 68px); padding: 26px; }
.ef-flash { position: fixed; top: 78px; right: 22px; z-index: 50; max-width: 380px; padding: 12px 15px; border-radius: 12px; box-shadow: var(--ef-shadow); font-size: 12px; }
.ef-flash-info { background: #eaf8f4; color: #075c43; border: 1px solid #bfe9dc; }
.ef-flash-error { background: #fff0ef; color: #8f1d16; border: 1px solid #f3c4c0; }
.ef-mobile-nav { display: none; }

.ef-button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 13px; border-radius: 11px; border: 1px solid transparent; text-decoration: none;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.ef-button:hover { transform: translateY(-1px); }
.ef-button-primary { color: white; background: var(--ef-brand); border-color: var(--ef-brand); box-shadow: 0 8px 18px rgba(39,100,231,.18); }
.ef-button-primary:hover { background: var(--ef-brand-dark); }
.ef-button-secondary { color: #334057; background: var(--ef-panel); border-color: var(--ef-line); }
.ef-button-secondary:hover { background: var(--ef-soft); }
.ef-button-full { width: 100%; }
.ef-text-link { color: var(--ef-brand-dark); text-decoration: none; font-size: 11px; font-weight: 700; }
.ef-text-link:hover { text-decoration: underline; }

.ef-home, .ef-search-page { max-width: 1460px; margin: 0 auto; }
.ef-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; margin-bottom: 20px; }
.ef-page-header.compact { margin-bottom: 16px; }
.ef-page-header h1 { margin: 4px 0 5px; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.16; letter-spacing: -.035em; }
.ef-page-header p { margin: 0; max-width: 720px; color: var(--ef-muted); font-size: 12.5px; }
.ef-eyebrow { color: var(--ef-teal) !important; font-size: 10px !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ef-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ef-status-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.ef-status-card { min-height: 82px; padding: 14px; border: 1px solid var(--ef-line); border-radius: 15px; background: var(--ef-panel); box-shadow: 0 10px 32px rgba(34,47,72,.045); position: relative; overflow: hidden; }
.ef-status-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #9aa8bb; }
.ef-status-card span { display: block; color: var(--ef-muted); font-size: 10.5px; }
.ef-status-card strong { display: block; margin-top: 8px; font-size: 14px; letter-spacing: -.015em; }
.ef-status-card.tone-success::before { background: var(--ef-success); }
.ef-status-card.tone-warning::before { background: var(--ef-warning); }
.ef-status-card.tone-danger::before { background: var(--ef-danger); }

.ef-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(310px,.75fr); gap: 16px; align-items: start; }
.ef-panel { background: var(--ef-panel); border: 1px solid var(--ef-line); border-radius: var(--ef-radius-lg); box-shadow: var(--ef-shadow); overflow: hidden; }
.ef-panel-wide { grid-column: 1; }
.ef-panel-full { grid-column: 1 / -1; }
.ef-panel-header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px 12px; }
.ef-panel-header span { display: block; color: var(--ef-muted); font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ef-panel-header h2 { margin: 3px 0 0; font-size: 15px; letter-spacing: -.015em; }
.ef-attention-list, .ef-file-list, .ef-activity-list { padding: 0 13px 13px; display: grid; gap: 7px; }
.ef-attention-row { display: grid; grid-template-columns: 5px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px; background: var(--ef-soft); border: 1px solid var(--ef-line); border-radius: 13px; }
.ef-attention-indicator { width: 5px; height: 44px; border-radius: 999px; background: var(--ef-warning); }
.ef-attention-row.tone-critical .ef-attention-indicator { background: var(--ef-danger); }
.ef-attention-copy strong { display: block; font-size: 12.5px; }
.ef-attention-copy p { margin: 3px 0 0; color: var(--ef-muted); font-size: 11px; }

.ef-recovery-summary { padding: 2px 18px 18px; display: grid; grid-template-columns: 104px minmax(0,1fr); align-items: center; gap: 16px; }
.ef-progress-ring { --progress: 0; width: 100px; height: 100px; display: grid; place-items: center; align-content: center; border-radius: 50%; background: radial-gradient(circle at center, var(--ef-panel) 58%, transparent 60%), conic-gradient(var(--ef-teal) calc(var(--progress) * 1%), var(--ef-soft-strong) 0); }
.ef-progress-ring strong { font-size: 21px; line-height: 1; }
.ef-progress-ring span { margin-top: 5px; color: var(--ef-muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.ef-recovery-summary dl { margin: 0; display: grid; gap: 7px; }
.ef-recovery-summary dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ef-line); padding-bottom: 6px; }
.ef-recovery-summary dt { color: var(--ef-muted); font-size: 10.5px; }
.ef-recovery-summary dd { margin: 0; font-weight: 800; font-size: 11px; }
.ef-panel > .ef-button-full { width: calc(100% - 32px); margin: 0 16px 16px; }

.ef-file-row, .ef-activity-row { min-height: 55px; display: grid; align-items: center; gap: 10px; padding: 9px 10px; color: var(--ef-text); text-decoration: none; border: 1px solid transparent; border-radius: 12px; }
.ef-file-row { grid-template-columns: 32px minmax(0,1fr) auto 16px; }
.ef-activity-row { grid-template-columns: 9px minmax(0,1fr) auto; }
.ef-file-row:hover, .ef-activity-row:hover { background: var(--ef-soft); border-color: var(--ef-line); }
.ef-file-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #e9f0ff; color: var(--ef-brand); }
.ef-file-copy strong, .ef-activity-row strong { display: block; font-size: 11.5px; }
.ef-file-copy small, .ef-activity-row small { display: block; margin-top: 2px; color: var(--ef-muted); font-size: 10px; }
.ef-file-row time, .ef-activity-row time { color: var(--ef-muted); font-size: 9.5px; white-space: nowrap; }
.ef-row-arrow { color: #95a3b6; font-size: 18px; }
.ef-activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ef-teal); }

.ef-quick-grid { padding: 0 14px 14px; display: grid; gap: 8px; }
.ef-quick-action { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border: 1px solid var(--ef-line); border-radius: 13px; background: var(--ef-soft); overflow: hidden; }
.ef-quick-action > a { display: block; padding: 11px; color: var(--ef-text); text-decoration: none; }
.ef-quick-action strong { display: block; font-size: 11.5px; }
.ef-quick-action span { display: block; margin-top: 3px; color: var(--ef-muted); font-size: 9.5px; }
.ef-quick-action button { align-self: stretch; min-width: 52px; border: 0; border-left: 1px solid var(--ef-line); background: transparent; color: var(--ef-muted); font-size: 9px; cursor: pointer; }
.ef-quick-action button:hover { background: var(--ef-panel); color: var(--ef-brand-dark); }
.ef-empty-state { display: flex; align-items: center; gap: 13px; padding: 24px; color: var(--ef-muted); }
.ef-empty-state.compact { padding: 14px 18px 20px; }
.ef-empty-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--ef-soft-strong); color: var(--ef-teal); font-weight: 800; }
.ef-empty-state h3 { margin: 0; color: var(--ef-text); font-size: 12.5px; }
.ef-empty-state p { margin: 3px 0 0; font-size: 10.5px; }

.ef-search-surface { max-width: 960px; background: var(--ef-panel); border: 1px solid var(--ef-line); border-radius: var(--ef-radius-lg); box-shadow: var(--ef-shadow); overflow: hidden; }
.ef-search-form { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 17px; border-bottom: 1px solid var(--ef-line); }
.ef-search-form > span { color: var(--ef-muted); font-size: 20px; }
.ef-search-form input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ef-text); font-size: 15px; }
.ef-search-form input::placeholder { color: #8c98aa; }
.ef-search-form button { border: 0; background: var(--ef-soft); color: var(--ef-muted); border-radius: 9px; padding: 7px 9px; cursor: pointer; font-size: 10px; }
.ef-search-start { padding-bottom: 14px; }
.ef-search-action-grid { padding: 0 14px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.ef-search-action-grid a { display: block; padding: 13px; text-decoration: none; border: 1px solid var(--ef-line); border-radius: 13px; background: var(--ef-soft); }
.ef-search-action-grid a:hover { border-color: #bccae0; background: var(--ef-panel); }
.ef-search-action-grid strong { display: block; font-size: 11.5px; }
.ef-search-action-grid span { display: block; margin-top: 4px; color: var(--ef-muted); font-size: 10px; }
.ef-search-results > header { padding: 12px 16px 6px; color: var(--ef-muted); font-size: 10px; }
.ef-search-result { min-height: 62px; display: grid; grid-template-columns: 96px minmax(0,1fr) auto 18px; gap: 11px; align-items: center; padding: 10px 16px; color: var(--ef-text); text-decoration: none; border-top: 1px solid var(--ef-line); }
.ef-search-result:hover { background: var(--ef-soft); }
.ef-result-type { color: var(--ef-muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ef-result-copy strong { display: block; font-size: 12px; }
.ef-result-copy small { display: block; margin-top: 3px; color: var(--ef-muted); font-size: 10px; }
.ef-result-status { color: var(--ef-muted); font-size: 9.5px; white-space: nowrap; }

@media (max-width: 1180px) {
  .ef-status-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ef-dashboard-grid { grid-template-columns: minmax(0,1fr) 330px; }
}
@media (max-width: 900px) {
  :root { --ef-sidebar: 84px; }
  .ef-sidebar { padding-left: 10px; padding-right: 10px; align-items: center; }
  .ef-brand > div, .ef-workspace-switcher, .ef-navigation h2, .ef-nav-item strong, .ef-sidebar-footer { display: none; }
  .ef-navigation section { gap: 7px; }
  .ef-nav-item { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .ef-nav-icon { width: 21px; height: 21px; }
  .ef-dashboard-grid { grid-template-columns: 1fr; }
  .ef-panel-wide, .ef-panel-full { grid-column: 1; }
  .ef-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .ef-app-shell { display: block; }
  .ef-sidebar { display: none; }
  .ef-topbar { min-height: 60px; padding: 9px 13px; }
  .ef-mobile-brand { display: flex; }
  .ef-command-search { max-width: none; justify-content: center; }
  .ef-command-search span:nth-child(2), .ef-command-search kbd, .ef-topbar-link { display: none; }
  .ef-command-search { flex: 0 0 42px; width: 42px; padding: 0; }
  .ef-topbar-actions { gap: 6px; }
  .ef-topbar-actions > .ef-button { min-height: 36px; padding: 7px 10px; }
  .ef-page-canvas { padding: 17px 14px 88px; min-height: calc(100vh - 60px); }
  .ef-mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5,1fr); min-height: 64px; padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); border-top: 1px solid var(--ef-line); }
  .ef-mobile-nav a { display: grid; place-items: center; color: var(--ef-muted); text-decoration: none; font-size: 9px; font-weight: 700; }
  .ef-mobile-nav a:hover { color: var(--ef-brand-dark); background: var(--ef-soft); }
  .ef-page-header { display: block; }
  .ef-header-actions { margin-top: 13px; }
  .ef-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  .ef-status-card { min-height: 75px; }
  .ef-attention-row { grid-template-columns: 4px minmax(0,1fr); }
  .ef-attention-row .ef-button { grid-column: 2; justify-self: start; }
  .ef-recovery-summary { grid-template-columns: 94px minmax(0,1fr); gap: 12px; }
  .ef-progress-ring { width: 90px; height: 90px; }
  .ef-file-row { grid-template-columns: 30px minmax(0,1fr) 14px; }
  .ef-file-row time { display: none; }
  .ef-activity-row { grid-template-columns: 8px minmax(0,1fr); }
  .ef-activity-row time { grid-column: 2; }
  .ef-search-action-grid { grid-template-columns: 1fr; }
  .ef-search-result { grid-template-columns: minmax(0,1fr) 16px; }
  .ef-result-type, .ef-result-status { grid-column: 1; }
  .ef-result-copy { grid-column: 1; }
  .ef-search-result .ef-row-arrow { grid-column: 2; grid-row: 1 / span 3; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
