:root {
  --bg: #f1eeec;
  --ink: #2d1609;
  --muted: #736a66;
  --line: #ded8d4;
  --panel: #ffffff;
  --nav: #2d1001;
  --nav-soft: #482414;
  --accent: #3faaa2;
  --accent-dark: #287f79;
  --yellow: #b8ca5e;
  --blue: #324ac4;
  --aqua: #76dcd1;
  --periwinkle: #7d8fe5;
  --brand-brown: #2d1001;
  --brand-cream: #eeeae8;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  transition: grid-template-columns .22s ease;
}

.app.sidebar-collapsed { grid-template-columns: 78px minmax(0, 1fr); }

.auth-layout { display: block; min-height: 100vh; }
.auth-layout main { min-height: 100vh; padding: 0; overflow: visible; }
.auth-layout .content-shell { width: 100%; max-width: none; }

aside {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--nav);
  color: white;
  padding: 62px 14px 16px;
  transition: padding .22s ease;
}

.sidebar-toggle { position: fixed; top: 16px; left: 198px; z-index: 40; width: 34px; min-height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid #694331; border-radius: 6px; background: var(--nav-soft); color: white; font-size: 24px; line-height: 1; transition: left .22s ease, background .15s ease; }
.sidebar-toggle:hover { background: #5a301d; }
.sidebar-toggle:focus-visible { outline: 3px solid rgba(118, 220, 209, .35); outline-offset: 2px; }

.brand {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 9px 7px;
  background: var(--brand-cream);
  color: var(--brand-brown);
  text-decoration: none;
  margin: 0 8px 30px;
  border-radius: 6px;
}

.brand img { width: 100%; height: 60px; object-fit: contain; }
.brand-caption {
  color: #795e51;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

nav { display: grid; gap: 3px; }

nav > a,
.nav-group a {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: #eee7e3;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
}

nav a:hover { background: var(--nav-soft); color: white; }
nav a.active { background: var(--aqua); color: var(--brand-brown); font-weight: 750; }

.nav-short { width: 22px; flex: 0 0 22px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 850; line-height: 1; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-group { display: grid; gap: 2px; margin-top: 14px; }
.nav-group > span {
  padding: 0 12px 5px;
  color: #bda99f;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin-top: auto;
  padding: 15px 8px 0;
  border-top: 1px solid #593221;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--brand-brown);
  font-weight: 800;
}

.user-card strong, .user-card small { display: block; overflow: hidden; text-overflow: ellipsis; }
.user-card strong { font-size: 12px; white-space: nowrap; }
.user-card small { margin-top: 2px; color: #bda99f; font-size: 9px; }

.sidebar-collapsed aside { padding-right: 10px; padding-left: 10px; }
.sidebar-collapsed .sidebar-toggle { left: 22px; }
.sidebar-collapsed .brand { margin: 0 0 22px; padding: 7px 5px; }
.sidebar-collapsed .brand img { height: 36px; }
.sidebar-collapsed .brand-caption, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-group > span, .sidebar-collapsed .user-card > div { display: none; }
.sidebar-collapsed nav > a, .sidebar-collapsed .nav-group a { justify-content: center; padding-right: 8px; padding-left: 8px; }
.sidebar-collapsed .nav-short { width: 24px; flex-basis: 24px; font-size: 13px; }
.sidebar-collapsed .nav-group { margin-top: 5px; }
.sidebar-collapsed .user-card { grid-template-columns: 34px; justify-content: center; padding-right: 0; padding-left: 0; }

main { min-width: 0; padding: 34px 36px 48px; overflow: auto; }
.content-shell { width: min(1440px, 100%); margin: 0 auto; }
.global-toolbar { position: sticky; top: 0; z-index: 20; width: min(1440px, 100%); min-height: 45px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 auto 18px; padding: 0 0 10px; background: var(--bg); }
.toolbar-user { min-width: 0; text-align: right; }
.toolbar-user span, .toolbar-user small { display: block; }
.toolbar-user span { color: var(--ink); font-size: 11px; font-weight: 800; }
.toolbar-user small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.logout-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 13px; border-radius: 6px; background: var(--brand-brown); color: white; font-size: 11px; font-weight: 800; text-decoration: none; }
.logout-button:hover { background: #482414; }
.logout-button span { font-size: 15px; line-height: 1; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
h1 { margin-bottom: 7px; font-size: 30px; line-height: 1.15; }
h2 { font-size: 19px; }
p { color: var(--muted); line-height: 1.5; }

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.page-head p { margin-bottom: 0; }
.today { color: var(--muted); font-weight: 650; }
.head-actions, .print-toolbar { display: flex; gap: 9px; align-items: center; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi, .panel, .module-card, .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.kpi { position: relative; min-height: 102px; padding: 18px; overflow: hidden; }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--accent); }
.kpi:nth-child(3n)::before { background: var(--yellow); }
.kpi:nth-child(4n)::before { background: var(--periwinkle); }
.kpi span, .module-card span, label span, .split span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}
.kpi strong { font-size: 21px; }

.panel { padding: 20px; margin-bottom: 16px; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.module-card { position: relative; display: block; min-height: 92px; padding: 17px; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.module-card::after { content: "→"; position: absolute; right: 16px; bottom: 15px; color: var(--accent); font-size: 18px; }
.module-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.module-card strong { display: block; margin-bottom: 7px; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.split div { border-left: 3px solid var(--yellow); background: #fafbfc; padding: 14px 16px; }
.split div:first-child { border-color: var(--accent); }
.split strong { font-size: 22px; }

.table-wrap { padding: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; background: #f6f1ef; color: #684e41; font-size: 10px; text-transform: uppercase; white-space: nowrap; }
td { color: #48372f; font-size: 12px; }
tbody tr:hover { background: #fbfdfc; }
tbody tr:last-child td { border-bottom: 0; }
.actions { min-width: 190px; white-space: nowrap; }
.actions a { margin-right: 12px; color: var(--blue); font-weight: 650; text-decoration: none; }
.actions a:last-child { color: var(--accent); }
.actions form { display: inline-flex; margin: 0; vertical-align: middle; }
.table-button { min-height: 28px; padding: 5px 9px; font-size: 11px; background: var(--brand-brown); }
.table-button:hover { background: #482414; }
.empty { color: var(--muted); text-align: center; padding: 36px; }

.button, button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button, button { background: var(--accent); color: white; }
.button:hover, button:hover { background: var(--accent-dark); }
.secondary-button { border-color: #cfd6d3; background: white; color: #34413e; }
.danger { background: var(--danger); }
.secondary { color: var(--blue); text-decoration: none; font-weight: 650; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
label span { margin-bottom: 6px; color: #475467; font-weight: 650; }
label input, label select, label textarea { width: 100%; min-height: 41px; border: 1px solid #cfd6d3; border-radius: 6px; background: #fff; padding: 9px 11px; color: var(--ink); font: inherit; outline: none; }
label textarea { resize: vertical; }
label input:focus, label select:focus, label textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 170, 162, .15); }
label input[readonly], .readonly-money { background: #f2f4f3; color: #66736f; cursor: not-allowed; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.field-wide { grid-column: span 2; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }

.admin-form h2 { margin-bottom: 18px; }
.inline-form { display: grid; grid-template-columns: 1fr 1.35fr 1.15fr auto; gap: 12px; align-items: end; }
.inline-form .button { margin-bottom: 0; white-space: nowrap; }
.access-create-form .new-permissions { grid-column: 1 / -1; }
.access-create-form > .button { grid-column: 1 / -1; justify-self: end; }
.new-permissions { margin: 5px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.new-permissions legend { padding: 0 7px; color: #684e41; font-size: 11px; font-weight: 800; }
.permission-grid { display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)); gap: 7px 12px; }
.check-option { display: flex; align-items: center; gap: 7px; min-height: 30px; cursor: pointer; }
.check-option input { width: 16px; min-height: 16px; height: 16px; margin: 0; accent-color: var(--accent-dark); }
.check-option span { margin: 0; color: #48372f; font-size: 11px; font-weight: 600; }
.permission-cell { min-width: 210px; }
.permission-editor summary { color: var(--blue); cursor: pointer; font-weight: 750; }
.permission-editor form { width: 620px; max-width: 72vw; padding: 13px 0 3px; }
.permission-save { margin-top: 12px; background: var(--accent); border-color: var(--accent); color: white; }
.access-table { min-width: 1180px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 420px; }
.user-actions form { margin: 0; }
.password-action { display: inline-flex; align-items: center; gap: 6px; }
.password-action input { width: 180px; min-height: 31px; border: 1px solid #cfd6d3; border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 11px; outline: none; }
.password-action input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 170, 162, .15); }
.small-button { min-height: 31px; padding: 6px 9px; background: white; border-color: #cfd6d3; color: #34413e; font-size: 11px; }
.small-button:hover { background: #f2efed; color: var(--ink); }
.small-button:disabled { opacity: .45; cursor: not-allowed; }
.muted-button { color: var(--blue); }
.danger-button { border-color: #f0b7b0; color: var(--danger); }
.danger-button:hover { background: #fce8e6; color: var(--danger); }
.status { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 5px; font-size: 10px; font-weight: 800; }
.status-active { background: #dff5f2; color: #236d68; }
.status-blocked { background: #fce8e6; color: var(--danger); }
.helper-note { font-size: 11px; }
.settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-preview { margin-top: 18px; padding: 22px 28px; background: white; border: 1px dashed #b8c2be; }
.footer-preview > span { display: block; margin-bottom: 24px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.footer-preview .document-footer { margin-top: 0; }

.week-toolbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  max-width: 520px;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  box-shadow: var(--shadow);
  text-align: center;
}
.week-toolbar > a { display: grid; place-items: center; height: 54px; color: var(--brand-brown); font-size: 20px; text-decoration: none; }
.week-toolbar > a:hover { background: var(--brand-cream); }
.week-toolbar div { padding: 8px 12px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); }
.week-toolbar strong, .week-toolbar span { display: block; }
.week-toolbar strong { font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
.week-toolbar span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.planning-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.planning-kpis > div { padding: 14px 16px; border-top: 3px solid var(--accent); background: white; box-shadow: var(--shadow); }
.planning-kpis > div:nth-child(2) { border-color: #c24136; }
.planning-kpis > div:nth-child(3) { border-color: var(--blue); }
.planning-kpis > div:nth-child(4) { border-color: var(--yellow); }
.planning-kpis span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.planning-kpis b { font-size: 21px; }
.planning-section { margin-top: 24px; }
.planning-section > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.planning-section > header h2 { margin-bottom: 0; }
.planning-section > header > b { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-brown); color: white; }
.planning-item { display: grid; grid-template-columns: 120px minmax(240px, 1fr) minmax(390px, .9fr); gap: 18px; align-items: center; margin-bottom: 9px; padding: 15px 16px; border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: 6px; background: white; box-shadow: 0 1px 2px rgba(45, 16, 1, .04); }
.planning-item.priority-urgente { border-left-color: #c24136; }
.planning-item.priority-haute { border-left-color: #e08a36; }
.planning-item.priority-normale { border-left-color: var(--accent); }
.planning-item.priority-basse { border-left-color: var(--periwinkle); }
.planning-time span, .planning-time strong, .planning-time small { display: block; }
.planning-time span { margin-bottom: 5px; color: var(--brand-brown); font-weight: 800; }
.planning-time strong { font-size: 15px; }
.planning-time small { margin-top: 3px; color: var(--muted); }
.planning-main h3 { margin: 6px 0 4px; font-family: inherit; font-size: 14px; font-weight: 800; }
.planning-main p { margin-bottom: 7px; font-size: 11px; }
.planning-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.planning-tags span { display: inline-flex; padding: 3px 6px; border-radius: 4px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.priority-tag { background: #f3ebe7; color: #7a3921; }
.status-tag { background: #dff5f2; color: #236d68; }
.assignee { color: var(--muted); font-size: 10px; }
.assignee b { color: var(--ink); }
.planning-update { display: grid; grid-template-columns: 130px 92px minmax(160px, 1fr); gap: 8px; align-items: end; }
.planning-update label span { margin-bottom: 3px; font-size: 9px; }
.planning-update input, .planning-update select { min-height: 34px; padding: 6px 8px; font-size: 11px; }
.planning-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.planning-actions a { color: var(--blue); font-size: 10px; font-weight: 750; text-decoration: none; }
.planning-actions .small-button { min-height: 29px; background: var(--accent); border-color: var(--accent); color: white; }
.empty-state { display: grid; justify-items: center; gap: 5px; padding: 34px; border: 1px dashed #cfc5c0; background: rgba(255, 255, 255, .55); color: var(--muted); }
.empty-state strong { color: var(--ink); }
.empty-state span { font-size: 11px; }

.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 1fr) minmax(420px, 560px); background: var(--brand-cream); }
.login-brand-panel { position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 48px; background: var(--brand-brown); color: white; }
.login-brand-panel::before, .login-brand-panel::after { content: ""; position: absolute; right: 0; height: 12px; }
.login-brand-panel::before { bottom: 68px; width: 38%; background: var(--aqua); }
.login-brand-panel::after { bottom: 48px; width: 24%; background: var(--yellow); }
.login-brand-box { position: relative; z-index: 1; width: min(320px, 80%); padding: 14px 18px; border-radius: 6px; background: var(--brand-cream); }
.login-brand-logo { display: block; width: 100%; height: 92px; object-fit: contain; }
.login-brand-copy { position: relative; z-index: 1; max-width: 540px; margin: auto 0; padding: 48px 0; }
.login-brand-copy > span { display: block; margin-bottom: 14px; color: var(--aqua); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.login-brand-copy h2 { max-width: 500px; margin-bottom: 18px; color: white; font-size: 38px; line-height: 1.14; }
.login-brand-copy p { margin-bottom: 0; color: #d9ccc6; font-size: 13px; font-weight: 650; }
.login-brand-panel > small { position: relative; z-index: 1; color: #bda99f; }
.login-form-panel { min-width: 0; display: grid; place-items: center; padding: 44px; background: #f5f2f0; }
.login-card { width: min(420px, 100%); padding: 0; border: 0; background: transparent; box-shadow: none; }
.login-card h1 { margin-bottom: 8px; font-size: 34px; }
.login-card > p { margin-bottom: 0; }
.login-card form { display: grid; gap: 17px; margin-top: 30px; }
.login-card label input { min-height: 48px; background: white; }
.login-card .button { width: 100%; min-height: 48px; margin-top: 5px; }
.error { color: var(--danger); font-weight: 700; }

.print-toolbar { justify-content: flex-end; margin-bottom: 18px; }
.print-sheet { width: min(100%, 1050px); min-height: 1120px; margin: 0 auto; padding: 50px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.document-brand { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--brand-brown); }
.document-brand > div:last-child { text-align: right; }
.document-logo { display: block; width: 190px; height: 72px; object-fit: contain; object-position: left center; }
.document-brand b { display: block; font-size: 14px; }
.document-brand span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.document-title { padding: 34px 0 28px; }
.document-title span { color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.document-title h1 { margin: 6px 0 3px; font-size: 34px; text-transform: uppercase; }
.document-title p { margin: 0; }
.document-meta { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 28px; border: 1px solid var(--line); }
.document-meta > div { padding: 13px 15px; border-right: 1px solid var(--line); }
.document-meta > div:last-child { border: 0; }
.document-meta span, .address-grid span, .detail-field span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-bottom: 35px; }
.address-grid h3 { margin: 7px 0; font-size: 16px; }
.address-grid p { font-size: 12px; }
.invoice-lines { min-width: 0; margin-bottom: 26px; }
.invoice-lines th { position: static; background: var(--brand-brown); color: white; }
.invoice-lines th:last-child, .invoice-lines td:last-child { text-align: right; }
.invoice-lines small { display: block; margin-top: 5px; color: var(--muted); }
.invoice-total { width: min(360px, 100%); margin-left: auto; }
.invoice-total > div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.invoice-total span { color: var(--muted); }
.invoice-total .grand-total { margin-top: 3px; padding: 14px; border: 0; background: #dff5f2; color: #236d68; font-size: 16px; }
.payment-summary { display: flex; justify-content: flex-end; gap: 22px; margin-top: 13px; font-size: 12px; }
.document-note { margin-top: 55px; padding: 16px; border-left: 3px solid var(--yellow); background: #fafbfc; }
.document-note p { margin: 6px 0 0; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); }
.detail-field { min-height: 69px; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-field:nth-child(2n) { border-right: 0; }
.detail-field b { overflow-wrap: anywhere; }
.document-footer { display: grid; gap: 4px; margin-top: 70px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; line-height: 1.35; text-align: center; }
.document-footer strong { color: #26332f; font-size: 9px; }
.document-footer span { display: block; }
.print-list { width: min(100%, 1400px); min-height: auto; padding: 36px; }
.print-list table { min-width: 0; }
.print-list th { position: static; }

@media (max-width: 1120px) {
  .kpi-grid, .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-grid { grid-template-columns: repeat(3, minmax(125px, 1fr)); }
  .planning-item { grid-template-columns: 105px minmax(0, 1fr); }
  .planning-update { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 220px; padding: 26px 30px; }
  .login-brand-box { width: 230px; padding: 8px 12px; }
  .login-brand-logo { height: 60px; }
  .login-brand-copy { margin: 22px 0 0; padding: 0 0 18px; }
  .login-brand-copy h2 { margin-bottom: 8px; font-size: 25px; }
  .login-brand-panel > small { display: none; }
  .login-brand-panel::before { bottom: 20px; height: 8px; }
  .login-brand-panel::after { bottom: 8px; height: 7px; }
  .login-form-panel { min-height: calc(100dvh - 220px); padding: 38px 24px; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .app.sidebar-collapsed { grid-template-columns: 1fr; }
  aside { position: relative; height: auto; padding: 56px 14px 17px; }
  .sidebar-toggle { position: absolute; top: 15px; right: 14px; left: auto; }
  .brand { width: 210px; margin: 0 0 14px; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav > a, .nav-group { margin-top: 0; }
  .nav-group > span { display: none; }
  .nav-group { display: contents; }
  .user-card { display: none; }
  main { padding: 22px 16px 36px; }
  .global-toolbar { margin-bottom: 14px; padding-bottom: 8px; }
  .toolbar-user { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { width: 100%; flex-wrap: wrap; }
  .head-actions > * { flex: 1; }
  .kpi-grid, .module-grid, .form-grid { grid-template-columns: 1fr; }
  .inline-form, .settings-form { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-editor form { width: 520px; max-width: 78vw; }
  .field-wide { grid-column: auto; }
  .planning-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planning-item { grid-template-columns: 1fr; gap: 12px; }
  .planning-update { grid-template-columns: 1fr 1fr; }
  .planning-update .feedback-field { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .print-sheet { min-height: auto; padding: 24px; }
  .document-meta, .address-grid, .detail-grid { grid-template-columns: 1fr; }
  .document-meta > div, .detail-field { border-right: 0; }
  .document-brand { flex-direction: column; }
  .document-brand > div:last-child { text-align: left; }
  .sidebar-collapsed aside { height: 72px; flex-direction: row; align-items: center; padding: 10px 14px; overflow: hidden; }
  .sidebar-collapsed .sidebar-toggle { top: 19px; right: 14px; left: auto; }
  .sidebar-collapsed .brand { width: 150px; margin: 0; padding: 5px 8px; }
  .sidebar-collapsed .brand img { height: 34px; }
  .sidebar-collapsed nav, .sidebar-collapsed .user-card { display: none; }
}

@media (max-width: 480px) {
  .login-brand-panel { min-height: 178px; padding: 20px; }
  .login-brand-box { width: 190px; }
  .login-brand-logo { height: 48px; }
  .login-brand-copy { margin-top: 16px; padding-bottom: 10px; }
  .login-brand-copy > span { margin-bottom: 7px; font-size: 9px; }
  .login-brand-copy h2 { margin-bottom: 0; font-size: 21px; }
  .login-brand-copy p { display: none; }
  .login-form-panel { min-height: calc(100dvh - 178px); padding: 30px 20px; }
  .login-card h1 { font-size: 29px; }
  .login-card form { margin-top: 23px; }
}

@media print {
  @page { size: A4; margin: 12mm 12mm 22mm; }
  body { background: white; color: black; font-size: 10pt; }
  .app { display: block; }
  aside, .no-print, .global-toolbar { display: none !important; }
  main { padding: 0; overflow: visible; }
  .content-shell { width: 100%; }
  .print-sheet { width: 100%; min-height: 0; margin: 0; padding: 0 0 12mm; border: 0; box-shadow: none; }
  .print-list { max-width: none; }
  .print-list table { table-layout: fixed; }
  .print-list th, .print-list td { padding: 5px 6px; font-size: 7pt; overflow-wrap: anywhere; }
  .document-footer { position: fixed; bottom: 0; left: 0; right: 0; padding-top: 7px; background: white; }
  .invoice-lines th { color: white !important; background: #2d1001 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .grand-total { background: #dff5f2 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
