/* Étuv’Âge — portal refinements. Shared tokens, accessible controls and compact layouts. */
:root {
  color-scheme: dark;
  --bg: #121310;
  --bg-subtle: #151612;
  --panel: #1a1c17;
  --card: #20221c;
  --card-hover: #272a22;
  --accent: #d8b77c;
  --accent-strong: #edce96;
  --text: #f4f1e8;
  --text-secondary: #d7d6cb;
  --muted: #b0b2a5;
  --border: #34382d;
  --border-light: #505545;
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-glow: none;
}
html { scroll-padding-top: 100px; }
body { font-size: 16px; }
body::before { display: none; }
[hidden] { display: none !important; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-strong); outline-offset: 4px; box-shadow: none;
}
.sr-only, .honeypot { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 1000; padding: 12px 18px; background: var(--accent); color: var(--bg); transform: translateY(-150%); border-radius: 6px; }
.skip-link:focus { transform: translateY(0); color: var(--bg); }
.topbar { height: auto; min-height: 84px; padding: 16px clamp(20px, 4vw, 64px); background: var(--bg); backdrop-filter: none; gap: 16px; }
.brand { gap: 12px; }
.brand-mark { width: 42px; height: 42px; filter: none; }
.brand-name { font-size: 23px; letter-spacing: -.4px; }
.brand-sub { font-size: 12px; letter-spacing: .6px; text-transform: none; }
.lang-switch { margin: 0 0 0 auto; gap: 0; padding: 3px; border: 1px solid var(--border); border-radius: 8px; }
.lang-switch a { min-width: 42px; min-height: 38px; border: 0; border-radius: 5px; display: grid; place-items: center; padding: 4px 8px; font-size: 13px; }
.lang-switch a.active { background: var(--card); color: var(--accent); }
.nav { margin-left: auto; }
.nav form, .actions form, .dashboard-header form { margin: 0; }
.nav-link { font-family: inherit; background: transparent; min-height: 40px; font-size: 14px; box-shadow: none; }
.page { width: min(1200px, 100%); padding: 36px 32px 64px; margin: 0 auto; }
.page:focus { outline: none; }
.section { background: var(--panel); padding: 28px; border-color: var(--border); box-shadow: none; margin-bottom: 20px; animation: none; }
.hero { background: none; padding: 16px 0 24px; border: 0; border-radius: 0; box-shadow: none; animation: none; }
.hero::before, .hero::after { display: none; }
.hero p { max-width: 65ch; }
h1 { font-size: clamp(28px, 3.2vw, 42px); letter-spacing: -.6px; }
h2 { font-size: 24px; letter-spacing: -.25px; }
h3 { font-size: 20px; }
p { line-height: 1.65; }
.text-sm, .text-xs { font-size: 14px; }
label { color: var(--text-secondary); font-size: 14px; font-weight: 400; letter-spacing: 0; }
input[type='text'], input[type='password'], input[type='email'], input[type='tel'], input[type='datetime-local'], input[type='number'], input[type='search'], select, textarea { font-size: 16px; min-height: 48px; border-color: var(--border-light); background: var(--bg-subtle); }
input::placeholder, textarea::placeholder { color: #929889; opacity: 1; }
input[type='checkbox'] { accent-color: var(--accent); width: 20px; height: 20px; min-height: 20px; flex-shrink: 0; }
.btn, button { font-size: 16px; min-height: 48px; font-family: 'Formata Regular', Arial, sans-serif; letter-spacing: 0; background: var(--accent); color: #181a13; box-shadow: none; }
.btn:hover, button:hover { background: var(--accent-strong); box-shadow: none; transform: none; }
.btn.secondary, button.secondary { background: transparent; border: 1px solid var(--border-light); color: var(--text); }
.btn.secondary:hover, button.secondary:hover { background: var(--card-hover); border-color: var(--muted); }
.btn.small, button.small { min-height: 40px; font-size: 14px; padding: 8px 12px; }
button.danger, .btn.danger { color: #ffaaa4; background: #39241f; border: 1px solid #78473f; }
button:disabled { opacity: .45; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badge { font-size: 13px; padding: 4px 9px; }
.alert { animation: none; font-size: 15px; }
.footer { flex-wrap: wrap; padding: 24px; gap: 8px 14px; font-size: 13px; background: var(--bg); }
.footer a { font-size: 13px !important; }
.footer-version { font-size: 12px; }
.eyebrow { color: var(--accent); font-size: 12px; font-family: 'Formata Bold', Arial, sans-serif; letter-spacing: 1.6px; text-transform: uppercase; }
.portal-entry { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; min-height: min(680px, calc(100svh - 250px)); padding: 24px 0; }
.entry-intro h1 { font-size: clamp(40px, 4.7vw, 66px); line-height: 1.08; margin: 25px 0; letter-spacing: -1.8px; }
.entry-intro h1 span { color: var(--accent); }
.entry-description { max-width: 37ch; font-size: 18px; line-height: 1.75; }
.entry-signature { display: flex; align-items: center; gap: 18px; font-size: 14px; margin-top: 44px; }
.signature-line { width: 36px; height: 2px; background: var(--accent); }
.login-box { width: 100%; max-width: 480px; margin: 28px auto; padding: 36px; }
.entry-login { margin: 0; border-top: 3px solid var(--accent); }
.login-header { text-align: left; margin-bottom: 28px; }
.login-header h2, .login-header h1 { margin: 10px 0; font-size: 28px; }
.login-header p { font-size: 15px; }
.login-header .eyebrow { font-size: 12px; }
.login-header .login-icon { margin: 0 0 20px; width: 42px; height: 42px; }
.login-submit { margin-top: 18px; justify-content: space-between; padding: 12px 18px; }
.login-help { text-align: center; margin-top: 17px; font-size: 14px; }
.login-help a { text-decoration: underline; text-underline-offset: 4px; }
.login-footer { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 24px; text-align: left; }
.login-footer p { font-size: 14px; margin-bottom: 10px; }
.login-recovery-card { margin-top: 22px; padding: 16px; }
.password-field { position: relative; }
.password-field input { padding-right: 94px; }
.password-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; min-height: 40px; padding: 0 10px; font-size: 13px; background: transparent; border: 0; color: var(--accent); }
.password-toggle:hover { background: var(--card); color: var(--text); }
.narrow { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.form-intro { padding: 0 0 20px; }
.form-intro h1 { margin: 18px 0 12px; }
.form-intro a { font-size: 14px; }
.access-form { display: flex; flex-direction: column; gap: 24px; }
.access-form .form-grid, .client-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field-hint, .required-hint { color: var(--muted); font-size: 14px; }
.field-error { color: #ffaaa4; font-size: 14px; margin-top: 3px; }
[aria-invalid='true'] { border-color: #f19185 !important; }
.error-summary { border: 1px solid #b06054; background: #30211c; padding: 20px; margin-bottom: 24px; border-radius: 8px; }
.error-summary ul { margin: 10px 0 0 20px; }
.error-summary a { color: #ffc3bb; text-decoration: underline; }
.checkbox-label, .consent-label { display: flex; align-items: flex-start; gap: 12px; line-height: 1.65; }
.checkbox-label a, .consent-label a { text-decoration: underline; }
.client-heading { margin: 0 0 24px; }
.dashboard-header { margin: 0 0 22px; align-items: flex-start; }
.dashboard-header h1 { margin-bottom: 8px; }
.dashboard-header-info { gap: 0; }
.promo { padding: 18px 20px; margin: 0; background: #24271e; border-color: #505640; border-left: 3px solid var(--accent); }
.promo-body { font-size: 16px; }
.document-summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; margin: 26px 0 12px; }
.document-library .section-header { padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.document-library .section-icon { display: none; }
.file-row { margin: 0; padding: 24px 0; background: none; border-radius: 0; border: 0; border-bottom: 1px solid var(--border); align-items: center; gap: 24px; }
.file-row:last-child { border-bottom: 0; padding-bottom: 0; }
.file-title { font-size: 20px; line-height: 1.4; }
.file-date { font-size: 14px; margin-top: 6px; }
.file-icon { min-width: 0; }
.file-meta { min-width: 0; overflow-wrap: anywhere; }
.file-icon-box { width: 50px; height: 58px; border-radius: 6px; }
.file-actions { flex-shrink: 0; }
.admin-page .page { width: min(1440px, 100%); }
.admin-menu { display: flex; gap: 4px; flex-wrap: wrap; background: transparent; border: 0; border-bottom: 1px solid var(--border); padding: 0 0 14px; margin: 0 0 26px; border-radius: 0; }
.admin-menu-link { font-size: 15px; border: 0; background: transparent; border-radius: 7px; padding: 10px 16px; min-height: 44px; }
.admin-menu-link.active { background: var(--card); color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
.admin-hero { padding: 0 0 22px; margin: 0; }
.admin-hero .hero-subtitle { display: none; }
.admin-hero h1 { font-size: 32px; }
.admin-hero p { margin-top: 8px; font-size: 15px; }
.admin-kpi-card { background: var(--panel); border-color: var(--border); box-shadow: none; padding: 20px; }
.admin-kpi-label { font-size: 12px; letter-spacing: .6px; }
.admin-kpi-value { font-size: 34px; }
.admin-kpi-meta { font-size: 14px; }
.admin-kpi-grid-6 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.table { font-size: 14px; }
.table th { font-size: 12px; letter-spacing: .6px; color: var(--muted); }
.table th, .table td { padding: 16px 12px; }
.table td { overflow-wrap: anywhere; }
.table tbody tr:hover { background: var(--card); }
.client-filters { display: grid; grid-template-columns: 2fr repeat(3,minmax(130px,1fr)); align-items: end; gap: 16px; }
.client-filters .form-group { min-width: 0; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 0 0; font-size: 14px; }
.list-search { margin-bottom: 24px; }
.list-search label { margin-bottom: 7px; }
.list-search input { flex: 1; min-width: 180px; }
.client-form-grid { margin: 18px 0; }
.category-order { display: flex; gap: 6px; }
.category-order button { min-width: 36px; padding: 5px; }
.cat-row { background: var(--bg-subtle); border-color: var(--border); padding: 16px; }
dialog.cat-delete-dialog { position: fixed; inset: 0; margin: auto; width: min(560px, calc(100% - 32px)); height: fit-content; max-height: calc(100svh - 48px); padding: 0; border: 1px solid var(--border-light); border-radius: 12px; background: var(--panel); color: var(--text); display: none; overflow: auto; }
dialog.cat-delete-dialog[open] { display: block; }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.cat-delete-box { width: auto; max-width: none; border: 0; padding: 28px; background: none; box-shadow: none; }
.cat-delete-box h2 { font-size: 24px; }
.legal-page { max-width: 780px; }
.legal-page h2 { color: var(--text); font-size: 20px; margin: 26px 0 12px; }
.legal-page p, .legal-page li { font-size: 16px; }
.legal-table { display: block; overflow-x: auto; }
@media (min-width:1200px) { .admin-kpi-grid-6 { grid-template-columns: repeat(6,minmax(0,1fr)); } }
@media (max-width:900px) {
  .portal-entry { grid-template-columns: 1fr 1fr; gap: 32px; }
  .entry-intro h1 { font-size: 44px; }
  .login-box { padding: 28px; }
  .client-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:650px) {
  .topbar { min-height: 72px; padding: 12px 20px; gap: 12px; position: static; flex-wrap: wrap; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 20px; }
  .brand-sub { font-size: 11px; }
  .brand { gap: 9px; }
  .lang-switch a { min-width: 34px; min-height: 34px; }
  .admin-page .nav { gap: 4px; }
  .nav-link { font-size: 13px; padding: 8px; }
  .page { padding: 26px 20px 40px; }
  .section { padding: 22px; margin-bottom: 18px; }
  .portal-entry { display: block; min-height: auto; padding: 0; }
  .entry-intro { margin-bottom: 26px; }
  .entry-intro h1 { font-size: 38px; letter-spacing: -1px; margin: 14px 0 12px; }
  .entry-description { font-size: 16px; line-height: 1.55; }
  .entry-signature { display: none; }
  .entry-login { max-width: none; }
  .login-header { margin-bottom: 22px; }
  .login-header h2 { font-size: 25px; }
  .login-header .eyebrow { display: none; }
  .login-header p { font-size: 14px; }
  .login-footer { margin-top: 20px; padding-top: 18px; }
  .login-box { margin-top: 0; }
  .access-form .form-grid, .client-form-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid > * { min-width: 0; grid-column: auto !important; }
  .access-form { gap: 22px; }
  .dashboard-header { gap: 18px; flex-direction: row; flex-wrap: wrap; }
  .dashboard-header h1 { font-size: 30px; }
  .dashboard-header .btn { font-size: 13px; min-height: 40px; padding: 8px 12px; }
  .dashboard-header-info { flex: 1; min-width: 160px; }
  .client-heading .promo { padding: 16px; }
  .document-summary { margin-top: 18px; font-size: 13px; }
  .document-library .section-header p { display: none; }
  .document-library h2 { font-size: 21px; }
  .file-row { flex-direction: column; align-items: stretch; gap: 20px; }
  .file-title { font-size: 19px; }
  .file-icon { gap: 14px; }
  .file-icon-box { width: 40px; height: 48px; }
  .file-actions, .file-actions .btn { width: 100%; }
  .file-actions .btn { justify-content: space-between; }
  .admin-menu { gap: 5px; margin-bottom: 22px; padding-bottom: 16px; }
  .admin-menu-link { padding: 8px 10px; font-size: 14px; }
  .admin-hero h1 { font-size: 28px; }
  .admin-hero p { font-size: 14px; }
  .admin-kpi-grid-6 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .admin-kpi-card { padding: 16px; }
  .admin-kpi-value { font-size: 28px; }
  .admin-kpi-label { font-size: 11px; }
  .client-filters { grid-template-columns: 1fr; }
  .pagination { align-items: flex-start; font-size: 13px; }
  .cat-row { flex-wrap: wrap; gap: 12px; }
  .cat-name { flex: 1; min-width: 140px; font-size: 16px; }
  .cat-metrics { flex-basis: 100%; }
  .dialog-actions { flex-wrap: wrap; }
  .footer { padding: 24px 20px; font-size: 12px; }
  .footer .dot { display: none; }
  .footer-version { width: 100%; order: 5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.topbar { flex-direction: row; align-items: center; }
.password-toggle { width: auto; max-width: 85px; justify-content: center; }

.form-hint { font-size: 14px; }

@media (max-width:650px) {
  .clients-table.mobile-ready { display: block; width: 100%; min-width: 0; }
  .clients-table.mobile-ready thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .clients-table.mobile-ready tbody { display: block; }
  .clients-table.mobile-ready tr { display: grid; grid-template-columns: 1fr; border: 1px solid var(--border); border-radius: 9px; margin-top: 18px; overflow: hidden; }
  .clients-table.mobile-ready td { display: block; width: auto; padding: 12px 16px; border: 0; white-space: normal; }
  .clients-table.mobile-ready td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
  .clients-table.mobile-ready td:first-child { background: var(--card); display: flex; justify-content: space-between; align-items: center; }
  .clients-table.mobile-ready td:last-child { border-top: 1px solid var(--border); }
  .clients-table.mobile-ready td .btn { width: auto; }
}

.badge { white-space: nowrap; overflow-wrap: normal; }
.client-filters { grid-template-columns: minmax(0,1fr) auto; }
.advanced-filters { grid-column: 1 / -1; }
.advanced-filters summary { font-size: 14px; color: var(--accent); cursor: pointer; padding: 5px 0; }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; align-items: end; padding-top: 18px; }
.clients-table td:nth-child(4) { min-width: 185px; }
.clients-table td:last-child { min-width: 260px; max-width: 330px; }
@media (max-width:650px) {
  .client-filters, .advanced-filter-grid { grid-template-columns: 1fr; }
  .clients-table.mobile-ready td:nth-child(4), .clients-table.mobile-ready td:last-child { min-width: 0; max-width: none; }
}

.client-status-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.client-status-tabs .btn { width: auto; min-height: 40px; }
@media (max-width:650px) {
  .client-status-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .client-status-tabs .btn { width: 100%; }
  .create-client-hint { display: none; }
  #create-client-details summary { font-size: 15px; }
  .admin-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Tariff periods, commercial requests and category review use the portal palette. */
.tariff-upload { grid-template-columns: repeat(3, minmax(0, 1fr)); }
input[type='date'] { font-size: 16px; min-height: 48px; border-color: var(--border-light); background: var(--bg-subtle); min-width: 0; }
.contact-actions { margin: 2rem 0 1rem; padding: 1.4rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); }
.contact-actions h2 { font-size: 1.25rem; margin: 0 0 .4rem; }
.contact-actions p { margin: 0; color: var(--text-muted); }
.contact-buttons { display: flex; flex-wrap: wrap; gap: .75rem; flex-shrink: 0; }
.tariff-notice { margin: 1rem 0 1.5rem; border-left: 3px solid var(--accent); padding: .7rem 1rem; max-width: 78ch; line-height: 1.65; }
.tariff-period { display: flex; gap: .5rem .75rem; align-items: center; flex-wrap: wrap; margin: .55rem 0; font-size: .9rem; }
.file-category { color: var(--text-muted); margin: .25rem 0; font-size: .9rem; }
.document-library .file-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.checkbox-line { display: flex; align-items: flex-start; gap: .65rem; font-size: 1rem; line-height: 1.5; }
.checkbox-line input[type="checkbox"] { width: 1.15rem; min-width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex: 0 0 auto; }
.additional-categories { padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-md); margin: 0 0 1.25rem; min-width: 0; }
.additional-categories legend { padding: 0 .4rem; font-weight: 700; }
.category-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; margin-top: 1rem; }
.category-review { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; background: var(--accent-dim); border-radius: var(--radius-md); margin-bottom: 1.5rem; }
.category-review p { margin: .4rem 0 0; }
.category-review form { flex-shrink: 0; }
.category-review.needs-review { border-left: 3px solid var(--accent); }
.review-filter { font-size: .9rem; }
.tariff-edit { min-width: 230px; margin-top: .5rem; }
.tariff-edit summary { cursor: pointer; font-size: .9rem; color: var(--accent); padding: .5rem 0; }
.tariff-edit form { display: grid; gap: .6rem; padding: .75rem 0; }
.tariff-edit label { font-size: .9rem; }
.request-reference { display: grid; gap: .4rem; border-left: 3px solid var(--accent); padding: .75rem 1rem; margin-bottom: 1.25rem; background: var(--accent-dim); }
.request-filters { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.5rem; }
.request-filters .form-group:first-of-type { flex: 1 1 16rem; }
.request-filters .form-group { margin: 0; }
.commercial-request-list { display: grid; gap: 1rem; }
.commercial-request-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.3rem; min-width: 0; overflow-wrap: anywhere; }
.commercial-request-card header, .commercial-request-card footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.commercial-request-card h2 { font-size: 1.3rem; margin: .35rem 0; }
.commercial-request-card .eyebrow { font-size: .85rem; color: var(--accent); margin: 0; }
.commercial-request-card header p { margin: .3rem 0; }
.request-contact { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; margin: 1rem 0; }
.request-message { white-space: normal; line-height: 1.7; padding: 1rem 0; border-top: 1px solid var(--border); }
.commercial-request-card footer form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.commercial-request-card footer select { width: auto; min-width: 8rem; }
@media (max-width: 760px) {
  .tariff-upload { grid-template-columns: 1fr; }
  .contact-actions, .category-review { flex-direction: column; align-items: stretch; }
  .contact-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex-shrink: 1; }
  .contact-buttons .btn { white-space: normal; text-align: center; }
  .category-options { grid-template-columns: 1fr; }
  .category-review form, .category-review button { width: 100%; white-space: normal; }
  .commercial-request-card { padding: 1rem; }
  .request-filters .form-group { flex: 1 1 100%; }
  .commercial-request-card footer form { width: 100%; }
  .document-library .file-actions { display: grid; grid-template-columns: 1fr; }
}
