/* Loaded only for the workspace; the login page retains its original styling. */
:root {
  --blue: #2563eb;
  --border: #e3e9f2;
  --muted: #64748b;
  --page-bg: #f6f8fc;
  --sidebar-bg: #eef4ff;
  --surface: #fff;
  --radius: 12px;
  --shadow: 0 8px 28px #223c6810, 0 2px 6px #223c6806;
  --space: 16px;
  color: #243247;
  background: var(--page-bg);
}
button, input { border-radius: 8px; }
button { min-height: 38px; transition: background-color .15s, border-color .15s; }
button:hover { background: #f1f6ff; }
.primary { box-shadow: 0 2px 4px #2563eb20; }
.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.workspace { height: 100vh; height: 100dvh; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { background: var(--sidebar-bg); padding: 28px 14px; display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 10px 32px; }
.brand-mark { border-radius: 10px; }
.sidebar .nav { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: #526581; border-radius: 9px; }
.sidebar .nav span { width: 20px; text-align: center; font-size: 20px; line-height: 1; }
.sidebar .nav:hover { background: #e3edff; color: var(--blue); }
.sidebar .nav.active { background: #dce9ff; color: #1d4ed8; font-weight: 600; }
.sidebar-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 28px; }
.stat { background: #ffffff80; border-color: #dfe8f6; border-radius: 9px; padding: 12px; margin: 0; }
.stat strong { font-size: 18px; font-weight: 600; color: #526581; }
.main-panel { padding: 28px; gap: 20px; }
.topbar { margin: 0; min-width: 0; }
.topbar h1 { font-size: 26px; letter-spacing: -.6px; }
.topbar p { font-size: 13px; }
.account { position: relative; min-width: 0; flex-shrink: 0; }
.account-toggle { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; background: var(--surface); border-color: var(--border); }
.account-toggle strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.user-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: #e5edff; color: #1d4ed8; font-weight: 700; }
.account-chevron { color: var(--muted); transition: transform .15s; }
.account-toggle[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: 270px; max-width: calc(100vw - 28px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: 0 12px 36px #223c6826; text-align: left; }
.account-info { padding: 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-wrap: anywhere; }
.account-info strong { display: block; }
.account-info small { line-height: 1.5; }
.account-menu button { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: 10px 12px; }
.account-menu button:hover { background: #f1f6ff; }
.account-menu .danger:hover { background: #fff1f0; color: #b42318; }
.file-manager { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.toolbar { margin: 0; padding: 20px; border-bottom: 1px solid var(--border); gap: var(--space); }
.tools { align-items: center; min-width: 0; }
.tools input { width: 220px; background: #f8faff; border-radius: 8px; }
.refresh { background: white; border-color: var(--border); font-size: 18px; padding: 6px 12px; }
#breadcrumbs { gap: 4px; }
#breadcrumbs button { min-height: 32px; text-align: left; }
#breadcrumbs button:last-child { color: #243247; font-weight: 600; }
#breadcrumbs button:hover { color: var(--blue); background: #f1f6ff; }
#breadcrumbs > span { color: #a3b1c5; }
.file-content { border: 0; border-radius: 0 0 var(--radius) var(--radius); min-height: 180px; overscroll-behavior: contain; }
table { table-layout: fixed; }
th { background: #f8faff; font-weight: 600; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; }
th, td { padding: 16px; border-bottom-color: #edf1f7; }
th:first-child { width: 38%; }
th:nth-child(2) { width: 11%; }
th:nth-child(3) { width: 11%; }
th:nth-child(4) { width: 18%; }
th:last-child { width: 22%; }
td { overflow-wrap: anywhere; font-size: 13px; }
tbody tr:hover { background: #f5f8ff; }
.file-name { width: 100%; min-width: 0; min-height: 32px; gap: 10px; }
.file-name > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name:hover { background: transparent; }
.type-icon { border-radius: 8px; width: 32px; height: 32px; }
.actions { flex-wrap: wrap; gap: 5px; }
.actions button, .actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; border-radius: 6px; padding: 6px 8px; font-size: 11px; }
.actions a:hover { color: var(--blue); border-color: var(--blue); }
.actions .danger:hover { background: #fff1f0; border-color: #f4c5c0; }
.list-status { padding: 20px; font-size: 13px; overflow-wrap: anywhere; }
.list-status[data-state="empty"], .list-status[data-state="error"] { padding: 48px 20px; }
.list-status[data-state="loading"]::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid #dce9ff; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.upload-panel { background: var(--surface); border-radius: var(--radius); margin: 0; padding: 14px 18px; box-shadow: var(--shadow); flex-shrink: 0; }
.upload-panel summary { cursor: pointer; font-weight: 600; padding: 2px; }
.upload-panel summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.upload-item { border-top: 1px solid #edf1f7; padding-top: 12px; }
dialog { border-radius: var(--radius); color: #243247; box-shadow: 0 24px 80px #223c6833; max-height: calc(100dvh - 32px); overflow-y: auto; }
dialog::backdrop { background: #172b4d66; }
dialog p { line-height: 1.6; }
.toast { border-radius: 10px; box-shadow: var(--shadow); }
@media (max-width: 1200px) {
  .toolbar { align-items: stretch; flex-direction: column; }
  .tools input { flex: 1; width: auto; min-width: 120px; }
  th:first-child { width: 33%; }
  th:last-child { width: 27%; }
}
@media (max-width: 760px) {
  .workspace { height: auto; min-height: 100dvh; grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; padding: 12px 14px; gap: 6px; }
  .sidebar .brand { margin: 0 auto 0 0; gap: 8px; }
  .sidebar .brand p { display: none; }
  .sidebar .nav { width: auto; padding: 10px; gap: 6px; margin: 0; font-size: 12px; }
  .sidebar-stats { display: none; }
  .main-panel { padding: 20px 14px; gap: 18px; }
  .topbar { align-items: center; gap: 8px; }
  .topbar h1 { font-size: 23px; }
  .account { display: block; }
  .account-toggle { gap: 6px; }
  .account-toggle strong { max-width: 100px; }
  .toolbar { padding: 14px; }
  .tools { gap: 8px; }
  .tools input { flex: 1 0 100%; width: 100%; }
  .file-manager { min-height: 300px; flex: none; }
  .file-content { max-height: 65vh; }
  th, td { padding: 12px 10px; }
  th:first-child { width: 46%; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  th:nth-child(3) { width: 18%; }
  th:last-child { width: 36%; }
  .file-name { gap: 7px; }
  .type-icon { width: 26px; height: 28px; }
  .upload-panel { max-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
