@font-face {
  font-family: Vazirmatn;
  src: url("/assets/vazirmatn.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  color: #172635;
  background: #f1f6f5;
  --surface: #fff;
  --line: #d9e5e2;
  --ink-muted: #455e68;
  --accent: #006a62;
  --accent-soft: #dff3ee;
  --danger: #943024;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.65; }
main, section, article, form, table, td, th, .cell-value { min-inline-size: 0; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #22867c; outline-offset: 3px;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0 0 14px; font-size: clamp(23px, 5vw, 31px); line-height: 1.4; }
h2, h3 { margin: 0; font-size: 16px; line-height: 1.6; }
small { color: var(--ink-muted); font-size: 13px; }
.skip-link { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 5; transform: translateY(-180%); padding: 8px 12px; background: var(--surface); }
.skip-link:focus { transform: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; min-inline-size: 0; min-height: 44px; padding: 7px 11px; font-size: 16px;
  border: 1px solid #b9cdce; border-radius: 9px; background: var(--surface);
}
button, .button, .pagination a, .segmented a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 7px 12px; border: 1px solid #b9cdce; border-radius: 9px; background: var(--surface);
  color: #172635; text-decoration: none; text-align: center; cursor: pointer;
}
.primary, .segmented a[aria-current] { color: #fff; background: var(--accent); border-color: var(--accent); }
.danger { color: var(--danger); border-color: #d8a097; background: #fff2ef; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner {
  margin: auto; max-width: 1360px; padding: 9px 12px; display: flex;
  align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.top-actions, .toolbar, .spread { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-actions { min-inline-size: 0; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 750; color: #172635; min-height: 44px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto;
  border-radius: 11px; background: var(--accent); color: #fff;
}
.portal-name { max-width: 11ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-muted); }
.layout, .portal-main { margin: 0 auto; padding: 14px 12px 28px; }
.layout { max-width: 1360px; display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; }
.portal-main { max-width: 1100px; }
.admin-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; gap: 5px; }
.admin-nav a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 5px 6px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: #344e55; text-decoration: none; text-align: center; font-size: 13px; overflow-wrap: anywhere;
}
.admin-nav a[aria-current] { color: #00584f; background: var(--accent-soft); border-color: #b9ded4; font-weight: 750; }
.metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.metrics section, .card, .empty, .login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
}
.metrics section { padding: 12px; height: 100%; }
.metrics h2 { font-size: 13px; font-weight: normal; color: var(--ink-muted); }
.metrics strong { display: block; font-size: 25px; line-height: 1.35; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics > a { color: inherit; text-decoration: none; min-inline-size: 0; }
.metrics > a:hover section { border-color: #6ea69f; }
.metrics strong.status-text { font-size: 15px; line-height: 1.6; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 9px; font-size: 12px; background: #eaf0ef; color: #365051; }
.good { color: #00594f; background: #daf2e9; }
.muted { color: #4b5360; background: #e8ebee; }
.table-wrap { min-inline-size: 0; }
.adaptive-table, .adaptive-table tbody { display: block; width: 100%; }
.adaptive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.adaptive-table tbody { display: grid; gap: 10px; }
.adaptive-table tbody tr { display: grid; padding: 6px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.adaptive-table td {
  display: grid; grid-template-columns: minmax(76px,6.4rem) minmax(0,1fr);
  gap: 8px; padding: 7px 0; border-bottom: 1px solid #eef2f1; overflow-wrap: anywhere;
}
.adaptive-table td:last-child { border-bottom: 0; }
.cell-label { color: var(--ink-muted); font-size: 12px; }
.cell-value small, .small-link { display: block; }
.small-link, .back-link { display: inline-flex; align-items: center; min-height: 44px; }
.action summary, .link-actions summary, .folder-tools summary, .create-share summary {
  min-height: 44px; padding: 8px 0; cursor: pointer; color: var(--accent); overflow-wrap: anywhere;
}
.action + .action { margin-top: 2px; }
.action form { min-inline-size: 0; }
.action form button { margin-top: 5px; }
.notice { background: var(--accent-soft); padding: 10px 12px; border-radius: 9px; }
.notice-error { background: #fff0ed; color: #8c241b; }
.empty, .card { padding: 14px; }
.card { margin-bottom: 12px; }
.card p:first-of-type { margin-top: 10px; }
.toolbar { margin: 0 0 12px; }
.toolbar p, .spread h2, .spread h3 { margin: 0; }
.spread { justify-content: space-between; margin: 5px 0; }
.spread a { overflow-wrap: anywhere; }
.muted-text { color: var(--ink-muted); }
.dashboard-grid, .settings-grid, .asset-grid, .link-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; align-items: start; }
.dashboard-grid { margin-top: 14px; }
.chart { display: grid; gap: 5px; margin-top: 12px; font-size: 13px; }
.chart-row { display: grid; grid-template-columns: 54px minmax(0,1fr) 42px; align-items: center; gap: 7px; }
.chart-row meter { width: 100%; accent-color: var(--accent); }
.form-inline, .form-stack, .portal-form, .portal-search { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
.form-inline label, .form-stack label, .portal-form label, .portal-search label { display: grid; gap: 4px; font-size: 14px; min-inline-size: 0; }
.form-stack .checkbox { display: flex; align-items: center; min-height: 44px; }
.form-stack .checkbox input, input.select-row { width: 24px; height: 24px; min-height: 0; accent-color: var(--accent); }
.row-select { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; cursor: pointer; }
#bulk-action, .section-title { margin-top: 14px; }
.pagination { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.announcement-form .toolbar { margin: 0; }
.announcement-form > p { margin-block: 0; }
.announcement-preview { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.announcement-excerpt { overflow-wrap: anywhere; }
.announcement-counts { margin-block: 12px; }
.support-list { list-style: none; padding: 0; margin: 12px 0; }
.support-item { display: block; color: inherit; text-decoration: none; }
.support-item:hover { border-color: var(--accent); }
.support-item p, .support-messages p { overflow-wrap: anywhere; margin-block: 8px; }
.support-messages p { white-space: pre-wrap; }
.support-messages .card { max-width: 46rem; margin-block-end: 8px; }
.support-messages .support-staff { margin-inline-start: clamp(8px, 8vw, 72px); background: var(--accent-soft); }
.support-messages .support-user { margin-inline-end: clamp(8px, 8vw, 72px); }
.segmented { display: flex; gap: 5px; }
.facts, .link-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.facts dt, .link-facts dt { font-size: 13px; color: var(--ink-muted); }
.facts dd, .link-facts dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.login-card { width: min(100%,410px); padding: 22px; }
.login-card h1 { margin: 12px 0 8px; }
.login-card p { color: var(--ink-muted); }
.portal-heading { display: grid; gap: 9px; margin-bottom: 13px; }
.portal-heading h1 { margin: 0; }
.portal-heading form button { width: 100%; }
.portal-search { margin-bottom: 13px; }
.edit-file { margin: 10px 0 0; }
.folder-tools summary { font-weight: 700; }
.folder-entry { padding: 6px 0; border-top: 1px solid var(--line); }
.folder-entry form + form { margin-top: 9px; }
.asset-grid { list-style: none; margin: 0; padding: 0; }
.asset-card {
  display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; min-height: 72px; gap: 9px;
  padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-decoration: none; color: #172635;
}
.asset-card:hover { border-color: #79aca2; }
.file-symbol { display: grid; place-items: center; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 21px; }
.asset-title { min-inline-size: 0; overflow-wrap: anywhere; }
.asset-title small { display: block; }
.link-facts { margin: 8px 0 14px; }
.link-facts > div:last-child { grid-column: 1 / -1; }
.copy-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.copy-row input { text-align: left; }
.copy-result:empty { display: none; }
.copy-result { font-size: 13px; display: block; margin: 5px 0; color: var(--ink-muted); }
.link-actions { display: grid; gap: 6px; margin-top: 10px; }
.link-actions form button { width: 100%; }
.create-share { margin-bottom: 12px; }
.create-share form { margin-top: 10px; }
.section-menu { min-inline-size: 0; align-self: start; }
.section-menu summary, .file-properties summary, .list-filters summary {
  min-height: 44px; padding: 9px 12px; cursor: pointer; color: var(--accent); font-weight: 650;
}
.section-menu summary { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.section-menu summary strong, .list-filters summary small { margin-inline-start: 10px; color: var(--ink-muted); }
.section-menu[open] .admin-nav { margin-block-start: 8px; }
.list-filters, .file-properties { padding: 3px 8px; }
.list-filters form, .file-properties form { margin: 8px; }
.bulk-selection, .search-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.bulk-selection { margin-block: 8px; }
.bulk-selection[hidden] { display: none; }
.bulk-selection label, .bulk-selection a, .search-actions a { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; }
.bulk-selection input { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
.share-card:target { outline: 2px solid var(--accent); scroll-margin-block: 12px; }
.copy-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
.copy-row input { grid-column: 1 / -1; }
.handoff { max-width: 560px; margin-inline: auto; }
.handoff .toolbar { margin-bottom: 0; }

@media (min-width: 560px) {
  .top-inner { padding-inline: 20px; }
  .layout, .portal-main { padding-inline: 20px; }
  .portal-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .form-inline, .portal-search { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; }
  .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-nav { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .portal-name { max-width: 22ch; }
}
@media (min-width: 760px) {
  .asset-grid, .link-grid, .dashboard-grid, .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portal-search { grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto; }
  .form-inline { grid-template-columns: repeat(auto-fit,minmax(125px,1fr)); }
  .facts { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1024px) {
  .section-menu[open] > summary { display: none; }
  .section-menu[open] .admin-nav { margin-block-start: 0; }
  .layout { grid-template-columns: 185px minmax(0,1fr); gap: 24px; }
  .admin-nav { grid-template-columns: minmax(0,1fr); }
  .admin-nav a { justify-content: flex-start; padding-inline: 12px; text-align: start; font-size: 14px; }
  .table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
  .adaptive-table { display: table; table-layout: fixed; border-collapse: collapse; }
  .adaptive-table thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  .adaptive-table tbody { display: table-row-group; }
  .adaptive-table thead tr, .adaptive-table tbody tr { display: table-row; padding: 0; border: 0; }
  .adaptive-table td, .adaptive-table th {
    display: table-cell; padding: 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top;
  }
  .adaptive-table td:last-child { border-bottom: 1px solid var(--line); }
  .adaptive-table th { background: #f5f9f8; font-size: 13px; color: #344c5a; }
  .adaptive-table tr:last-child td { border-bottom: 0; }
  .adaptive-table .cell-label { display: none; }
}
