:root {
    --forest: #102a20;
    --forest-deep: #0a1e17;
    --forest-soft: #1b3b2f;
    --gold: #c9a269;
    --gold-soft: #f1e6d4;
    --paper: #f6f3ed;
    --surface: #ffffff;
    --ink: #17211d;
    --muted: #6f7873;
    --line: #e5e5df;
    --danger: #a74444;
    --danger-soft: #f9eceb;
    --success: #32765a;
    --success-soft: #eaf4ef;
    --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
    --sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    --shadow: 0 18px 50px rgba(17, 42, 32, .08);
}

* { box-sizing: border-box; }

html { min-height: 100%; color-scheme: light; }

body { min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 15px; line-height: 1.5; }

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.icon { width: 21px; height: 21px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 .4rem; color: var(--gold); font-size: .68rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.visually-hidden, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Login */
.login-page { display: grid; min-height: 100svh; padding: 1rem; background: #f4f5f6; place-items: center; }
.login-shell { display: grid; width: min(100%, 420px); min-width: 0; }
.login-panel { display: flex; width: 100%; min-width: 0; padding: clamp(1.5rem, 5vw, 2.25rem); border: 1px solid #e0e2e5; border-radius: 12px; flex-direction: column; background: #fff; box-shadow: 0 12px 35px rgba(31, 36, 42, .07); }
.admin-brand { display: inline-flex; width: max-content; flex-direction: column; color: var(--forest); line-height: 1; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.admin-brand span { margin-bottom: .15rem; font-size: .58rem; font-weight: 750; letter-spacing: .28em; }
.admin-brand strong { font-family: var(--serif); font-size: 1.7rem; font-weight: 400; letter-spacing: .08em; }
.login-form { display: grid; min-width: 0; gap: .55rem; }
.login-form label { color: #30343b; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.login-form input { width: 100%; min-width: 0; max-width: 100%; min-height: 52px; margin-bottom: .75rem; padding: .8rem .95rem; border: 1px solid #d8dadd; border-radius: 9px; color: #20242a; background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.login-form input:focus { border-color: #737982; box-shadow: 0 0 0 4px rgba(66, 72, 80, .1); }
.login-page .primary-button { background: #20242a; }
.login-page .primary-button:hover { background: #353a42; }
.primary-button, .secondary-button { display: inline-flex; min-height: 50px; border: 0; border-radius: 8px; align-items: center; justify-content: center; gap: 1rem; font-size: .76rem; font-weight: 750; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.primary-button { margin-top: .75rem; padding: .85rem 1.2rem; color: #fff; background: var(--forest); }
.primary-button:hover { background: var(--forest-soft); }
.primary-button:disabled { cursor: not-allowed; opacity: .5; }
.primary-button .icon, .secondary-button .icon { width: 18px; height: 18px; }
.alert { margin: 1.5rem 0 0; padding: .85rem 1rem; border-radius: 8px; font-size: .86rem; }
.alert--error { border: 1px solid #edcecb; color: var(--danger); background: var(--danger-soft); }
.alert--success { border: 1px solid #bddfce; color: var(--success); background: var(--success-soft); }
.app-alert { margin: 0 0 1rem; }

/* Application shell */
.app-shell { min-height: 100svh; }
.sidebar { display: none; }
.main-content { width: 100%; min-width: 0; padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
.topbar { display: flex; min-height: 64px; margin-bottom: 1.5rem; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.topbar h1 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: clamp(2.4rem, 8vw, 3.5rem); font-weight: 400; line-height: .92; letter-spacing: -.045em; }
.topbar__date { display: none; color: var(--muted); font-size: .78rem; }
.mobile-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; height: calc(68px + env(safe-area-inset-bottom)); padding: .45rem .45rem env(safe-area-inset-bottom); overflow-x: auto; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .97); box-shadow: 0 -12px 30px rgba(16, 42, 32, .06); backdrop-filter: blur(14px); scrollbar-width: none; }
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav > a, .mobile-nav > .nav-item { display: flex; min-width: 74px; min-height: 55px; flex: 1 0 74px; border-radius: 8px; align-items: center; flex-direction: column; justify-content: center; gap: .18rem; color: var(--muted); font-size: .64rem; font-weight: 700; text-decoration: none; }
.mobile-nav .icon { width: 20px; height: 20px; }
.mobile-nav a.is-active { color: var(--forest); background: var(--gold-soft); }
.mobile-nav .nav-item--disabled { color: #aeb4b1; cursor: not-allowed; opacity: .65; }
.mobile-nav .nav-item--disabled small { display: none; }

.welcome-card { position: relative; display: flex; overflow: hidden; margin-bottom: 1rem; padding: 1.6rem; border-radius: 12px; align-items: flex-start; flex-direction: column; gap: 1.4rem; color: #fff; background: var(--forest); box-shadow: var(--shadow); }
.welcome-card::after { position: absolute; top: -65px; right: -65px; width: 180px; height: 180px; border: 1px solid rgba(201, 162, 105, .28); border-radius: 50%; content: ""; }
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card h2 { max-width: 600px; margin: 0 0 .7rem; font-family: var(--serif); font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 400; line-height: .98; letter-spacing: -.04em; }
.welcome-card p:last-child { max-width: 590px; margin: 0; color: rgba(255,255,255,.68); font-size: .88rem; }
.secondary-button { min-height: 44px; padding: .7rem 1rem; color: var(--forest); background: var(--gold); }

.stat-grid { display: grid; margin-bottom: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.stat-card { min-width: 0; padding: 1.15rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stat-card__icon { display: grid; width: 36px; height: 36px; margin-bottom: 1.2rem; border-radius: 9px; color: var(--forest); background: var(--gold-soft); place-items: center; }
.stat-card__icon .icon { width: 18px; height: 18px; }
.stat-card p { margin: 0 0 .35rem; overflow: hidden; color: var(--muted); font-size: .72rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.stat-card > strong { display: block; color: var(--forest); font-family: var(--serif); font-size: clamp(2rem, 9vw, 3.1rem); font-weight: 400; line-height: 1; letter-spacing: -.04em; }
.stat-card > small { display: block; margin-top: .65rem; overflow: hidden; color: #98a09c; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }

.content-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.section-heading { display: flex; padding: 1.3rem 1.2rem; border-bottom: 1px solid var(--line); align-items: flex-end; justify-content: space-between; gap: 1rem; }
.section-heading h2, .contacts-toolbar h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 1.75rem; font-weight: 400; line-height: 1; letter-spacing: -.025em; }
.section-heading > a { padding: .5rem 0; color: var(--forest); font-size: .72rem; font-weight: 750; text-decoration: none; }
.recent-list { padding: .2rem 1rem; }
.recent-contact { display: grid; min-width: 0; padding: 1rem .2rem; border-bottom: 1px solid var(--line); align-items: center; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; }
.recent-contact:last-child { border-bottom: 0; }
.recent-contact > div { min-width: 0; }
.recent-contact strong, .contact-cell strong { display: block; overflow: hidden; color: var(--ink); font-size: .84rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recent-contact small, .contact-cell small { display: block; margin-top: .15rem; color: var(--muted); font-size: .68rem; }
.recent-contact .status { grid-column: 2; justify-self: start; }
.contact-mark { display: grid; width: 38px; height: 38px; border-radius: 50%; color: var(--forest); background: var(--gold-soft); place-items: center; }
.contact-mark .icon { width: 17px; height: 17px; }
.status { display: inline-flex; width: max-content; padding: .28rem .55rem; border-radius: 999px; align-items: center; gap: .35rem; font-size: .65rem; font-weight: 700; white-space: nowrap; }
.status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--active { color: var(--success); background: var(--success-soft); }
.status--inactive { color: var(--danger); background: var(--danger-soft); }
.status--neutral { color: var(--muted); background: #f0f1ef; }

/* Taken */
.tasks-toolbar { display: flex; margin-bottom: 1rem; align-items: flex-start; flex-direction: column; gap: 1rem; }
.tasks-toolbar h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.task-stat-grid .stat-card__icon { margin-bottom: .8rem; }
.task-stat-grid .stat-card > strong { font-size: clamp(1.8rem, 8vw, 2.5rem); }
.task-filters { display: flex; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; gap: .45rem; }
.task-filters > a { display: inline-flex; min-height: 38px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; align-items: center; color: var(--muted); background: #fff; font-size: .69rem; font-weight: 750; text-decoration: none; }
.task-filters > a:hover { border-color: var(--gold); color: var(--forest); }
.task-filters > a.is-active { border-color: var(--forest); color: #fff; background: var(--forest); }
.task-filters form { display: flex; width: 100%; min-width: 0; margin-top: .35rem; align-items: center; gap: .55rem; }
.task-filters label { color: var(--muted); font-size: .67rem; font-weight: 700; }
.task-filters select { min-width: 0; height: 38px; padding: 0 2rem 0 .7rem; border: 1px solid var(--line); border-radius: 7px; color: var(--forest); background: #fff; outline: none; }
.tasks-layout { display: grid; align-items: start; gap: 1rem; }
.task-list { display: grid; min-width: 0; gap: .7rem; }
.task-card { display: grid; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 11px; align-items: start; grid-template-columns: auto minmax(0, 1fr); gap: .85rem; background: #fff; box-shadow: 0 8px 28px rgba(17,42,32,.035); }
.task-card--done { background: rgba(255,255,255,.62); opacity: .78; }
.task-card--overdue { border-color: #e7c6c2; }
.task-card__marker { display: grid; width: 38px; height: 38px; border-radius: 10px; color: var(--forest); background: var(--gold-soft); place-items: center; }
.task-card--done .task-card__marker { color: var(--success); background: var(--success-soft); }
.task-card--overdue .task-card__marker { color: var(--danger); background: var(--danger-soft); }
.task-card__marker .icon { width: 18px; height: 18px; }
.task-card__body { min-width: 0; }
.task-card__meta { display: flex; margin-bottom: .45rem; align-items: center; flex-wrap: wrap; gap: .35rem; }
.task-card__meta > span { display: inline-flex; padding: .24rem .48rem; border-radius: 999px; font-size: .59rem; font-weight: 750; }
.task-category { color: #755a34; background: var(--gold-soft); }
.task-status { color: var(--muted); background: #f0f1ef; }
.task-priority--low { color: var(--muted); background: #f0f1ef; }
.task-priority--normal { color: var(--forest); background: #edf2ef; }
.task-priority--high { color: #8b5c1a; background: #fbf0dd; }
.task-priority--urgent { color: var(--danger); background: var(--danger-soft); }
.task-card h3 { margin: 0; color: var(--ink); font-size: .92rem; line-height: 1.35; }
.task-card--done h3 { text-decoration: line-through; }
.task-card__body > p { display: -webkit-box; margin: .45rem 0 0; overflow: hidden; color: var(--muted); font-size: .72rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.task-card__footer { display: flex; margin-top: .75rem; align-items: center; flex-wrap: wrap; gap: .45rem 1rem; }
.task-card__footer > span { display: inline-flex; min-width: 0; align-items: center; gap: .35rem; color: var(--muted); font-size: .64rem; }
.task-card__footer .icon { width: 14px; height: 14px; }
.task-due--overdue { color: var(--danger) !important; font-weight: 700; }
.task-due--today { color: #8b5c1a !important; font-weight: 700; }
.task-card__actions { display: flex; grid-column: 1 / -1; align-items: center; justify-content: flex-end; gap: .45rem; }
.task-card__actions form { min-width: 0; }
.task-card__actions select { height: 38px; padding: 0 2rem 0 .65rem; border: 1px solid var(--line); border-radius: 7px; color: var(--forest); background: #fbfbf9; font-size: .68rem; font-weight: 700; outline: none; }
.task-edit-button { display: grid; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 7px; color: var(--forest); background: #fff; text-decoration: none; place-items: center; }
.task-edit-button:hover { border-color: var(--gold); background: var(--gold-soft); }
.task-edit-button .icon { width: 15px; height: 15px; }
.task-categories { min-width: 0; }
.task-category-list { display: grid; padding: .55rem; gap: .25rem; }
.task-category-list a { display: flex; min-width: 0; padding: .7rem .75rem; border-radius: 7px; align-items: center; justify-content: space-between; gap: .7rem; color: var(--muted); font-size: .7rem; font-weight: 700; text-decoration: none; }
.task-category-list a:hover, .task-category-list a.is-active { color: var(--forest); background: var(--gold-soft); }
.task-category-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-category-list a small { flex: 0 0 auto; color: #979d99; font-size: .59rem; font-weight: 650; }
.task-category-form { display: grid; padding: 1rem; border-top: 1px solid var(--line); gap: .45rem; }
.task-category-form > label { color: var(--forest); font-size: .7rem; font-weight: 750; }
.task-category-form > div { display: flex; min-width: 0; gap: .4rem; }
.task-category-form input { width: 100%; min-width: 0; height: 42px; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 7px; outline: none; }
.task-category-form button { display: grid; width: 42px; height: 42px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 7px; color: #fff; background: var(--forest); cursor: pointer; place-items: center; }
.task-category-form button .icon { width: 17px; height: 17px; }
.task-category-form > small { color: var(--muted); font-size: .62rem; }
.task-dialog { width: min(calc(100% - 1.5rem), 760px); }
.task-form { display: grid; padding: 1.25rem; gap: 1rem; }
.task-form .form-field > label small, .task-assignee-selector legend small { color: var(--muted); font-weight: 500; }
.task-form .form-field > input, .task-form .form-field > select, .task-form .form-field > textarea { width: 100%; min-width: 0; padding: .8rem .85rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbfbf9; font: inherit; outline: none; }
.task-form .form-field > input, .task-form .form-field > select { min-height: 48px; }
.task-form .form-field > textarea { resize: vertical; line-height: 1.5; }
.task-form .form-field > input:focus, .task-form .form-field > select:focus, .task-form .form-field > textarea:focus, .task-category-form input:focus, .task-filters select:focus, .task-card__actions select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,105,.13); }
.task-assignee-selector { min-width: 0; margin: 0; padding: 0; border: 0; }
.task-assignee-selector legend { margin-bottom: .55rem; color: var(--forest); font-size: .73rem; font-weight: 750; }
.task-assignee-selector > div { display: grid; gap: .45rem; }
.task-assignee-selector label { position: relative; min-width: 0; cursor: pointer; }
.task-assignee-selector input { position: absolute; opacity: 0; pointer-events: none; }
.task-assignee-selector label > span { display: flex; min-width: 0; min-height: 46px; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 8px; align-items: center; gap: .6rem; background: #fff; }
.task-assignee-selector input:checked + span { border-color: var(--gold); background: var(--gold-soft); }
.task-assignee-selector input:focus-visible + span { outline: 3px solid rgba(201,162,105,.3); outline-offset: 2px; }
.task-assignee-selector .avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; color: var(--forest); background: var(--gold); font-size: .58rem; font-style: normal; font-weight: 800; place-items: center; }
.task-assignee-selector strong { overflow: hidden; color: var(--forest); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.task-form__actions { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; }
.task-form__actions .primary-button { min-height: 46px; margin: 0; }

/* Contacts */
.contacts-toolbar { display: flex; margin-bottom: 1rem; align-items: stretch; flex-direction: column; gap: 1rem; }
.contacts-toolbar__heading { display: flex; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.contacts-toolbar__buttons { display: flex; align-items: center; gap: .55rem; }
.add-contact-button { display: grid; width: 46px; height: 46px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--forest); box-shadow: 0 8px 20px rgba(16, 42, 32, .18); cursor: pointer; place-items: center; }
.add-contact-button:hover { background: var(--forest-soft); }
.add-contact-button:focus-visible { outline: 3px solid rgba(201, 162, 105, .4); outline-offset: 3px; }
.add-contact-button span { margin-top: -2px; font-size: 1.8rem; font-weight: 300; line-height: 1; }
.import-contacts-button { display: grid; width: 46px; height: 46px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--forest); background: #fff; text-decoration: none; place-items: center; }
.import-contacts-button:hover { border-color: var(--gold); background: var(--gold-soft); }
.import-contacts-button:focus-visible { outline: 3px solid rgba(201, 162, 105, .4); outline-offset: 3px; }
.import-contacts-button .icon { width: 18px; height: 18px; }
.search-form { position: relative; display: flex; min-height: 48px; border: 1px solid var(--line); border-radius: 9px; align-items: center; background: var(--surface); }
.search-form > .icon { width: 18px; height: 18px; margin-left: .9rem; color: var(--muted); }
.search-form input { width: 100%; min-width: 0; height: 46px; padding: 0 .7rem; border: 0; color: var(--ink); background: transparent; outline: 0; }
.search-form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,105,.12); }
.search-form > a { display: grid; width: 42px; height: 46px; flex: 0 0 auto; color: var(--muted); font-size: 1.25rem; text-decoration: none; place-items: center; }

.contact-dialog { width: min(calc(100% - 1.5rem), 620px); max-height: min(90svh, 760px); padding: 0; overflow: hidden; border: 0; border-radius: 14px; color: var(--ink); background: transparent; box-shadow: 0 26px 80px rgba(10, 30, 23, .28); }
.contact-dialog::backdrop { background: rgba(10, 18, 15, .58); backdrop-filter: blur(3px); }
.contact-dialog__panel { max-height: min(90svh, 760px); overflow-y: auto; background: var(--surface); }
.contact-dialog__header { display: flex; padding: 1.4rem 1.4rem 1rem; border-bottom: 1px solid var(--line); align-items: flex-start; justify-content: space-between; gap: 1rem; }
.contact-dialog__header h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; letter-spacing: -.03em; }
.contact-dialog__header > button { display: grid; width: 38px; height: 38px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: var(--paper); font-size: 1.5rem; cursor: pointer; place-items: center; }
.contact-dialog__header > button:hover { color: var(--ink); background: var(--gold-soft); }
.manual-contact-form { display: grid; padding: 1.4rem; gap: 1rem; }
.manual-contact-form .form-field > input,
.manual-contact-form .form-field > select { width: 100%; min-width: 0; height: 48px; padding: 0 .85rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbfbf9; outline: none; }
.manual-contact-form .form-field > input:focus,
.manual-contact-form .form-field > select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 105, .13); }
.manual-contact-form__notice { margin: 0; padding: .8rem .9rem; border-radius: 8px; color: var(--muted); background: var(--paper); font-size: .72rem; }
.manual-contact-form__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .7rem; }
.manual-contact-form__actions .primary-button { min-height: 46px; margin: 0; }
.dialog-cancel-button { min-height: 46px; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; }
.dialog-cancel-button:hover { color: var(--ink); background: var(--paper); }
.tag-selector { min-width: 0; margin: 0; padding: 0; border: 0; }
.tag-selector legend { margin-bottom: .55rem; color: var(--forest); font-size: .73rem; font-weight: 750; }
.tag-selector > div { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag-selector label { position: relative; display: inline-flex; cursor: pointer; }
.tag-selector input { position: absolute; opacity: 0; pointer-events: none; }
.tag-selector label span { display: inline-flex; min-height: 38px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; align-items: center; color: var(--muted); background: #fff; font-size: .7rem; font-weight: 700; }
.tag-selector input:checked + span { border-color: var(--gold); color: var(--forest); background: var(--gold-soft); }
.tag-selector input:focus-visible + span { outline: 3px solid rgba(201, 162, 105, .35); outline-offset: 2px; }
.tag-selector > p { margin: 0; color: var(--muted); font-size: .75rem; }
.edit-contact-button { display: inline-flex; min-height: 38px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 7px; align-items: center; justify-content: center; gap: .45rem; color: var(--forest); background: #fff; font-size: .7rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.edit-contact-button:hover { border-color: var(--gold); background: var(--gold-soft); }
.edit-contact-button .icon { width: 16px; height: 16px; }
.contact-history { padding: 1.4rem; border-top: 1px solid var(--line); background: #fbfbf9; }
.contact-history h3 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 1.65rem; font-weight: 400; line-height: 1; }
.contact-history ol { margin: 1.2rem 0 0; padding: 0; list-style: none; }
.contact-history li { position: relative; display: grid; padding: 0 0 1.2rem; grid-template-columns: 14px minmax(0, 1fr); gap: .75rem; }
.contact-history li:not(:last-child)::before { position: absolute; top: 12px; bottom: 0; left: 5px; width: 1px; background: var(--line); content: ""; }
.contact-history__mark { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: .3rem; border: 2px solid #fff; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.contact-history li strong { display: block; color: var(--ink); font-size: .78rem; }
.contact-history li p { margin: .25rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.contact-history li small { display: block; margin-top: .3rem; color: #929995; font-size: .64rem; }
.contact-history__empty { margin: 1rem 0 0; color: var(--muted); font-size: .75rem; }
.tag-filters { display: flex; margin: -.25rem 0 1rem; padding-bottom: .25rem; overflow-x: auto; gap: .45rem; scrollbar-width: none; }
.tag-filters::-webkit-scrollbar { display: none; }
.tag-filters a { display: inline-flex; min-height: 36px; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 999px; align-items: center; gap: .4rem; color: var(--muted); background: var(--surface); font-size: .69rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tag-filters a span { display: grid; min-width: 20px; height: 20px; padding: 0 .3rem; border-radius: 999px; color: var(--muted); background: #f0f1ef; font-size: .6rem; place-items: center; }
.tag-filters a.is-active { border-color: var(--forest); color: #fff; background: var(--forest); }
.tag-filters a.is-active span { color: var(--forest); background: var(--gold); }
.tag-filter-summary { margin: -.45rem 0 1rem; color: var(--muted); font-size: .68rem; }
.content-card--table { overflow: visible; border: 0; background: transparent; }
.table-wrap { overflow: visible; }
table, thead, tbody, tr, th, td { display: block; }
thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
tbody { display: grid; gap: .75rem; }
tr { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
td { display: flex; min-width: 0; padding: .55rem 0; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .77rem; }
td::before { flex: 0 0 auto; color: #98a09c; content: attr(data-label); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
td:first-child { padding-top: 0; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
td:first-child::before { display: none; }
td:last-child { padding-bottom: 0; }
.contact-cell { display: flex; width: 100%; min-width: 0; align-items: center; gap: .75rem; }
.contact-cell > span:last-child { min-width: 0; }
.tag-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; }
.tag-chip { display: inline-flex; width: max-content; max-width: 180px; padding: .28rem .5rem; overflow: hidden; border-radius: 999px; color: #795d33; background: var(--gold-soft); font-size: .62rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.muted-dash { color: #aab0ad; }
.pagination { display: flex; margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; align-items: center; justify-content: space-between; gap: .75rem; color: var(--muted); background: var(--surface); font-size: .72rem; }
.pagination a, .pagination__disabled { padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 6px; color: var(--forest); text-decoration: none; }
.pagination__disabled { opacity: .4; }
.empty-state { display: flex; min-height: 260px; padding: 2rem; align-items: center; flex-direction: column; justify-content: center; text-align: center; }
.empty-state > span { display: grid; width: 56px; height: 56px; margin-bottom: 1rem; border-radius: 50%; color: var(--forest); background: var(--gold-soft); place-items: center; }
.empty-state h3 { margin: 0 0 .4rem; color: var(--forest); font-family: var(--serif); font-size: 1.8rem; font-weight: 400; }
.empty-state p { margin: 0; color: var(--muted); font-size: .8rem; }

/* Imports */
.import-alert { margin: 0 0 1rem; }
.import-result { display: flex; margin-bottom: 1rem; padding: 1.3rem; border: 1px solid #cde1d6; border-radius: 11px; align-items: flex-start; flex-direction: column; gap: 1rem; color: var(--success); background: var(--success-soft); }
.import-result > span { display: grid; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--success); place-items: center; }
.import-result h2 { margin: 0 0 .35rem; color: var(--forest); font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.import-result p:last-child { margin: 0; color: #5f7469; font-size: .8rem; }
.import-result .secondary-button { margin-top: .25rem; }
.import-grid { display: grid; margin-bottom: 1rem; gap: 1rem; }
.section-icon { display: grid; width: 40px; height: 40px; border-radius: 9px; color: var(--forest); background: var(--gold-soft); place-items: center; }
.import-form { display: grid; padding: 1.25rem; gap: 1.2rem; }
.form-field { display: grid; min-width: 0; gap: .45rem; }
.form-field > label:first-child { color: var(--forest); font-size: .73rem; font-weight: 750; }
.form-field > input[type="text"] { width: 100%; min-width: 0; height: 48px; padding: 0 .85rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbfbf9; outline: none; }
.form-field > input[type="text"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,105,.13); }
.form-field > small { color: var(--muted); font-size: .68rem; line-height: 1.45; }
.file-drop { display: flex; min-height: 150px; padding: 1.2rem; border: 1px dashed #c9c9bf; border-radius: 9px; align-items: center; flex-direction: column; justify-content: center; color: var(--forest); background: #fbfbf9; cursor: pointer; text-align: center; }
.file-drop:hover { border-color: var(--gold); background: #fdfaf4; }
.file-drop > span { display: grid; width: 42px; height: 42px; margin-bottom: .7rem; border-radius: 50%; background: var(--gold-soft); place-items: center; }
.file-drop strong { font-size: .76rem; }
.file-drop small { margin-top: .2rem; color: var(--muted); font-size: .66rem; }
.file-input { width: 100%; color: var(--muted); font-size: .72rem; }
.file-input::file-selector-button { margin-right: .7rem; padding: .55rem .7rem; border: 0; border-radius: 6px; color: var(--forest); background: var(--gold-soft); font: inherit; font-weight: 700; cursor: pointer; }
.column-mapping[hidden] { display: none; }
.column-mapping { display: grid; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; gap: 1rem; background: var(--paper); }
.column-mapping h3 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 1.55rem; font-weight: 400; line-height: 1; }
.column-mapping [data-mapping-status] { display: block; margin-top: .4rem; color: var(--muted); font-size: .66rem; }
.column-mapping__grid { display: grid; gap: .8rem; }
.column-mapping .form-field select { width: 100%; min-width: 0; height: 46px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
.column-mapping .form-field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,105,.13); }
.column-mapping > p { margin: 0; color: var(--muted); font-size: .68rem; }
.import-help { padding: 1.35rem; }
.import-help h2 { margin: 0 0 1.4rem; color: var(--forest); font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.import-help ol { display: grid; margin: 0; padding: 0; gap: 1rem; list-style: none; }
.import-help li { display: grid; grid-template-columns: auto 1fr; gap: .75rem; }
.import-help li > span { display: grid; width: 28px; height: 28px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: var(--serif); place-items: center; }
.import-help li strong { color: var(--forest); font-size: .76rem; }
.import-help li p { margin: .15rem 0 0; color: var(--muted); font-size: .7rem; }
.import-help code { font-size: .68rem; }
.csv-example { margin-top: 1.4rem; padding: .8rem; overflow-x: auto; border-radius: 7px; color: #405049; background: #f0f1ed; line-height: 1.7; }
.import-history { margin-top: 1rem; }
.import-list { padding: .2rem 1rem; }
.import-list article { display: grid; padding: 1rem .2rem; border-bottom: 1px solid var(--line); align-items: center; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; }
.import-list article:last-child { border-bottom: 0; }
.import-list__main { min-width: 0; }
.import-list__main strong, .import-list__main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-list__main strong { color: var(--forest); font-size: .78rem; }
.import-list__main small { margin-top: .12rem; color: var(--muted); font-size: .64rem; }
.import-list article > .tag-chip { grid-column: 2; }
.import-list__numbers { display: grid; grid-column: 1 / -1; padding-top: .7rem; border-top: 1px solid var(--line); align-items: baseline; grid-template-columns: repeat(6, auto); justify-content: start; gap: .25rem .45rem; }
.import-list__numbers strong { color: var(--forest); font-family: var(--serif); font-size: 1.2rem; font-weight: 400; }
.import-list__numbers small { margin-right: .45rem; color: var(--muted); font-size: .61rem; }

/* Mailings */
.mailings-toolbar { display: flex; margin-bottom: 1rem; align-items: center; justify-content: space-between; gap: 1rem; }
.mailings-toolbar h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.primary-button--compact { min-height: 44px; margin: 0; padding: .7rem .9rem; }
.mailings-layout { display: grid; gap: 1rem; }
.campaign-list { display: grid; min-width: 0; max-height: 380px; padding: .45rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; align-content: start; gap: .35rem; background: var(--surface); }
.campaign-list .empty-state { min-height: 220px; }
.campaign-list__item { display: grid; min-width: 0; padding: .9rem; border: 1px solid transparent; border-radius: 8px; gap: .3rem; color: var(--muted); text-decoration: none; }
.campaign-list__item:hover, .campaign-list__item.is-active { border-color: #e5dccd; background: #fbf7f0; }
.campaign-list__top { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .6rem; }
.campaign-list__item strong, .campaign-list__item > span:not(.campaign-list__top), .campaign-list__item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-list__item strong { min-width: 0; color: var(--forest); font-size: .8rem; }
.campaign-list__item > span:not(.campaign-list__top) { font-size: .7rem; }
.campaign-list__item small { color: #969d99; font-size: .62rem; }
.campaign-workspace { min-width: 0; }
.campaign-welcome { display: flex; min-height: 380px; padding: clamp(1.5rem, 5vw, 3rem); align-items: flex-start; flex-direction: column; justify-content: center; }
.campaign-welcome__icon { display: grid; width: 54px; height: 54px; margin-bottom: 1.3rem; border-radius: 50%; color: var(--forest); background: var(--gold-soft); place-items: center; }
.campaign-welcome h2 { max-width: 540px; margin: 0 0 .7rem; color: var(--forest); font-family: var(--serif); font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 400; line-height: 1; }
.campaign-welcome > p:not(.eyebrow) { max-width: 620px; margin: 0; color: var(--muted); }
.campaign-editor { display: grid; gap: 1rem; }
.campaign-editor__section { overflow: visible; }
.campaign-form-grid { display: grid; padding: 1.2rem; gap: 1rem; }
.campaign-editor .form-field > span, .campaign-delivery .form-field > span { color: var(--forest); font-size: .73rem; font-weight: 750; }
.campaign-editor .form-field input, .campaign-editor .form-field select, .campaign-editor .form-field textarea, .campaign-delivery .form-field input { width: 100%; min-width: 0; padding: .8rem .85rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbfbf9; font: inherit; outline: none; }
.campaign-editor .form-field input, .campaign-editor .form-field select, .campaign-delivery .form-field input { min-height: 48px; }
.campaign-editor .form-field textarea { resize: vertical; line-height: 1.55; }
.campaign-editor .form-field input:focus, .campaign-editor .form-field select:focus, .campaign-editor .form-field textarea:focus, .campaign-delivery .form-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,105,.13); }
.campaign-editor .form-field > small { color: var(--muted); font-size: .67rem; }
.campaign-content { min-height: 300px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; font-size: .78rem !important; }
.campaign-editor__section > .form-field { padding: 1.2rem; }
.campaign-editor__section > .form-field + .form-field { padding-top: 0; }
.personalization-help { margin: 0; padding: 0 1.2rem 1.25rem; color: var(--muted); font-size: .7rem; }
.personalization-help code { padding: .16rem .28rem; border-radius: 4px; color: var(--forest); background: var(--gold-soft); }
.campaign-editor__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.campaign-editor__actions .primary-button { min-height: 46px; margin: 0; }
.campaign-delivery { margin-top: 1rem; }
.audience-count { padding: .35rem .6rem; border-radius: 999px; color: var(--forest); background: var(--gold-soft); font-size: .68rem; font-weight: 750; white-space: nowrap; }
.campaign-delivery__grid { display: grid; padding: 1.2rem; gap: 1rem; }
.campaign-delivery__grid form { display: flex; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 9px; align-items: stretch; flex-direction: column; justify-content: space-between; gap: 1rem; }
.campaign-delivery__grid form > p { margin: 0; color: var(--muted); font-size: .75rem; }
.campaign-delivery__grid form > p strong { color: var(--forest); }
.campaign-delivery__grid .primary-button, .campaign-delivery__grid .secondary-button { min-height: 46px; margin: 0; }
.campaign-status-panel { padding-bottom: 1.2rem; }
.campaign-subject { margin: 0; padding: 1.2rem; color: var(--muted); }
.campaign-metrics { display: grid; padding: 0 1.2rem 1.2rem; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .7rem; }
.campaign-metrics > div { padding: 1rem; border-radius: 8px; background: var(--paper); }
.campaign-metrics strong, .campaign-metrics span { display: block; }
.campaign-metrics strong { color: var(--forest); font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.campaign-metrics span { margin-top: .3rem; color: var(--muted); font-size: .65rem; }
.campaign-status-panel > .campaign-editor__actions { padding: 0 1.2rem; }
.campaign-status-panel > .campaign-editor__actions form { margin: 0; }
.campaign-status-panel > .campaign-editor__actions .primary-button, .campaign-status-panel > .campaign-editor__actions .secondary-button { min-height: 44px; margin: 0; }
.campaign-recipients { margin-top: 1rem; }
.engagement-filters { display: flex; padding: 1rem 1.2rem; overflow-x: auto; gap: .45rem; }
.engagement-filters a { padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .68rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.engagement-filters a.is-active { border-color: var(--forest); color: #fff; background: var(--forest); }
.contact-mail-history { padding: 1.4rem; border-top: 1px solid var(--line); background: #fff; }
.contact-mail-history h3 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 1.65rem; font-weight: 400; }
.contact-mail-list { display: grid; margin-top: 1rem; gap: .65rem; }
.contact-mail-list article { padding: .9rem; border: 1px solid var(--line); border-radius: 8px; }
.contact-mail-list article > div > strong, .contact-mail-list article > div > small { display: block; }
.contact-mail-list article > div > strong { color: var(--forest); font-size: .76rem; }
.contact-mail-list article > div > small { margin-top: .15rem; color: var(--muted); font-size: .65rem; }
.contact-mail-list dl { display: grid; margin: .75rem 0 0; grid-template-columns: 1fr; gap: .35rem; }
.contact-mail-list dl > div { display: flex; justify-content: space-between; gap: .7rem; font-size: .64rem; }
.contact-mail-list dt { color: var(--muted); }
.contact-mail-list dd { margin: 0; color: var(--ink); text-align: right; }
.status--campaign-draft { color: #6c655a; background: #eeeae2; }
.status--campaign-queued, .status--campaign-sending { color: #755d2f; background: var(--gold-soft); }
.status--campaign-sent { color: var(--success); background: var(--success-soft); }
.status--campaign-failed { color: var(--danger); background: var(--danger-soft); }

/* Inzichten */
.insights-toolbar { display: flex; margin-bottom: 1rem; align-items: flex-end; flex-direction: column; gap: 1rem; }
.insights-toolbar h2, .insights-section__heading h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.range-switcher { display: flex; width: max-content; max-width: 100%; padding: .25rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.range-switcher a { padding: .55rem .7rem; border-radius: 6px; color: var(--muted); font-size: .68rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.range-switcher a.is-active { color: #fff; background: var(--forest); }
.insights-setup { display: flex; min-height: 440px; padding: clamp(1.5rem,5vw,3rem); align-items: flex-start; flex-direction: column; justify-content: center; }
.insights-setup h2 { max-width: 650px; margin: 0 0 .7rem; color: var(--forest); font-family: var(--serif); font-size: clamp(2rem,7vw,3.2rem); font-weight: 400; line-height: 1; }
.insights-setup > p:not(.eyebrow) { max-width: 680px; margin: 0; color: var(--muted); }
.insights-setup dl { display: grid; width: 100%; max-width: 680px; margin: 1.5rem 0 0; gap: .55rem; }
.insights-setup dl > div { display: grid; padding: .8rem; border-radius: 7px; background: var(--paper); gap: .2rem; }
.insights-setup dt { color: var(--muted); font-size: .65rem; }
.insights-setup dd { margin: 0; overflow-wrap: anywhere; color: var(--forest); font-size: .7rem; }
.insights-section { margin-top: 1.7rem; }
.insights-section__heading { margin-bottom: .9rem; }
.insights-stat-grid { margin-bottom: 1rem; }
.insights-grid { display: grid; margin-bottom: 1rem; gap: 1rem; }
.insights-chart-card, .insights-table-card { min-width: 0; }
.insights-timeline { display: flex; min-height: 250px; padding: 1.2rem; overflow-x: auto; align-items: flex-end; gap: .55rem; }
.insights-timeline__day { display: grid; min-width: 34px; height: 210px; grid-template-rows: auto minmax(100px,1fr) auto; align-items: end; justify-items: center; gap: .45rem; }
.insights-timeline__day > span { color: var(--muted); font-size: .58rem; }
.insights-timeline__day > small { width: 34px; overflow: hidden; color: transparent; font-size: 0; }
.insights-timeline meter { width: 22px; height: 150px; writing-mode: vertical-rl; direction: rtl; }
.insights-timeline meter::-webkit-meter-bar { border: 0; border-radius: 4px; background: var(--paper); }
.insights-timeline meter::-webkit-meter-optimum-value { border-radius: 4px; background: var(--gold); }
.insights-timeline meter::-moz-meter-bar { border-radius: 4px; background: var(--gold); }
.insights-table-card--full { margin-bottom: 1rem; }

/* Beheer */
.settings-status-grid { display: grid; margin-bottom: 1rem; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.settings-grid { display: grid; margin-bottom: 1rem; gap: 1rem; }
.settings-form { overflow: visible; }
.settings-form__body { display: grid; padding: 1.2rem; gap: 1.2rem; }
.settings-fields { display: grid; gap: .9rem; }
.settings-form .form-field > span, .settings-action-card .form-field > span { color: var(--forest); font-size: .72rem; font-weight: 750; }
.settings-form input, .settings-form select, .settings-action-card input { width: 100%; min-width: 0; min-height: 47px; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbfbf9; font: inherit; outline: none; }
.settings-form input:focus, .settings-form select:focus, .settings-action-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,105,.13); }
.settings-form .form-field small { color: var(--muted); font-size: .65rem; }
.settings-toggle { display: flex; padding: 1rem; border: 1px solid var(--line); border-radius: 9px; align-items: flex-start; gap: .8rem; cursor: pointer; }
.settings-toggle input { width: 18px; min-height: 18px; margin-top: .15rem; flex: 0 0 auto; accent-color: var(--forest); }
.settings-toggle strong, .settings-toggle small { display: block; }
.settings-toggle strong { color: var(--forest); font-size: .77rem; }
.settings-toggle small { margin-top: .2rem; color: var(--muted); font-size: .67rem; }
.settings-toggle--cron { background: var(--paper); }
.settings-form__body > .primary-button { width: max-content; min-height: 46px; margin: 0; }
.settings-side { display: grid; gap: 1rem; }
.settings-action-card { display: flex; padding: 1.2rem; align-items: stretch; flex-direction: column; justify-content: space-between; gap: 1.2rem; }
.settings-action-card h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 1.8rem; font-weight: 400; }
.settings-action-card p:last-child { margin: .5rem 0 0; color: var(--muted); font-size: .72rem; }
.settings-action-card form { display: grid; gap: .8rem; }
.settings-action-card .primary-button, .settings-action-card .secondary-button { min-height: 45px; margin: 0; }
.settings-table-card { margin-top: 1rem; }
.settings-table-card td:first-child strong, .settings-table-card td:first-child small { display: block; }
.settings-table-card td:first-child small, .queue-error { margin-top: .2rem; color: var(--muted); font-size: .61rem; }
.queue-error { display: block; max-width: 280px; white-space: normal; }

@media (min-width: 720px) {
    .main-content { padding: 2rem; }
    .topbar__date { display: block; }
    .welcome-card { padding: 2rem; align-items: flex-end; flex-direction: row; justify-content: space-between; }
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stat-card { padding: 1.35rem; }
    .recent-contact { grid-template-columns: auto minmax(0, 1fr) auto; }
    .recent-contact .status { grid-column: auto; justify-self: end; }
    .tag-list { justify-content: flex-start; }
    .contacts-toolbar { align-items: flex-end; flex-direction: row; justify-content: space-between; }
    .tasks-toolbar { align-items: flex-end; flex-direction: row; justify-content: space-between; }
    .task-filters form { width: auto; margin: 0 0 0 auto; }
    .task-card { grid-template-columns: auto minmax(0, 1fr) auto; }
    .task-card__actions { grid-column: auto; }
    .task-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 1.4rem; }
    .task-assignee-selector > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contacts-toolbar__heading { flex: 1 1 auto; justify-content: flex-start; }
    .search-form { width: min(100%, 360px); }
    .manual-contact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-field--full, .manual-contact-form__notice, .manual-contact-form__actions { grid-column: 1 / -1; }
    .column-mapping__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .content-card--table { overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
    .table-wrap { overflow-x: auto; }
    table { display: table; width: 100%; border-collapse: collapse; }
    thead { position: static; display: table-header-group; width: auto; height: auto; overflow: visible; clip: auto; }
    tbody { display: table-row-group; }
    tr { display: table-row; padding: 0; border: 0; border-radius: 0; background: transparent; }
    th, td { display: table-cell; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
    th { color: #8a928e; background: #fbfbf9; font-size: .65rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
    td { color: var(--muted); font-size: .76rem; }
    td::before { display: none; }
    td:first-child { width: 45%; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
    td:last-child { padding-bottom: 1rem; }
    tbody tr:last-child td { border-bottom: 0; }
    .pagination { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
    .import-result { align-items: center; flex-direction: row; }
    .import-result .secondary-button { margin: 0 0 0 auto; flex: 0 0 auto; }
    .import-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); }
    .import-list article { grid-template-columns: auto minmax(0, 1fr) auto minmax(240px, auto); }
    .import-list article > .tag-chip { grid-column: auto; }
    .import-list__numbers { grid-column: auto; padding: 0; border: 0; justify-content: end; }
    .campaign-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .campaign-delivery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .campaign-metrics { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
    .contact-mail-list dl { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .contact-mail-list dl > div { display: block; }
    .contact-mail-list dd { margin-top: .15rem; text-align: left; }
    .settings-status-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .insights-toolbar { align-items: flex-end; flex-direction: row; justify-content: space-between; }
    .insights-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .insights-grid--wide { grid-template-columns: minmax(0,1.5fr) minmax(280px,.5fr); }
    .settings-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .settings-fields .form-field--full { grid-column: 1/-1; }
}

@media (min-width: 980px) {
    .app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
    .sidebar { position: sticky; top: 0; display: flex; height: 100svh; padding: 2rem 1.3rem 1.4rem; flex-direction: column; color: rgba(255,255,255,.68); background: var(--forest); }
    .sidebar .admin-brand { margin: 0 .65rem 3.2rem; color: #fff; }
    .side-nav { display: grid; gap: .3rem; }
    .side-nav a, .side-nav > .nav-item { display: flex; min-height: 46px; padding: .65rem .8rem; border-radius: 7px; align-items: center; gap: .85rem; color: rgba(255,255,255,.62); font-size: .76rem; font-weight: 650; text-decoration: none; }
    .side-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
    .side-nav a.is-active { color: var(--forest); background: var(--gold); }
    .side-nav .nav-item--disabled { color: rgba(255,255,255,.28); cursor: not-allowed; }
    .side-nav .nav-item--disabled small { margin-left: auto; color: rgba(255,255,255,.22); font-size: .52rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
    .sidebar__footer { display: flex; margin-top: auto; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.12); align-items: center; justify-content: space-between; gap: .5rem; }
    .sidebar-user { display: flex; min-width: 0; align-items: center; gap: .65rem; }
    .sidebar-user > span:last-child { min-width: 0; }
    .sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sidebar-user strong { max-width: 105px; color: #fff; font-size: .72rem; }
    .sidebar-user small { color: rgba(255,255,255,.46); font-size: .62rem; }
    .avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; color: var(--forest); background: var(--gold); font-size: .66rem; font-weight: 800; place-items: center; }
    .icon-button { display: grid; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 7px; color: rgba(255,255,255,.55); background: transparent; cursor: pointer; place-items: center; }
    .icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }
    .icon-button .icon { width: 18px; height: 18px; }
    .main-content { max-width: 1440px; padding: 2.5rem clamp(2rem, 4vw, 4.5rem) 4rem; }
    .topbar { margin-bottom: 2rem; }
    .mobile-nav { display: none; }
    .welcome-card, .stat-grid { margin-bottom: 1.25rem; }
    .mailings-layout { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); align-items: start; }
    .campaign-list { position: sticky; top: 1.5rem; max-height: calc(100svh - 3rem); }
    .settings-grid { grid-template-columns: minmax(0,1.5fr) minmax(280px,.5fr); align-items: start; }
    .tasks-layout { grid-template-columns: minmax(0, 1fr) 270px; }
    .task-categories { position: sticky; top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
