:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #768196;
  --faint: #a6afbe;
  --line: #e7ebf2;
  --panel: #ffffff;
  --canvas: #f5f7fb;
  --navy: #14223b;
  --navy-2: #1c3153;
  --blue: #556af5;
  --blue-dark: #4055e5;
  --blue-soft: #eef0ff;
  --mint: #dff7ed;
  --green: #18865d;
  --amber: #b46c09;
  --red: #c33d52;
  --red-soft: #fff0f1;
  --shadow: 0 12px 40px rgba(20, 34, 59, .07);
  --shadow-soft: 0 4px 18px rgba(20, 34, 59, .045);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; width: 1em; height: 1em; flex: 0 0 auto; }
#app { min-height: 100vh; }

.boot-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--muted); }
.boot-copy { display: grid; gap: 3px; }
.boot-copy strong { color: var(--ink); font-size: 15px; letter-spacing: -.02em; }
.boot-copy span { font-size: 13px; }
.boot-spinner, .spinner { width: 20px; height: 20px; border: 2px solid #dfe4f0; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; position: relative; overflow: hidden; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #7885ff, #4c5fe9); box-shadow: 0 6px 15px rgba(81, 99, 239, .24); }
.brand-mark span { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.09em; transform: translate(-1px, -1px); }
.brand-mark-large { width: 46px; height: 46px; border-radius: 15px; }
.brand-mark-large span { font-size: 29px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-name { color: #fff; font-size: 15px; font-weight: 750; letter-spacing: -.035em; white-space: nowrap; }
.brand-caption { color: #94a2bd; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; margin-top: 1px; }

/* Authentication */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(430px, 520px); background: #fbfcfe; }
.auth-visual { background: var(--navy); color: #fff; min-height: 100vh; padding: clamp(32px, 6vw, 84px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-visual:before, .auth-visual:after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-visual:before { width: 560px; height: 560px; right: -270px; bottom: -155px; border: 1px solid rgba(157, 178, 255, .15); box-shadow: 0 0 0 54px rgba(157, 178, 255, .035), 0 0 0 110px rgba(157, 178, 255, .025); }
.auth-visual:after { width: 260px; height: 260px; right: 12%; top: 23%; background: radial-gradient(circle, rgba(91, 111, 241, .22), transparent 70%); }
.auth-visual .brand-name { font-size: 17px; }
.auth-visual-copy { position: relative; z-index: 1; max-width: 570px; margin: auto 0; padding: 50px 0; }
.auth-visual-copy h1 { font-size: clamp(32px, 4.4vw, 58px); line-height: 1.06; letter-spacing: -.055em; font-weight: 650; margin: 0 0 22px; max-width: 590px; }
.auth-visual-copy h1 em { color: #9ba7ff; font-style: normal; }
.auth-visual-copy p { max-width: 460px; color: #aab6ca; font-size: 16px; line-height: 1.8; margin: 0; }
.auth-feature-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 38px; }
.auth-feature { display: flex; align-items: center; gap: 8px; color: #d9e0f0; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); border-radius: 999px; padding: 9px 12px; font-size: 12px; }
.auth-feature svg { color: #91e0be; }
.auth-visual-footer { position: relative; z-index: 1; color: #7f8da6; font-size: 11px; }
.auth-main { display: flex; justify-content: center; align-items: center; padding: 40px; }
.auth-card { width: min(100%, 414px); }
.auth-card .mobile-brand { display: none; }
.auth-eyebrow { color: var(--blue); text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .14em; margin: 0 0 11px; }
.auth-card h2 { font-size: 29px; letter-spacing: -.045em; line-height: 1.2; margin: 0 0 9px; }
.auth-subtitle { color: var(--muted); margin: 0 0 29px; line-height: 1.7; }
.auth-form { display: grid; gap: 17px; }
.auth-note { margin-top: 22px; color: var(--muted); display: flex; gap: 9px; align-items: flex-start; font-size: 12px; line-height: 1.65; }
.auth-note svg { color: var(--green); flex: 0 0 auto; margin-top: 2px; }

/* App frame */
.app-layout { min-height: 100vh; display: flex; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--navy); color: #fff; min-height: 100vh; padding: 25px 15px 17px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20; }
.sidebar-brand { padding: 0 11px 27px; border-bottom: 1px solid rgba(255,255,255,.08); }
.server-chip { display: flex; align-items: center; gap: 8px; color: #9eabc2; font-size: 11px; margin-top: 18px; padding: 8px 10px; border-radius: 9px; background: rgba(255,255,255,.045); }
.server-dot { width: 7px; height: 7px; background: #5dd29f; border-radius: 50%; box-shadow: 0 0 0 3px rgba(93,210,159,.13); }
.sidebar-section-label { color: #74839e; text-transform: uppercase; font-size: 9px; font-weight: 750; letter-spacing: .13em; padding: 21px 11px 9px; }
.nav-list { display: grid; gap: 4px; }
.nav-link { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; color: #a9b6ca; text-align: left; padding: 11px 12px; border-radius: 10px; font-size: 13px; font-weight: 570; transition: .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(91,109,245,.24), rgba(91,109,245,.11)); box-shadow: inset 3px 0 #7f8bff; }
.nav-link svg { width: 18px; height: 18px; color: #8c9bb3; flex: 0 0 auto; }
.nav-link.active svg { color: #aeb7ff; }
.nav-count { margin-left: auto; color: #9eafff; background: rgba(108,124,255,.18); padding: 2px 7px; border-radius: 7px; font-size: 10px; }
.sidebar-spacer { flex: 1; }
.sidebar-safe-card { margin: 14px 5px 17px; padding: 14px; border-radius: 13px; border: 1px solid rgba(255,255,255,.09); background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.025)); }
.safe-card-title { display: flex; align-items: center; gap: 7px; color: #d5deed; font-size: 11px; font-weight: 650; }
.safe-card-title svg { color: #82d6b1; }
.sidebar-safe-card p { color: #8190a9; margin: 8px 0 0; font-size: 10px; line-height: 1.6; }
.sidebar-bottom { padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: space-between; }
.admin-ident { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; color: #dfe4ff; font-size: 11px; font-weight: 750; background: linear-gradient(135deg, #596fe9, #866cf4); }
.admin-ident strong { display: block; font-size: 11px; color: #e9edf6; }
.admin-ident span { color: #7f8da6; font-size: 9px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: #8292ad; border-radius: 9px; }
.icon-button:hover { color: var(--ink); background: #f0f2f8; }
.sidebar .icon-button:hover { color: white; background: rgba(255,255,255,.08); }
.main-area { min-width: 0; flex: 1; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.breadcrumb-label { color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.live-label { color: #69768b; font-size: 11px; display: flex; align-items: center; gap: 8px; }
.live-label .server-dot { width: 6px; height: 6px; }
.mobile-menu { display: none; }
.content-wrap { width: min(100%, 1420px); margin: 0 auto; padding: 35px clamp(22px, 4vw, 56px) 58px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.page-heading h1 { margin: 0; font-size: clamp(25px, 3vw, 31px); letter-spacing: -.05em; line-height: 1.15; font-weight: 690; }
.page-heading p { color: var(--muted); margin: 8px 0 0; font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--blue); text-transform: uppercase; letter-spacing: .13em; font-size: 9px; font-weight: 800; margin: 0 0 9px; }

/* Controls */
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 0 14px; font-size: 12px; font-weight: 690; text-decoration: none; transition: .17s ease; white-space: nowrap; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgba(85,106,245,.19); }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 8px 17px rgba(85,106,245,.24); }
.button-secondary { color: #44516a; background: #fff; border-color: var(--line); box-shadow: 0 2px 5px rgba(20,34,59,.025); }
.button-secondary:hover:not(:disabled) { border-color: #cdd4e1; background: #fbfcff; }
.button-quiet { color: #5f6d83; background: transparent; border-color: transparent; }
.button-quiet:hover:not(:disabled) { color: var(--ink); background: #eff2f8; }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #ffdde1; }
.button-danger:hover:not(:disabled) { background: #ffe3e6; }
.button-small { min-height: 32px; padding: 0 10px; font-size: 11px; border-radius: 8px; }
.button-full { width: 100%; min-height: 46px; }
.field { display: grid; gap: 7px; }
.field-label { color: #4f5b70; font-size: 11px; font-weight: 680; }
.field-hint { color: var(--muted); font-size: 10px; line-height: 1.5; }
.input-wrap { position: relative; }
.input { width: 100%; height: 43px; outline: none; border: 1px solid #dfe4ed; border-radius: 10px; background: #fff; padding: 0 12px; color: var(--ink); font-size: 12px; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #a9b2c1; }
.input:focus { border-color: #8b98ff; box-shadow: 0 0 0 3px rgba(85,106,245,.11); }
.input-with-icon { padding-left: 39px; }
.input-icon { position: absolute; width: 16px; height: 16px; left: 13px; top: 50%; transform: translateY(-50%); color: #9aa5b7; pointer-events: none; }
.textarea { min-height: 90px; height: auto; padding-top: 11px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.search-box { display: flex; align-items: center; gap: 8px; min-width: 200px; max-width: 320px; height: 39px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: #fff; color: #9aa4b4; }
.search-box:focus-within { border-color: #9aa5ff; box-shadow: 0 0 0 3px rgba(85,106,245,.08); }
.search-box svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #a2acbc; }
.toggle-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle { appearance: none; width: 39px; height: 23px; border-radius: 999px; position: relative; border: 0; background: #d8deea; transition: .18s ease; flex: 0 0 auto; }
.toggle:before { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.14); transition: .18s ease; }
.toggle:checked { background: var(--blue); }
.toggle:checked:before { left: 19px; }
.toggle-copy strong { display: block; font-size: 11px; color: #465268; }
.toggle-copy span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }

/* Dashboard */
.welcome-banner { position: relative; overflow: hidden; background: linear-gradient(110deg, #e9edff 0%, #eff2ff 46%, #effaf5 100%); border: 1px solid #e3e8fb; border-radius: var(--radius); padding: 24px 27px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.welcome-banner:after { content: ""; position: absolute; width: 260px; height: 260px; right: 12%; top: -170px; border: 1px solid rgba(91,108,238,.13); border-radius: 50%; box-shadow: 0 0 0 32px rgba(91,108,238,.035), 0 0 0 64px rgba(91,108,238,.027); }
.welcome-copy { position: relative; z-index: 1; }
.welcome-copy h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.welcome-copy p { margin: 6px 0 0; color: #6d7890; font-size: 11px; }
.welcome-mark { z-index: 1; width: 49px; height: 49px; display: grid; place-items: center; color: #5869e7; border-radius: 15px; background: rgba(255,255,255,.75); box-shadow: 0 5px 18px rgba(64,82,193,.09); }
.welcome-mark svg { width: 24px; height: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.stat-card { min-height: 112px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 16px 17px; box-shadow: var(--shadow-soft); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 610; }
.stat-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); }
.stat-icon.green { color: var(--green); background: #e7f7ef; }
.stat-icon.amber { color: var(--amber); background: #fff4df; }
.stat-icon.navy { color: #52607a; background: #eef1f6; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-value { font-size: 25px; letter-spacing: -.055em; font-weight: 720; line-height: 1; margin-top: 11px; }
.stat-foot { color: #98a2b2; font-size: 9px; margin-top: 7px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .85fr); gap: 17px; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-soft); }
.panel-header { min-height: 60px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0f5; }
.panel-title { color: var(--ink); font-size: 12px; font-weight: 720; letter-spacing: -.01em; }
.panel-subtitle { color: #929caf; font-size: 10px; margin-top: 3px; }
.panel-body { padding: 14px 18px 17px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); border: 0; background: none; padding: 5px 0; font-size: 10px; font-weight: 700; text-decoration: none; }
.text-link:hover { color: var(--blue-dark); }
.text-link svg { width: 13px; height: 13px; }
.file-list { display: grid; }
.file-row { display: grid; grid-template-columns: minmax(0,1fr) 100px 118px auto; align-items: center; gap: 12px; min-height: 54px; border-bottom: 1px solid #f0f2f6; }
.file-row:last-child { border-bottom: 0; }
.file-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.file-icon { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; color: #7482f2; background: #f0f1ff; border-radius: 10px; }
.file-icon.folder { color: #c4871d; background: #fff6e6; }
.file-icon.document { color: #5476c8; background: #edf4ff; }
.file-icon.image { color: #a061c0; background: #f6eeff; }
.file-icon.archive { color: #278a70; background: #e9f8f2; }
.file-icon svg { width: 17px; height: 17px; }
.file-name-wrap { min-width: 0; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #303c52; font-size: 11px; font-weight: 650; }
.file-meta { color: #9aa4b4; font-size: 9px; margin-top: 2px; }
.file-cell { color: #8490a2; font-size: 10px; }
.file-actions { display: flex; justify-content: flex-end; gap: 4px; }
.action-mini { width: 30px; height: 30px; border: 0; border-radius: 8px; color: #8591a4; background: transparent; display: grid; place-items: center; }
.action-mini:hover { color: var(--blue); background: var(--blue-soft); }
.action-mini svg { width: 15px; height: 15px; }
.activity-list { display: grid; }
.activity-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f0f2f6; }
.activity-item:last-child { border-bottom: 0; }
.activity-mark { width: 29px; height: 29px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; color: var(--green); background: #e9f8f0; }
.activity-mark.blue { color: var(--blue); background: #eff1ff; }
.activity-mark.amber { color: var(--amber); background: #fff4e3; }
.activity-mark svg { width: 14px; height: 14px; }
.activity-copy { min-width: 0; flex: 1; }
.activity-copy strong { display: block; color: #49566b; font-size: 10px; font-weight: 660; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy span { display: block; color: #9aa4b3; font-size: 9px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { color: #aab2c0; font-size: 9px; white-space: nowrap; padding-top: 2px; }

/* File browser and tables */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 13px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; min-width: 0; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; color: #8591a3; font-size: 11px; }
.crumb { border: 0; padding: 4px 2px; background: none; color: #66748a; font-size: 11px; }
.crumb:hover { color: var(--blue); }
.crumb.current { color: var(--ink); font-weight: 680; }
.crumb-separator { color: #c4cad5; }
.table-panel { overflow: hidden; }
.list-header { display: grid; grid-template-columns: minmax(0,1fr) 140px 180px 120px; gap: 12px; padding: 12px 17px; color: #9aa4b3; text-transform: uppercase; letter-spacing: .08em; font-size: 9px; font-weight: 750; background: #fbfcfe; border-bottom: 1px solid #edf0f5; }
.list-header span:not(:first-child) { text-align: right; }
.browser-row { display: grid; grid-template-columns: minmax(0,1fr) 140px 180px 120px; gap: 12px; align-items: center; padding: 11px 17px; min-height: 62px; border-bottom: 1px solid #f0f2f6; transition: background .15s; }
.browser-row:last-child { border-bottom: 0; }
.browser-row:hover { background: #fbfcff; }
.browser-row .file-main { cursor: pointer; }
.browser-row .file-name { font-size: 11px; }
.browser-row .file-cell { text-align: right; }
.row-download { justify-self: end; }
.search-note { color: #8792a4; font-size: 10px; margin: 7px 0 0; }
.link-table-head, .link-row { display: grid; grid-template-columns: minmax(170px,1.5fr) minmax(115px,.8fr) minmax(120px,.8fr) minmax(125px,.85fr) minmax(155px,1fr); gap: 12px; align-items: center; padding: 13px 17px; }
.link-table-head { color: #98a2b1; background: #fbfcfe; border-bottom: 1px solid #edf0f5; font-size: 9px; letter-spacing: .08em; font-weight: 750; text-transform: uppercase; }
.link-row { min-height: 68px; border-bottom: 1px solid #f0f2f6; }
.link-row:last-child { border-bottom: 0; }
.link-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.link-badge { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.link-badge svg { width: 16px; height: 16px; }
.link-title strong { display: block; font-size: 11px; color: #364258; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-title span { display: block; font-size: 9px; color: #9aa4b4; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-cell { color: #7f8b9e; font-size: 10px; }
.link-protection { display: flex; gap: 5px; flex-wrap: wrap; }
.mini-tag { display: inline-flex; align-items: center; gap: 4px; color: #77849a; background: #f1f3f7; border-radius: 6px; padding: 4px 6px; font-size: 8px; white-space: nowrap; }
.mini-tag svg { width: 10px; height: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 690; white-space: nowrap; }
.status-pill:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { color: #16825b; background: #e9f8f0; }
.status-revoked { color: #8791a1; background: #f0f2f5; }
.status-expired { color: #a66309; background: #fff4e1; }
.status-scope { color: #6c58a5; background: #f2edff; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-actions .icon-button { width: 30px; height: 30px; }

/* Settings and activity */
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(270px,.68fr); gap: 17px; align-items: start; }
.settings-card { padding: 20px; }
.settings-card h3 { margin: 0; font-size: 13px; letter-spacing: -.015em; }
.settings-card > p { color: var(--muted); font-size: 10px; line-height: 1.7; margin: 6px 0 18px; }
.setting-section { padding: 17px 0; border-top: 1px solid #eff1f5; }
.setting-section:first-of-type { border-top: 0; padding-top: 0; }
.setting-actions { display: flex; gap: 8px; margin-top: 11px; }
.security-note { display: flex; gap: 11px; padding: 15px; border-radius: 12px; color: #557065; background: #eff9f4; border: 1px solid #e0f2e9; font-size: 10px; line-height: 1.7; }
.security-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--green); }
.security-note strong { color: #32604d; }
.activity-table { width: 100%; border-collapse: collapse; }
.activity-table th { text-align: left; padding: 12px 15px; color: #98a2b1; background: #fbfcfe; border-bottom: 1px solid #edf0f5; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.activity-table td { padding: 13px 15px; border-bottom: 1px solid #f0f2f6; color: #748095; font-size: 10px; vertical-align: top; }
.activity-table tr:last-child td { border-bottom: 0; }
.activity-table td:first-child { color: #3e4b61; font-weight: 600; }
.action-label { color: #5e6e84; }

/* Empty, loading, alerts */
.empty-state { min-height: 245px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 30px; }
.empty-art { width: 60px; height: 60px; display: grid; place-items: center; color: #6e7af0; background: #f0f2ff; border-radius: 19px; margin-bottom: 13px; }
.empty-art svg { width: 26px; height: 26px; }
.empty-state h3 { color: #39465c; font-size: 13px; margin: 0 0 5px; }
.empty-state p { max-width: 320px; color: #929caf; font-size: 10px; line-height: 1.65; margin: 0 0 14px; }
.skeleton { position: relative; overflow: hidden; background: #edf0f5; border-radius: 7px; }
.skeleton:after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-row { height: 48px; margin: 8px 0; }
.inline-loading { color: #8d98aa; font-size: 11px; display: flex; align-items: center; gap: 9px; padding: 24px; }
.inline-loading .spinner { width: 15px; height: 15px; }
.alert { padding: 10px 12px; border-radius: 9px; color: #8f3a4a; background: #fff1f2; border: 1px solid #ffe1e4; font-size: 11px; line-height: 1.5; }
.alert.info { color: #52627a; background: #f1f4fa; border-color: #e6eaf1; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 20px; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 210px; max-width: min(390px, calc(100vw - 40px)); display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; color: #e9f2ee; background: #1c3153; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; box-shadow: 0 12px 35px rgba(16,29,51,.22); font-size: 11px; animation: toast-in .2s ease-out; }
.toast.error { background: #713b4a; }
.toast svg { width: 15px; height: 15px; flex: 0 0 auto; color: #8be0ba; }
.toast.error svg { color: #ffc1c8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Modals */
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,28,48,.42); backdrop-filter: blur(5px); animation: fade-in .16s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(100%, 520px); max-height: min(92vh, 760px); overflow: auto; background: #fff; border: 1px solid rgba(255,255,255,.8); border-radius: 18px; box-shadow: 0 25px 85px rgba(15,29,55,.26); }
.modal.wide { width: min(100%, 620px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; border-bottom: 1px solid #eff1f5; }
.modal-header h2 { margin: 0; color: #26334a; font-size: 17px; letter-spacing: -.03em; }
.modal-header p { margin: 5px 0 0; color: #8a95a8; font-size: 10px; line-height: 1.6; }
.modal-body { display: grid; gap: 15px; padding: 18px 22px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 21px; }
.modal-close { width: 31px; height: 31px; flex: 0 0 auto; }
.copy-link-box { display: flex; gap: 8px; padding: 9px; border: 1px solid #e6eaf2; background: #f8f9fc; border-radius: 11px; }
.copy-link-text { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #536179; font-size: 10px; align-self: center; padding-left: 4px; }
.success-card { display: flex; gap: 12px; padding: 14px; border: 1px solid #dff2e8; border-radius: 12px; background: #f0faf5; }
.success-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: #14835a; background: #def5e9; border-radius: 10px; }
.success-icon svg { width: 17px; height: 17px; }
.success-card strong { display: block; color: #2e5d49; font-size: 11px; }
.success-card span { display: block; color: #668477; font-size: 9px; margin-top: 3px; line-height: 1.5; }

/* Public share */
.share-page { min-height: 100vh; background: linear-gradient(180deg, #f2f5fc 0, #f7f8fb 270px, #f7f8fb 100%); }
.share-topbar { height: 72px; border-bottom: 1px solid #e8ecf3; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 6vw, 90px); background: rgba(255,255,255,.76); }
.share-topbar .brand-name { color: #29364c; }
.share-topbar .brand-caption { color: #8e99ab; }
.share-secure { display: flex; align-items: center; gap: 7px; color: #748197; font-size: 10px; }
.share-secure svg { color: #229269; width: 15px; height: 15px; }
.share-content { width: min(100% - 40px, 980px); margin: 44px auto; }
.share-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.share-intro h1 { margin: 0; color: #26344b; font-size: clamp(24px, 4vw, 31px); letter-spacing: -.05em; }
.share-intro p { color: #8994a6; margin: 8px 0 0; font-size: 11px; }
.share-title-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; color: var(--blue); background: #e9edff; border-radius: 14px; }
.share-title-icon svg { width: 23px; height: 23px; }
.share-card { background: #fff; border: 1px solid #e8ecf3; border-radius: 17px; box-shadow: var(--shadow-soft); overflow: hidden; }
.share-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; border-bottom: 1px solid #edf0f5; }
.share-toolbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.share-breadcrumb { display: flex; align-items: center; gap: 6px; color: #79869a; font-size: 10px; min-width: 0; }
.share-breadcrumb button { color: #738097; border: 0; background: none; padding: 4px 0; font-size: 10px; }
.share-breadcrumb button:hover { color: var(--blue); }
.share-breadcrumb .current { color: #354159; font-weight: 700; }
.share-actions { display: flex; align-items: center; gap: 8px; }
.share-table-head { display: grid; grid-template-columns: minmax(0,1fr) 130px 170px 100px; gap: 10px; padding: 10px 17px; color: #9aa4b3; background: #fbfcfe; border-bottom: 1px solid #edf0f5; text-transform: uppercase; letter-spacing: .08em; font-size: 8px; font-weight: 750; }
.share-table-head span:not(:first-child) { text-align: right; }
.share-row { display: grid; grid-template-columns: minmax(0,1fr) 130px 170px 100px; align-items: center; gap: 10px; padding: 11px 17px; min-height: 59px; border-bottom: 1px solid #f0f2f6; }
.share-row:last-child { border-bottom: 0; }
.share-row .file-cell { text-align: right; }
.share-lock-card { width: min(100%, 430px); margin: 70px auto; padding: 26px; background: #fff; border: 1px solid #e8ecf3; border-radius: 17px; box-shadow: var(--shadow); }
.share-lock-mark { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #7180f6, #4e61e6); border-radius: 15px; box-shadow: 0 7px 17px rgba(85,106,245,.22); margin-bottom: 19px; }
.share-lock-mark svg { width: 22px; height: 22px; }
.share-lock-card h1 { margin: 0; color: #27344a; font-size: 21px; letter-spacing: -.04em; }
.share-lock-card p { color: #8692a5; font-size: 11px; line-height: 1.7; margin: 7px 0 20px; }
.share-lock-card .auth-form { gap: 13px; }
.share-footer { color: #a4adba; text-align: center; font-size: 9px; padding: 22px 10px 36px; }

@media (max-width: 1120px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr); }
  .link-table-head, .link-row { grid-template-columns: minmax(150px,1.3fr) minmax(100px,.75fr) minmax(110px,.8fr) minmax(110px,.8fr) minmax(132px,1fr); gap: 8px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(15,28,48,.15); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 15; background: rgba(15,28,48,.35); }
  .mobile-menu { display: grid; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .link-table-head, .link-row { grid-template-columns: minmax(150px,1.2fr) minmax(90px,.8fr) minmax(105px,.8fr) minmax(105px,.8fr) minmax(118px,.85fr); }
}
@media (max-width: 700px) {
  .auth-layout { display: block; background: #fff; }
  .auth-visual { display: none; }
  .auth-main { min-height: 100vh; align-items: flex-start; padding: 34px 24px; }
  .auth-card { padding-top: 8vh; }
  .auth-card .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 48px; }
  .auth-card .mobile-brand .brand-name { color: #28364c; }
  .auth-card .mobile-brand .brand-caption { color: #929db0; }
  .topbar { height: 63px; padding: 0 17px; }
  .topbar-right .live-label { display: none; }
  .content-wrap { padding: 25px 16px 44px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; gap: 15px; }
  .page-heading h1 { font-size: 26px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .welcome-banner { padding: 19px; }
  .welcome-copy h2 { font-size: 16px; }
  .stat-grid { gap: 9px; }
  .stat-card { padding: 13px; min-height: 100px; }
  .stat-value { font-size: 23px; }
  .panel-header { padding-left: 14px; padding-right: 14px; }
  .panel-body { padding: 10px 14px 13px; }
  .file-row { grid-template-columns: minmax(0,1fr) 72px 32px; gap: 8px; }
  .file-row .file-cell:nth-child(3) { display: none; }
  .file-row .file-actions { grid-column: 3; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-right .search-box { max-width: none; width: 100%; }
  .list-header { grid-template-columns: minmax(0,1fr) 80px 95px; padding: 10px 12px; }
  .list-header span:nth-child(3) { display: none; }
  .browser-row { grid-template-columns: minmax(0,1fr) 80px 95px; padding: 10px 12px; gap: 7px; }
  .browser-row .file-cell:nth-child(3) { display: none; }
  .browser-row .row-download { grid-column: 3; }
  .browser-row .file-cell:nth-child(2) { text-align: right; }
  .link-table-head { display: none; }
  .link-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 13px 14px; }
  .link-row .link-cell:nth-child(2), .link-row .link-cell:nth-child(3) { display: none; }
  .link-row .link-cell:nth-child(4) { grid-column: 1; grid-row: 2; }
  .link-row .row-actions { grid-column: 2; grid-row: 1 / span 2; }
  .activity-table-wrap { overflow-x: auto; }
  .activity-table { min-width: 590px; }
  .field-row { grid-template-columns: 1fr; }
  .share-topbar { height: 64px; padding: 0 17px; }
  .share-secure span { display: none; }
  .share-content { width: calc(100% - 24px); margin: 25px auto; }
  .share-intro h1 { font-size: 24px; }
  .share-toolbar { align-items: flex-start; flex-direction: column; padding: 12px; }
  .share-toolbar-left { width: 100%; }
  .share-toolbar .search-box { width: 100%; max-width: none; }
  .share-actions { width: 100%; }
  .share-actions .button { flex: 1; }
  .share-table-head { grid-template-columns: minmax(0,1fr) 80px 92px; padding: 9px 11px; }
  .share-table-head span:nth-child(3) { display: none; }
  .share-row { grid-template-columns: minmax(0,1fr) 80px 92px; gap: 6px; padding: 10px 11px; }
  .share-row .file-cell:nth-child(3) { display: none; }
  .share-row .file-cell:nth-child(2) { text-align: right; }
  .share-lock-card { margin: 35px auto; padding: 22px; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: 96vh; }
  .modal-header, .modal-body { padding-left: 17px; padding-right: 17px; }
  .modal-footer { padding-left: 17px; padding-right: 17px; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-top { font-size: 9px; }
  .stat-icon { width: 27px; height: 27px; }
  .file-icon { width: 29px; height: 29px; }
  .file-main { gap: 7px; }
  .share-table-head, .share-row { grid-template-columns: minmax(0,1fr) 68px 80px; }
  .status-pill { padding: 4px 6px; font-size: 8px; }
}
