:root {
  --dossier-green: #21493f;
  --dossier-green-2: #2f6658;
  --dossier-cream: #f2f2ed;
  --dossier-paper: #fffefa;
  --dossier-ink: #17211e;
  --dossier-muted: #6a706c;
  --dossier-line: #deddd3;
  --dossier-gold: #c99a42;
  --approved: #e3f1e9;
  --approved-text: #185f45;
  --pending: #f6ead2;
  --pending-text: #9a641e;
  --revision: #f3ddd7;
  --revision-text: #a34336;
}

.dossier-theme { color: var(--dossier-ink); background: var(--dossier-cream); font-family: "DM Sans", sans-serif; }
.dossier-theme h1, .dossier-theme h2, .dossier-theme h3, .dossier-brand, .workspace-brand, .mobile-dossier-brand, .stats-grid strong { font-family: "DM Serif Display", serif; font-weight: 400; }
.dossier-theme .eyebrow { color: var(--dossier-green-2); }
.dossier-theme .eyebrow--light { color: #b9d3c8; }

.dossier-login { background: var(--dossier-cream); }
.dossier-login .login-brand { background: var(--dossier-green); }
.dossier-login .login-brand::before { width: 360px; height: 360px; right: -170px; top: auto; bottom: -80px; border-color: rgba(255,255,255,.14); box-shadow: 0 0 0 65px rgba(255,255,255,.025); }
.dossier-login .login-panel { background: var(--dossier-paper); }
.dossier-brand, .mobile-dossier-brand { font-size: 24px; color: white; }
.mobile-dossier-brand { display: none; color: var(--dossier-green); }
.dossier-login .login-copy h1 { max-width: 530px; font-size: clamp(38px, 4vw, 61px); line-height: 1.08; letter-spacing: -.025em; }
.dossier-login .login-copy h1 em { color: inherit; }
.dossier-login .login-proof { display: block; color: rgba(255,255,255,.72); border-top: 0; font-size: 12px; }
.dossier-login .login-card h2 { font-size: 38px; }
.dossier-login .field input, .dossier-login .field select, .dossier-modal .field input, .dossier-modal .field select, .dossier-modal .field textarea { border-color: var(--dossier-line); border-radius: 3px; background: var(--dossier-paper); }
.login-role-switch { display: grid; margin: -8px 0 22px; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 8px; background: #ecece5; }
.login-role-switch button { height: 38px; border: 0; border-radius: 6px; color: var(--dossier-muted); background: transparent; font-size: 12px; font-weight: 700; }
.login-role-switch button.is-active { color: white; background: var(--dossier-green); box-shadow: 0 3px 10px rgba(31,73,62,.2); }
.dossier-button { color: white; background: var(--dossier-green-2); border-radius: 3px; box-shadow: none; }
.dossier-button:hover { background: var(--dossier-green); }
.dossier-login .demo-note { border-color: var(--dossier-line); border-radius: 3px; background: #f7f7f2; }
.forgot-copy { margin: 18px 0 0; color: var(--dossier-muted); font-size: 11px; }
.dossier-theme .text-button { color: var(--dossier-green-2); }

.workspace-shell { min-height: 100vh; padding-left: 250px; }
.workspace-sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 250px; flex-direction: column; color: white; background: var(--dossier-green); }
.workspace-brand { height: 78px; padding: 27px 26px; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 21px; }
.workspace-sidebar nav { display: flex; padding: 24px 0; flex-direction: column; }
.nav-section-label { margin: 10px 26px 8px; color: #9fc4b5; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.workspace-nav { position: relative; min-height: 43px; padding: 0 24px 0 38px; border: 0; color: rgba(255,255,255,.78); background: transparent; text-align: left; font-size: 12px; }
.workspace-nav::before { content: ""; position: absolute; left: 25px; top: 19px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.45); }
.workspace-nav:hover, .workspace-nav.is-active { color: white; background: rgba(255,255,255,.09); }
.workspace-nav.is-active { font-weight: 700; }
.workspace-nav.is-active::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--dossier-gold); }
.workspace-nav b { display: inline-grid; min-width: 20px; height: 20px; margin-left: 7px; padding: 0 5px; place-items: center; border-radius: 999px; color: var(--dossier-green); background: #eac273; font-size: 9px; }
.workspace-user { display: flex; margin-top: auto; min-height: 76px; padding: 16px 18px; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.workspace-user > span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-user strong, .workspace-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-user strong { font-size: 11px; }
.workspace-user small { margin-top: 3px; color: rgba(255,255,255,.55); font-size: 9px; }
.workspace-user .avatar { background: #e5b85d; color: var(--dossier-green); }
.workspace-user .icon-button { color: rgba(255,255,255,.6); }
.workspace-user .icon-button:hover { color: white; background: rgba(255,255,255,.08); }
.workspace-mobile-header { display: none; }
.workspace-main { min-height: 100vh; padding: 34px clamp(24px, 4vw, 58px) 70px; background: var(--dossier-paper); }
.workspace-main > section { max-width: 1220px; margin: 0 auto; }
.admin-page { display: none; animation: dossierFade .22s ease; }
.admin-page.is-active { display: block; }
@keyframes dossierFade { from { opacity: 0; transform: translateY(4px); } }
.workspace-page-header { display: flex; margin-bottom: 25px; align-items: flex-end; justify-content: space-between; gap: 20px; }
.workspace-page-header h1 { margin: 0 0 3px; font-size: clamp(29px, 3vw, 40px); line-height: 1.1; }
.workspace-page-header p { margin: 0; color: var(--dossier-muted); font-size: 12px; }
.workspace-page-header .eyebrow { margin-bottom: 8px; }
.header-actions { display: flex; align-items: center; gap: 9px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stats-grid article { min-height: 102px; padding: 20px; border: 1px solid var(--dossier-line); border-radius: 4px; background: white; }
.stats-grid strong, .stats-grid span { display: block; }
.stats-grid strong { margin-bottom: 5px; font-size: 31px; line-height: 1; }
.stats-grid span { color: var(--dossier-muted); font-size: 10px; }
.admin-filters { display: grid; margin-bottom: 20px; grid-template-columns: minmax(250px, 1fr) 180px 160px; gap: 10px; }
.dossier-search { display: flex; height: 44px; padding: 0 12px; align-items: center; gap: 9px; border: 1px solid var(--dossier-line); border-radius: 3px; background: white; }
.dossier-search svg { width: 17px; color: #878b87; }
.dossier-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.admin-filters select { height: 44px; padding: 0 11px; border: 1px solid var(--dossier-line); border-radius: 3px; outline: 0; background: white; font-size: 11px; }
.table-card { overflow: hidden; border-bottom: 1px solid var(--dossier-line); }
.admin-table-head, .admin-document-row { display: grid; grid-template-columns: minmax(210px, 1.5fr) minmax(145px, .95fr) 90px 82px 116px 118px; align-items: center; gap: 12px; }
.admin-table-head, .access-table-head { min-height: 44px; padding: 0 12px; color: #48564f; border-bottom: 1px solid var(--dossier-line); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.admin-document-row { min-height: 69px; padding: 10px 12px; border-bottom: 1px solid var(--dossier-line); background: var(--dossier-paper); }
.admin-document-row:hover { background: #fafaf5; }
.file-cell { display: flex; min-width: 0; align-items: center; gap: 10px; }
.file-cell .file-icon { border-radius: 3px; color: #b47725; background: #f4e7cf; }
.file-cell strong, .file-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-cell strong { font-size: 11px; }
.file-cell small { margin-top: 2px; color: var(--dossier-muted); font-size: 9px; }
.company-chip { display: inline-flex; width: fit-content; max-width: 100%; padding: 6px 10px; overflow: hidden; border: 1px solid var(--dossier-line); border-radius: 999px; color: var(--dossier-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.table-text { color: #313d38; font-size: 10px; }
.document-status { display: inline-flex; width: fit-content; min-height: 24px; padding: 0 10px; align-items: center; border-radius: 999px; font-size: 9px; }
.document-status.approved { color: var(--approved-text); background: var(--approved); }
.document-status.pending { color: var(--pending-text); background: var(--pending); }
.document-status.revision { color: var(--revision-text); background: var(--revision); }
.table-actions { display: flex; justify-content: flex-end; gap: 4px; }
.table-action { padding: 6px; border: 0; color: var(--dossier-green); background: transparent; font-size: 10px; font-weight: 700; }
.table-action:hover { text-decoration: underline; }
.empty-state { padding: 55px 20px; text-align: center; color: var(--dossier-muted); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--dossier-ink); }

.entity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.entity-card { padding: 19px; border: 1px solid var(--dossier-line); border-radius: 4px; background: white; }
.entity-card header { display: flex; margin-bottom: 15px; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entity-card h3 { margin: 0 0 4px; font-family: "DM Sans", sans-serif; font-size: 13px; font-weight: 700; }
.entity-card p { margin: 0; color: var(--dossier-muted); font-size: 9px; }
.entity-card dl { margin: 0; }
.entity-card dl div { display: flex; padding: 8px 0; justify-content: space-between; gap: 10px; border-top: 1px solid #ecebe4; font-size: 9px; }
.entity-card dt { color: var(--dossier-muted); }
.entity-card dd { margin: 0; text-align: right; }
.entity-card footer { display: flex; margin-top: 12px; padding-top: 12px; justify-content: flex-end; border-top: 1px solid #ecebe4; }
.entity-delete-button { padding: 6px 0; border: 0; color: var(--revision-text); background: transparent; font-size: 9px; font-weight: 700; }
.entity-delete-button:hover { text-decoration: underline; }
.active-pill { padding: 5px 8px; border-radius: 999px; color: var(--approved-text); background: var(--approved); font-size: 8px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.review-card { padding: 19px; border: 1px solid var(--dossier-line); border-left: 3px solid var(--dossier-gold); border-radius: 3px; background: white; }
.review-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.review-card h3 { margin: 0 0 5px; font-family: "DM Sans", sans-serif; font-size: 13px; }
.review-card p { margin: 0; color: var(--dossier-muted); font-size: 10px; }
.review-card footer { display: flex; margin-top: 17px; padding-top: 14px; align-items: center; justify-content: space-between; border-top: 1px solid #ecebe4; }
.review-card footer span { color: var(--dossier-muted); font-size: 9px; }
.entity-empty { grid-column: 1 / -1; width: 100%; border: 1px dashed var(--dossier-line); border-radius: 4px; background: #fbfbf7; }
.internal-notice { display: flex; margin-bottom: 20px; padding: 15px 17px; align-items: center; gap: 12px; border: 1px solid #cfded7; border-radius: 4px; color: var(--dossier-green); background: #f1f7f4; }
.internal-notice svg { flex: 0 0 auto; }
.internal-notice strong, .internal-notice small { display: block; }
.internal-notice strong { font-size: 11px; }
.internal-notice small { margin-top: 3px; color: var(--dossier-muted); font-size: 9px; }
.internal-filters { grid-template-columns: minmax(260px, 1fr) 210px; }
.internal-document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.internal-document-card { padding: 18px; border: 1px solid var(--dossier-line); border-radius: 4px; background: white; }
.internal-document-card dl { margin: 16px 0 0; }
.internal-document-card dl div { display: flex; padding: 7px 0; justify-content: space-between; gap: 10px; border-top: 1px solid #ecebe4; font-size: 9px; }
.internal-document-card dt { color: var(--dossier-muted); }
.internal-document-card dd { margin: 0; text-align: right; }
.internal-document-card footer { display: flex; margin-top: 12px; padding-top: 10px; justify-content: flex-end; border-top: 1px solid #ecebe4; }
.danger-action { color: #a34336; }
.security-note { margin: -7px 0 17px; padding: 9px 10px; color: var(--dossier-muted); background: #f4f4ef; font-size: 9px; line-height: 1.45; }
.folder-editor-list { display: flex; margin-bottom: 10px; flex-direction: column; gap: 8px; }
.folder-editor-row { display: grid; grid-template-columns: 34px 1fr 36px; align-items: center; gap: 8px; }
.folder-editor-row > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 4px; color: var(--pending-text); background: var(--pending); }
.folder-editor-row > span svg { width: 17px; }
.folder-editor-row input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--dossier-line); border-radius: 3px; outline: 0; }
.folder-editor-row input:focus { border-color: var(--dossier-green-2); box-shadow: 0 0 0 3px rgba(47,102,88,.1); }
.folder-remove-button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 4px; color: var(--revision-text); background: transparent; }
.folder-remove-button:hover { background: var(--revision); }
.folder-remove-button svg { width: 16px; }
.add-folder-button { width: 100%; min-height: 40px; margin-bottom: 13px; border: 1px dashed #c9c9bc; border-radius: 3px; color: var(--dossier-green-2); background: #fafaf6; font-weight: 700; font-size: 10px; }
.add-folder-button:hover { border-color: var(--dossier-green-2); background: #f6faf7; }
.delete-modal-icon { display: grid; width: 42px; height: 42px; margin-bottom: 15px; place-items: center; border-radius: 50%; color: var(--revision-text); background: var(--revision); }
.delete-modal-icon svg { width: 19px; }
.delete-warning { display: flex; margin: 8px 0 21px; padding: 13px 14px; flex-direction: column; gap: 5px; border-left: 3px solid #bd594d; color: var(--revision-text); background: #faf0ed; font-size: 10px; line-height: 1.45; }
.delete-warning span { color: #79554f; }
.delete-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; }
.button--danger { color: white; background: #ad4037; box-shadow: none; }
.button--danger:hover { background: #92352e; }
.access-table-head, .access-row { display: grid; grid-template-columns: 1.4fr .7fr .8fr .6fr; align-items: center; gap: 14px; }
.access-row { min-height: 64px; padding: 10px 12px; border-bottom: 1px solid var(--dossier-line); font-size: 10px; }
.access-user strong, .access-user small { display: block; }
.access-user small { margin-top: 3px; color: var(--dossier-muted); font-size: 9px; }
.access-toggle { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; font-size: 9px; }
.access-toggle i { width: 29px; height: 17px; padding: 2px; border-radius: 999px; background: #c9cec9; transition: .2s ease; }
.access-toggle i::before { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: white; transition: .2s ease; }
.access-toggle.is-active i { background: var(--dossier-green-2); }
.access-toggle.is-active i::before { transform: translateX(12px); }

.client-documents-page { max-width: 1040px !important; }
.client-dropzone { display: flex; width: 100%; min-height: 185px; margin-bottom: 27px; padding: 26px; align-items: center; justify-content: center; flex-direction: column; border: 1px dashed #cecdbf; border-radius: 3px; color: var(--dossier-ink); background: white; }
.client-dropzone:hover { border-color: var(--dossier-green-2); background: #fbfcf9; }
.client-dropzone svg { width: 27px; height: 27px; margin-bottom: 10px; color: var(--dossier-green-2); }
.client-dropzone strong { font-family: "DM Serif Display", serif; font-size: 18px; font-weight: 400; }
.client-dropzone span { margin: 7px 0 14px; color: var(--dossier-muted); font-size: 10px; }
.client-dropzone b { padding: 9px 14px; border-radius: 3px; color: white; background: var(--dossier-green-2); font-size: 10px; }
.client-list-head, .client-document-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) 140px 130px 105px; align-items: center; gap: 12px; }
.client-list-head { min-height: 42px; padding: 0 12px; border-bottom: 1px solid var(--dossier-line); color: #48564f; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.client-document-row { min-height: 65px; padding: 10px 12px; border-bottom: 1px solid var(--dossier-line); }

.dossier-modal { border-radius: 5px; }
.dossier-modal h2 { font-family: "DM Serif Display", serif; font-weight: 400; }
.brand-shortcut { position: fixed; z-index: 25; right: 18px; bottom: 18px; display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--dossier-green); box-shadow: 0 8px 25px rgba(18,46,39,.22); }
.brand-shortcut svg { width: 18px; }
.dossier-theme .toast { background: var(--dossier-green); }

@media (max-width: 1050px) {
  .workspace-shell { padding-left: 220px; }
  .workspace-sidebar { width: 220px; }
  .admin-table-head, .admin-document-row { grid-template-columns: minmax(190px,1.4fr) minmax(130px,.9fr) 80px 75px 105px 100px; gap: 8px; }
  .entity-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .internal-document-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .workspace-shell { padding-left: 0; }
  .workspace-sidebar { width: min(82vw, 280px); transform: translateX(-103%); transition: .24s ease; box-shadow: 10px 0 30px rgba(15,35,29,.17); }
  .workspace-sidebar.is-open { transform: translateX(0); }
  .workspace-mobile-header { position: sticky; z-index: 20; top: 0; display: flex; height: 61px; padding: 0 14px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--dossier-line); background: rgba(255,254,250,.95); backdrop-filter: blur(12px); }
  .workspace-mobile-header strong { color: var(--dossier-green); font-family: "DM Serif Display", serif; font-size: 18px; font-weight: 400; }
  .workspace-main { padding: 27px 16px 65px; }
  .workspace-page-header { align-items: flex-start; }
  .header-actions { align-items: stretch; flex-direction: column-reverse; }
  .workspace-page-header .button { min-width: 45px; padding-inline: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-filters { grid-template-columns: 1fr 1fr; }
  .dossier-search { grid-column: 1 / -1; }
  .table-card { overflow-x: auto; }
  .admin-table-head, .admin-document-row { min-width: 800px; }
}

@media (max-width: 760px) {
  .dossier-login .login-panel { justify-content: flex-start; }
  .mobile-dossier-brand { display: block; width: 100%; }
  .dossier-login .login-card { margin-top: 50px; }
  .workspace-page-header h1 { font-size: 30px; }
  .workspace-page-header p { max-width: 260px; line-height: 1.45; }
  .entity-grid, .review-grid, .internal-document-grid { grid-template-columns: 1fr; }
  .client-list-head { display: none; }
  .client-document-row { position: relative; grid-template-columns: 1fr auto; min-height: 92px; padding: 15px 5px; }
  .client-document-row .table-text:nth-child(2) { grid-column: 1; padding-left: 48px; }
  .client-document-row .document-status { grid-column: 2; grid-row: 1; }
  .client-document-row .table-actions { grid-column: 2; grid-row: 2; }
}

@media (max-width: 480px) {
  .stats-grid { gap: 8px; }
  .stats-grid article { min-height: 88px; padding: 15px; }
  .stats-grid strong { font-size: 27px; }
  .admin-filters { display: flex; flex-direction: column; }
  .client-dropzone { min-height: 175px; padding: 20px 14px; text-align: center; }
  .client-dropzone span { line-height: 1.5; }
  .workspace-page-header .button { font-size: 0; }
  .workspace-page-header .button::first-letter { font-size: 13px; }
  .brand-shortcut { bottom: 12px; right: 12px; }
}
