:root {
  --ink: #18243b;
  --muted: #738097;
  --line: #e6ebf2;
  --primary: #245fdb;
  --surface: #f5f7fb;
  --sidebar: 256px;
  --bs-primary: #245fdb;
  --bs-body-font-family: Inter, 'Segoe UI', Arial, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-font-size: 1rem;
}
body {
  margin: 0;
  background: var(--surface);
  font-size: 1rem;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: #1247b1;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.055rem;
  margin: 6px 0 10px;
}
h2 {
  font-size: 1.12rem;
  font-weight: 650;
  margin: 0;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
.btn {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  white-space: nowrap;
}
.btn-sm {
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
}
.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: #194db9;
  --bs-btn-hover-border-color: #194db9;
  box-shadow: 0 3px 5px #245fdb12;
}
.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: #cad9f7;
  --bs-btn-hover-bg: var(--primary);
}
.btn-outline-secondary {
  --bs-btn-color: #516077;
  --bs-btn-border-color: #dce2ec;
}
.btn-light {
  --bs-btn-bg: #f1f4f9;
  --bs-btn-border-color: #e7ebf1;
}
.form-control,
.form-select {
  font-size: 1rem;
  border-color: #dce2eb;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
}
.form-control:focus,
.form-select:focus {
  border-color: #709aee;
  box-shadow: 0 0 0 3px #245fdb15;
}
.form-label {
  font-size: 0.9rem;
  font-weight: 600;
}
.form-text {
  font-size: 0.875rem;
  color: #768298;
  line-height: 1.6;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 30px 18px 20px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1030;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--ink);
  padding: 0 10px;
  margin-bottom: 43px;
}
.brand small {
  display: block;
  font-size: 0.6em;
  font-size: 10px;
  letter-spacing: 0.11em;
  font-weight: 600;
  color: #8390a5;
  margin-top: 4px;
}
.brand-mark {
  width: 40px;
  height: 43px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  letter-spacing: 0;
}
.workspace-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #93a0b4;
  margin: 0 14px 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #66738a;
  font-size: 0.9rem;
  font-weight: 550;
  text-align: left;
  margin: 3px 0;
}
.nav-item i {
  font-size: 1.1rem;
}
.nav-item:hover {
  background: #f3f6fc;
  color: var(--primary);
}
.nav-item.active {
  background: #eaf1ff;
  color: var(--primary);
  font-weight: 650;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 35px;
}
.secure-label {
  font-size: 0.75rem;
  color: #8b98ac;
  padding: 15px 10px;
  border-top: 1px solid var(--line);
  margin-bottom: 10px;
}
.secure-label i {
  color: #258d79;
  margin-right: 4px;
}
.main-shell {
  margin-left: var(--sidebar);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 84px;
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.topbar-title {
  color: #7c8799;
  font-size: 0.875rem;
}
.account {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
}
.account strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}
.account small {
  display: block;
  font-size: 0.75rem;
  color: #8692a5;
  margin-top: 3px;
}
.account > i {
  font-size: 0.75rem;
  margin-left: 12px;
  color: #8490a1;
}
.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eaf0fc;
  color: var(--primary);
  font-weight: 650;
}
.avatar-large {
  width: 66px;
  height: 66px;
  font-size: 1.6rem;
}
.menu-toggle {
  display: none;
}
.main-content {
  padding: 34px 38px;
  flex: 1;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0;
}
.section-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: #8190a7;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 3px 8px #192b4a02;
  display: flex;
  flex-direction: column;
}
.stat-card > span {
  color: #778397;
  font-size: 0.875rem;
  margin: 19px 0 5px;
}
.stat-card strong {
  font-size: 2rem;
  letter-spacing: -0.05em;
  line-height: 1.4;
}
.stat-card small {
  font-size: 0.8rem;
  color: #99a3b3;
  margin-top: 8px;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 1.3rem;
}
.blue {
  background: #edf3ff;
  color: #3c73e5;
}
.teal {
  background: #e8f7f2;
  color: #239b7b;
}
.purple {
  background: #f1edfd;
  color: #8867d5;
}
.amber {
  background: #fff4df;
  color: #d59929;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 3px 8px #192b4a02;
  min-width: 0;
}
.panel-heading {
  padding: 23px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-heading p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 7px 0 0;
}
.panel-heading > a {
  font-size: 0.875rem;
  white-space: nowrap;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 24px;
}
.table {
  margin-bottom: 0;
  --bs-table-color: #657189;
  --bs-table-border-color: #edf0f5;
  font-size: 0.875rem;
}
.table th {
  background: #fafbfd;
  padding: 14px 24px;
  font-weight: 550;
  color: #8b96a7;
  white-space: nowrap;
  font-size: 0.8rem;
}
.table td {
  padding: 18px 24px;
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table strong {
  color: #354057;
  font-weight: 600;
}
.table td:first-child {
  max-width: 400px;
  overflow-wrap: anywhere;
}
.file-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  min-width: 0;
}
.file-link small,
.person-cell small {
  display: block;
  color: #94a0b2;
  font-size: 0.8rem;
  margin-top: 4px;
}
.file-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  flex-shrink: 0;
  font-size: 1.5rem;
  color: #5685d3;
  background: #eff5ff;
  border-radius: 7px;
}
.folder-icon {
  color: #edb442;
  background: #fff8e9;
}
.pdf-icon {
  background: #fff0ef;
  color: #dc7772;
}
.activity-list {
  padding: 10px 24px 20px;
}
.activity {
  display: flex;
  gap: 14px;
  padding-top: 20px;
  position: relative;
}
.activity-dot {
  width: 9px;
  height: 9px;
  background: #6590e8;
  border: 3px solid #edf2fc;
  border-radius: 50%;
  box-sizing: content-box;
  margin-top: 4px;
  flex-shrink: 0;
}
.activity strong {
  font-size: 0.9rem;
  text-transform: capitalize;
  display: block;
}
.activity p {
  font-size: 0.8rem;
  color: #8190a3;
  margin: 5px 0;
}
.activity small {
  font-size: 0.75rem;
  color: #9aa5b5;
}
.empty-state {
  padding: 66px 24px;
  text-align: center;
  color: #8c98aa;
}
.empty-state > i {
  font-size: 2.7rem;
  color: #a9bbd8;
  display: block;
  margin-bottom: 18px;
}
.empty-state h2,
.empty-state h3 {
  font-size: 1.1rem;
  color: #52627b;
  margin-bottom: 12px;
}
.empty-state p {
  font-size: 0.9rem;
  margin: 0;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 38px;
  color: #98a3b4;
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.breadcrumb {
  font-size: 0.875rem;
  margin: 0 0 23px;
  flex-wrap: wrap;
  row-gap: 10px;
}
.breadcrumb a {
  color: #7e8ba0;
}
.breadcrumb li:last-child a {
  color: #36435b;
  font-weight: 600;
}
.explorer-toolbar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fafbfd;
  border-radius: 8px;
  padding: 6px 8px 6px 14px;
  max-width: 480px;
  width: 100%;
}
.search-form > i {
  color: #98a5b7;
}
.search-form input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 0.9rem;
  outline-offset: 0;
}
.type-label {
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  color: #8793a7;
  background: #f2f5fa;
  border-radius: 4px;
  padding: 4px 8px;
}
.action-button {
  padding: 4px 10px;
  color: #7d8da5;
}
.dropdown-item {
  font-size: 0.9rem;
  padding: 9px 18px;
}
.dropdown-menu {
  box-shadow: 0 10px 30px #14284d1a;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 10px;
}
.dropdown-item {
  border-radius: 5px;
}
.file-table {
  min-height: 260px;
}
.pagination-bar {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  color: #8b96a8;
  font-size: 0.8rem;
}
.pagination-bar nav {
  display: flex;
  gap: 8px;
}
.hint {
  font-size: 0.875rem;
  color: #8190a5;
  margin-bottom: 24px;
}
.upload-zone {
  background: #f7f9fe;
  border: 1px dashed #b8ccec;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
}
.upload-zone > i {
  font-size: 2.5rem;
  display: block;
  color: #6891df;
  margin-bottom: 16px;
}
.upload-status {
  font-size: 0.875rem;
  color: #557199;
}
.form-panel {
  padding: 28px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 24px;
}
.document-title {
  font-size: 1.65rem;
  word-break: break-word;
}
.document-preview {
  width: 100%;
  height: 620px;
  border: 0;
  border-radius: 0 0 12px 12px;
  background: #f1f3f7;
  display: block;
}
.image-preview {
  display: grid;
  place-items: center;
  padding: 24px;
  min-height: 400px;
  background: #f7f9fd;
}
.image-preview img {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
}
.metadata {
  margin-top: 24px;
}
.metadata dt {
  font-size: 0.8rem;
  color: #8b98ab;
  font-weight: 500;
  margin-bottom: 4px;
}
.metadata dd {
  font-size: 0.9rem;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}
.notice {
  display: flex;
  gap: 14px;
  background: #edf4ff;
  border: 1px solid #dae8ff;
  border-radius: 9px;
  padding: 18px 20px;
  font-size: 0.9rem;
  color: #5474a8;
  margin-bottom: 24px;
}
.notice p {
  margin: 8px 0 0;
}
.notice-danger {
  background: #fff4f1;
  border-color: #fbe1d9;
  color: #a46757;
}
.person-cell {
  display: flex;
  gap: 12px;
  align-items: center;
}
.role-badge {
  display: inline-block;
  padding: 6px 9px;
  background: #edf2fa;
  border: 1px solid #e2e9f4;
  border-radius: 6px;
  color: #6781a8;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.pending {
  background: #fff4dd;
  color: #b68627;
}
.approved {
  background: #e8f7ef;
  color: #288b61;
}
.rejected {
  background: #ffeded;
  color: #c46969;
}
.expired {
  background: #edf0f5;
  color: #8a93a3;
}
.cell-subtext {
  display: block;
  color: #94a0b2;
  margin-top: 5px;
  font-size: 0.8rem;
  max-width: 320px;
  overflow-wrap: anywhere;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.permission-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
}
.danger-panel {
  border-color: #f3d9d9;
}
.narrow-panel {
  max-width: 760px;
}
.preserve-lines {
  white-space: pre-wrap;
}
.audit-action {
  font-size: 0.75rem;
  font-weight: 650;
  color: #58749c;
  background: #f0f4fa;
  padding: 5px 7px;
  border-radius: 4px;
}
.error-panel {
  max-width: 760px;
  margin: 60px auto;
  padding: 40px;
}
.error-code {
  font-size: 5rem;
  font-weight: 750;
  color: var(--primary);
  letter-spacing: -0.08em;
}
.error-panel h1 {
  font-size: 1.5rem;
}
.error-panel .btn {
  margin: 20px 8px 0 0;
}
.auth-main {
  min-height: 100vh;
}
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-story {
  background: #142d56;
  padding: 56px 68px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}
.login-story .brand {
  color: #fff;
  padding: 0;
}
.login-story .brand small {
  color: #95b1d8;
}
.login-story .brand-mark {
  background: #386ce0;
}
.login-story h1 {
  font-size: 3.5rem;
  font-weight: 650;
  letter-spacing: -0.12rem;
  line-height: 1.2;
  margin: 22px 0;
}
.login-story p {
  color: #a8bedb;
  max-width: 380px;
  line-height: 1.9;
  font-size: 1rem;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #89b1f3;
}
.login-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 40px 0;
  color: #c6d6eb;
  font-size: 0.95rem;
}
.login-features i {
  margin-right: 10px;
  color: #81a8f0;
}
.login-story > small {
  font-size: 0.75rem;
  color: #6f8ab3;
  letter-spacing: 0.15em;
}
.login-form-wrap {
  display: grid;
  place-items: center;
  padding: 56px;
  background: #fff;
}
.login-form {
  max-width: 390px;
  width: 100%;
}
.login-form h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  margin: 16px 0;
}
.login-help {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin: 30px 0 0;
  color: #8a97aa;
  font-size: 0.85rem;
}
.modal-header,
.modal-footer {
  border-color: var(--line);
  padding: 20px 24px;
}
.modal-body {
  padding: 24px;
}
.modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 60px #152b4826;
}
@media (min-width: 1600px) {
  .main-content {
    padding: 40px 56px;
  }
  .topbar {
    padding: 0 56px;
  }
  .stat-card {
    padding: 28px;
  }
}
@media (max-width: 1200px) {
  :root {
    --sidebar: 228px;
  }
  .main-content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .stat-grid {
    gap: 12px;
  }
  .stat-card {
    padding: 18px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr);
  }
  .role-grid {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 44px;
  }
  .login-story h1 {
    font-size: 2.8rem;
  }
  .table td,
  .table th {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 256px;
    box-shadow: 12px 0 32px #142d5615;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-shell {
    margin-left: 0;
  }
  .menu-toggle {
    display: block;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 36px;
  }
  .login-form-wrap {
    padding: 36px;
  }
  .login-story h1 {
    font-size: 2.4rem;
  }
  .document-preview {
    height: 520px;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 70px;
    padding: 0 18px;
  }
  .topbar-title {
    display: none;
  }
  .account > i {
    display: none;
  }
  .main-content {
    padding: 26px 18px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  h1 {
    font-size: 1.75rem;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-card strong {
    font-size: 1.7rem;
  }
  .stat-card small {
    font-size: 0.75rem;
  }
  .stat-card > span {
    margin-top: 14px;
  }
  .panel-heading,
  .explorer-toolbar {
    padding: 18px;
  }
  .explorer-toolbar {
    flex-wrap: wrap;
    gap: 14px;
  }
  .pagination-bar {
    padding: 16px;
    flex-wrap: wrap;
  }
  .form-panel {
    padding: 22px;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 28px;
    min-height: 210px;
  }
  .login-story .brand {
    margin-bottom: 22px;
  }
  .login-story h1 {
    font-size: 2rem;
    margin: 10px 0;
  }
  .login-story p,
  .login-features,
  .login-story > small,
  .eyebrow {
    display: none;
  }
  .login-form-wrap {
    padding: 38px 28px;
  }
  .app-footer {
    padding: 20px 18px;
    gap: 20px;
  }
  .app-footer span {
    letter-spacing: 0;
  }
  .document-preview {
    height: 420px;
  }
  .error-panel {
    padding: 24px;
    margin: 30px auto;
  }
  .table-responsive {
    overflow-x: auto;
  }
  .notice {
    padding: 16px;
  }
  .account strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.folder-tree-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
  padding: 14px 18px;
  font-size: 0.9rem;
}
.folder-tree-panel summary {
  color: #5d7295;
  cursor: pointer;
}
.folder-tree-content {
  padding-top: 14px;
}
.tree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.tree-children {
  margin-left: 24px;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.tree-status {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 12px;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
