:root {
    --ink: #20312a;
    --muted: #64756d;
    --line: #d9e3dc;
    --field: #f7faf7;
    --paper: #ffffff;
    --wash: #eef5ef;
    --green: #2f6f4e;
    --green-dark: #244f39;
    --gold: #d8a840;
    --danger: #b9463f;
    --nav-bg: var(--paper);
    --input-bg: var(--paper);
    --input-text: var(--ink);
    --table-heading-bg: var(--green-dark);
    --table-heading-text: #ffffff;
    --success-bg: #e2f4e8;
    --success-text: var(--green-dark);
    --error-bg: #fde7e4;
    --warning-bg: #fff8df;
    --warning-text: #513e0b;
    --chart-bg: #ffffff;
    --radius: 8px;
    --base-font-size: 100%;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--wash);
    line-height: 1.45;
    font-size: var(--base-font-size);
}

body.text-small { --base-font-size: 90%; }
body.text-medium { --base-font-size: 100%; }
body.text-large { --base-font-size: 120%; }
body.theme-light { color-scheme: light; }
body.theme-dark {
    color-scheme: dark;
    --ink: #e5eee8;
    --muted: #a9b9b0;
    --line: #30463b;
    --field: #17241e;
    --paper: #102018;
    --wash: #07130d;
    --green: #63b987;
    --green-dark: #8ed6aa;
    --gold: #e1bb62;
    --danger: #ee867d;
    --nav-bg: #0c1a13;
    --input-bg: #0b1811;
    --input-text: #f1f7f3;
    --table-heading-bg: #183425;
    --table-heading-text: #f6fff9;
    --success-bg: #163623;
    --success-text: #a8e2bd;
    --error-bg: #3a1817;
    --warning-bg: #352a10;
    --warning-text: #f1d990;
    --chart-bg: #0b1811;
}
/* Future-ready system default: when the user keeps Appearance set to
   "System default", browsers with dark preference can use the dark palette. */
@media (prefers-color-scheme: dark) {
    body.theme-system {
        color-scheme: dark;
        --ink: #e5eee8;
        --muted: #a9b9b0;
        --line: #30463b;
        --field: #17241e;
        --paper: #102018;
        --wash: #07130d;
        --green: #63b987;
        --green-dark: #8ed6aa;
        --gold: #e1bb62;
        --danger: #ee867d;
        --nav-bg: #0c1a13;
        --input-bg: #0b1811;
        --input-text: #f1f7f3;
        --table-heading-bg: #183425;
        --table-heading-text: #f6fff9;
        --success-bg: #163623;
        --success-text: #a8e2bd;
        --error-bg: #3a1817;
        --warning-bg: #352a10;
        --warning-text: #f1d990;
        --chart-bg: #0b1811;
    }
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--line);
    padding: 3px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

.brand:hover {
    text-decoration: none;
}

.header-brand-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.environment-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: .18rem .48rem;
    font-size: .65rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .04em;
    white-space: nowrap;
}

.environment-badge--staging { background: #f2b84b; color: #2b2109; }
.environment-badge--development { background: #4d9de0; color: #071d2f; }
.environment-badge--demo { background: #9b72cf; color: #190d29; }

.brand-logo {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    gap: 2px;
    line-height: 1.1;
}
.brand-copy strong { font-size: .92rem; }

.brand-copy small {
    color: var(--muted);
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    background: var(--green);
    color: white;
}

.farm-logo {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--wash);
    color: var(--green-dark);
    font-weight: 900;
    font-size: .78rem;
}

.farm-logo.large {
    width: 72px;
    height: 72px;
    font-size: 1.35rem;
}

.farm-logo-placeholder { background: #e8f3e4; }

.menu-toggle {
    display: inline-flex;
    min-height: 36px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.account-menu {
    position: relative;
}

.account-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    width: auto;
    max-width: min(280px, 46vw);
    padding: 5px 9px;
    border-radius: var(--radius);
    background: var(--green);
    color: white;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-toggle span { overflow: hidden; text-overflow: ellipsis; }

.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    min-width: 230px;
    padding: 8px;
    display: none;
    gap: 4px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(32, 49, 42, 0.14);
}

.account-menu.open .account-dropdown {
    display: grid;
}

.account-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 10px 4px 4px;
    border-top: 1px solid var(--line);
}

.account-user span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.account-user strong {
    display: block;
    max-width: 190px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-user small {
    display: block;
    max-width: 190px;
    overflow-wrap: anywhere;
}

.account-signout {
    color: var(--danger) !important;
}

.account-farm-switcher {
    padding: 4px 4px 8px;
    border-bottom: 1px solid var(--line);
}

.account-farm-switcher label {
    gap: 6px;
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}

.account-farm-switcher select {
    width: 100%;
    min-height: 40px;
    margin-top: 2px;
    color: var(--ink);
    text-transform: none;
    font-weight: 700;
}

.account-menu-group {
    display: grid;
    gap: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.account-dropdown a {
    display: block;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 700;
}

.account-dropdown a:hover {
    background: var(--wash);
    text-decoration: none;
}

.account-menu-help {
    border-bottom: 0;
}

.main-nav {
    display: none;
    position: absolute;
    top: 46px;
    left: 10px;
    right: 10px;
    padding: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(32, 49, 42, 0.14);
}

.main-nav.open { display: grid; gap: 8px; }
.main-nav a { width: 100%; padding: 8px 9px; }

.public-nav { display: flex; align-items: center; gap: 4px; }
.public-nav a { padding: 7px 8px; font-size: .9rem; font-weight: 700; }

.page-shell {
    flex: 1 0 auto;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 8px 14px 36px;
}

.app-footer {
    flex: 0 0 auto;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 0 14px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: baseline;
    color: var(--muted);
    font-size: .9rem;
}

.app-footer strong {
    color: var(--ink);
}

.feedback-tab {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 30;
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 0 8px 20px rgba(24, 50, 38, .14);
    color: var(--green-dark);
    font-weight: 800;
}

.feedback-tab:hover {
    background: var(--wash);
    text-decoration: none;
}

.hero, .auth-card, .panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.hero {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    background:
        linear-gradient(rgba(0,0,0,.56), rgba(0,0,0,.46)),
        url("https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=1400&q=70") center 48%/cover;
}
.homepage-beta-hero {
    --hero-text: #ffffff;
    --hero-muted: rgba(255,255,255,.88);
    --hero-card-bg: rgba(255,255,255,.92);
    --hero-card-text: #20312a;
    min-height: calc(100vh - 140px);
    padding: clamp(24px, 6vw, 56px);
    border-color: transparent;
    color: var(--hero-text);
}
.homepage-copy { max-width: 760px; }
.homepage-beta-hero .eyebrow { color: #b8f0cb; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.homepage-beta-hero h1 {
    max-width: 720px;
    color: var(--hero-text);
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.hero-intro {
    max-width: 660px;
    color: var(--hero-text);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.6;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,.32);
}
.beta-callout {
    margin: 22px 0;
    max-width: 720px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.55);
    border-left: 5px solid var(--green);
    border-radius: var(--radius);
    background: var(--hero-card-bg);
    color: var(--hero-card-text);
    box-shadow: 0 14px 34px rgba(0,0,0,.24);
}
.beta-callout h2 { margin: 8px 0 6px; }
.beta-callout p { margin: 8px 0 0; }
.beta-badge { background: var(--green); color: white; }
.signin-direction {
    max-width: 620px;
    color: var(--hero-muted);
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.hero h1, .page-header h1 {
    margin: 0;
    font-size: clamp(2rem, 8vw, 4.5rem);
    letter-spacing: 0;
}
.page-header {
    margin-bottom: 16px;
    padding: 4px 2px 8px;
}
.compact-layout .page-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 8px; margin-bottom: 10px; }
.compact-layout .page-header h1 { font-size: clamp(1.45rem, 4vw, 2.2rem); line-height: 1.08; }
.compact-layout .page-header p { margin: 3px 0 0; }

.eyebrow {
    color: var(--green);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .78rem;
}

.auth-card { max-width: 460px; margin: 28px auto; }
.auth-brand { margin-bottom: 20px; }
.auth-brand h1 { margin: 0 0 4px; font-size: 2rem; }
.auth-brand p { margin: 0; color: var(--green); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.auth-card h2 { margin-top: 0; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 16px; }
.auth-links [aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.verification-warning, .billing-warning { border: 1px solid #d5a72a; background: var(--warning-bg); color: var(--warning-text); }
.verification-warning form { margin: 12px 0 8px; }
.billing-warning { margin-bottom: 16px; padding: 12px; border-radius: var(--radius); }
.panel { margin-bottom: 16px; }
.pricing-grid { display: grid; gap: 12px; }
.pricing-card { display: grid; align-content: start; gap: 8px; }
.pricing-card h2, .pricing-card p, .pricing-card ul { margin: 0; }
.pricing-card small { color: var(--muted); }
.plan-price { font-size: 1.35rem; color: var(--green-dark); }
.early-release-note, .prose-panel { max-width: 850px; }
.field-note { color: var(--muted); font-size: .82rem; font-weight: 400; }
.form-intro { margin: 0 0 14px; color: var(--muted); }
.muted { color: var(--muted); }
.animal-form-section { padding-top: 4px; border-top: 1px solid var(--line); }
.wide { grid-column: 1 / -1; }

.grid, .dashboard-grid, .card-grid {
    display: grid;
    gap: 16px;
}

.dashboard-grid { grid-template-columns: 1fr; }
.grid.two-col { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dashboard-widget-slot { min-width: 0; }
.dashboard-widget-slot > .panel { height: calc(100% - 16px); }
.dashboard-widget:has(.dashboard-widget-scroll) { display: flex; flex-direction: column; }
.dashboard-widget-scroll {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}
.dashboard-widget-slot.widget-size-large .dashboard-widget-scroll,
.dashboard-widget-slot.widget-size-full .dashboard-widget-scroll {
    max-height: 460px;
}
.dashboard-widget-slot.widget-size-small .dashboard-widget-scroll {
    max-height: 330px;
}
.weather-location { display: grid; gap: 2px; margin: 5px 0 12px; }
.weather-location small { display: block; }
.weather-forecast-list { display: grid; gap: 7px; }
.weather-forecast-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.weather-forecast-item > div { display: grid; }
.weather-forecast-item b { white-space: nowrap; }
.weather-icon { font-size: 1.55rem; line-height: 1; text-align: center; }
.two { grid-template-columns: 1fr; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.stack-form, .form-grid, .quick-form, .filter-grid, .permission-form {
    display: grid;
    gap: 12px;
}

.form-grid, .filter-grid, .quick-form {
    grid-template-columns: 1fr;
}

.filter-panel {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}
.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 10px 14px;
    color: var(--green-dark);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}
.filter-toggle::-webkit-details-marker { display: none; }
.filter-toggle::after { content: "+"; font-size: 1.25rem; }
.filter-panel[open] .filter-toggle::after { content: "−"; }
.filter-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 35%, transparent); outline-offset: -3px; }
.filter-panel.filters-active { border-color: var(--green); }
.filter-panel.filters-active .filter-toggle { background: var(--wash); }
.active-filter-badge { display: inline-grid; place-items: center; min-width: 25px; height: 25px; margin-left: auto; padding: 0 7px; border-radius: 999px; background: var(--green); color: white; font-size: .78rem; }
.filter-panel-body { padding: 12px; border-top: 1px solid var(--line); }
.filter-panel:not([open]) .filter-panel-body { display: none; }
.active-filter-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.active-filter-summary span { padding: 5px 8px; border-radius: 999px; background: var(--wash); color: var(--muted); font-size: .8rem; }
.clear-filters { display: inline-flex; margin-top: 10px; padding: 7px 2px; color: var(--danger); font-weight: 700; }

label { display: grid; gap: 6px; font-weight: 700; }

input, select, textarea, button, .button {
    min-height: 46px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 10px 12px;
    font: inherit;
}

input, select, textarea {
    background: var(--input-bg);
    color: var(--input-text);
}

textarea { min-height: 96px; resize: vertical; }

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: white;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

button:hover, .button:hover { background: var(--green-dark); text-decoration: none; }
.button.secondary, button.secondary { background: var(--field); color: var(--green-dark); border: 1px solid var(--line); }
.button.secondary:hover, button.secondary:hover { background: var(--wash); }
.button-row, .inline-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.button-row .button, .inline-controls > * { flex: 1 1 160px; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px; border-radius: var(--radius); background: var(--field); border: 1px solid var(--line); font-weight: 700; }
.flash.success { background: var(--success-bg); color: var(--success-text); }
.flash.error { background: var(--error-bg); color: var(--danger); }

.card-list { display: grid; gap: 10px; }
.mini-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--field);
}
.mini-card span, .empty, small { color: var(--muted); }
.danger { border-color: #e7b1aa; background: #fff1ef; }
.alert-panel { border-color: #e7b1aa; }
.big-number { font-size: 2.3rem; font-weight: 800; margin: 0; color: var(--green); }
.metric-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }

.farm-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.paddock-tile {
    min-height: 110px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #e8f3e4;
    display: grid;
    gap: 6px;
}
.paddock-tile em { color: var(--green-dark); font-weight: 700; }
.paddock-tile:hover { border-color: var(--green); text-decoration: none; }
.paddock-date-summary { display: grid; gap: 3px; margin-bottom: 10px; }

.timeline { display: grid; gap: 14px; }
.timeline article {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 6px solid var(--green);
    border-radius: var(--radius);
    padding: 14px;
}
.timeline.compact article { border-left-width: 4px; }
.timeline time { color: var(--muted); font-size: .9rem; }
.timeline h2, .timeline h3 { margin: 6px 0; }
.diary-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--muted);
    font-size: .9rem;
}

.diary-card-footer time {
    color: inherit;
    font-size: inherit;
}

.activity-summary-details {
    margin-top: 10px;
}

.activity-summary-details summary {
    cursor: pointer;
    color: var(--green-dark);
    font-weight: 800;
}
.badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f4e6bd;
    color: #6b4c13;
    font-weight: 700;
    font-size: .82rem;
}

.compact-page-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; }
.compact-page-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.compact-page-header p { margin: 4px 0 0; }
.page-actions .button { width: auto; min-height: 38px; padding: 7px 11px; }
.compact-panel { padding: 12px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading h2 { margin: 0; }
.task-card { color: var(--ink); }
.task-card:hover { text-decoration: none; border-color: var(--green); }
.task-form .full-field, .task-filters .filter-actions { grid-column: 1 / -1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.view-switcher .active { border-color: var(--green); background: var(--wash); color: var(--green-dark); }
.kanban-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 86vw); gap: 12px; overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x proximity; }
.kanban-column { min-height: 420px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); scroll-snap-align: start; transition: border-color .15s, background .15s; }
.kanban-column.drag-over { border-color: var(--green); background: var(--wash); }
.kanban-column-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.kanban-column-heading h2 { margin: 0; font-size: 1rem; }
.kanban-card-list { display: grid; align-content: start; gap: 9px; min-height: 350px; }
.kanban-card { display: grid; gap: 8px; padding: 11px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); background: var(--field); box-shadow: 0 2px 5px rgba(24, 50, 38, .07); }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.dragging { opacity: .45; }
.kanban-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kanban-card-heading a { color: var(--ink); }
.kanban-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.kanban-card-meta { display: grid; gap: 2px; color: var(--muted); font-size: .78rem; }
.kanban-status-form { display: flex; gap: 6px; margin: 2px 0 0; }
.kanban-status-form label { flex: 1; }
.kanban-status-form select, .kanban-status-form button { min-height: 36px; padding: 6px; font-size: .8rem; }
.kanban-empty { padding: 22px 8px; color: var(--muted); text-align: center; }
.task-indicators, .task-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.task-tags span { padding: 2px 6px; border-radius: 999px; background: var(--wash); color: var(--green-dark); font-size: .72rem; }
.priority-border-urgent { border-left-color: #7f1d1d; }
.priority-border-high { border-left-color: #c4473c; }
.priority-border-medium { border-left-color: #d5a72a; }
.priority-border-low { border-left-color: var(--green); }
.task-overdue { background: #fff7f5; }
.task-list-group + .task-list-group { margin-top: 12px; }
.task-capture-dialog { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.task-capture-dialog::backdrop { background: rgba(12, 26, 19, .55); }
.task-capture-dialog .dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-capture-dialog h2 { margin-top: 0; }
.task-capture-dialog details { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.task-capture-dialog summary { cursor: pointer; font-weight: 800; }
.task-capture-details { margin-top: 12px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.filter-actions { display: flex; gap: 8px; align-items: end; }
.filter-actions > * { flex: 1; }
.trend-filter-form { margin-bottom: 14px; }
.trend-chart-card { display: grid; gap: 10px; }
.trend-chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.trend-chart-heading h3 { margin: 0; }
.trend-chart-wrap { height: 240px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--chart-bg); }
.trend-chart { width: 100%; height: 100%; overflow: visible; }
.trend-axis { stroke: var(--line); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.trend-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trend-line-1, .trend-swatch-1 { stroke: var(--green); background: var(--green); }
.trend-line-2, .trend-swatch-2 { stroke: var(--gold); background: var(--gold); }
.trend-line-3, .trend-swatch-3 { stroke: #28537a; background: #28537a; }
.trend-legend, .trend-point-summary { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: .86rem; }
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 999px; }
.trend-point-summary article { display: grid; gap: 2px; min-width: min(220px, 100%); }
.trend-empty { padding: 22px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--field); }
.overdue-row { background: #fff7f5; }
.danger-badge { color: var(--danger); background: #fde7e4; margin-left: 5px; }
.priority-urgent { background: #7f1d1d; color: white; }
.priority-high { background: #fde7e4; color: #8b2924; }
.status-completed { background: #e2f4e8; color: var(--green-dark); }
.status-complete { background: #e2f4e8; color: var(--green-dark); }
.status-backlog { background: #ecefec; color: var(--ink); }
.status-planned { background: #fff4cf; color: #5e4706; }
.status-cancelled { background: #ecefec; color: var(--muted); }
.status-in-progress { background: #e6eef8; color: #28537a; }
.category-row.archived { opacity: .65; }
.herd-card.archived { opacity: .72; }
.herd-edit-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.herd-bulk-actions { margin-bottom: 12px; justify-content: flex-start; }
.herd-bulk-actions select { max-width: 320px; }

.calendar-nav { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 10px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.calendar-toolbar .calendar-nav { margin-bottom: 0; }
.calendar-overlay-toggle label { display: flex; align-items: center; gap: 7px; }
.calendar-overlay-toggle input { width: auto; min-height: auto; }
.calendar-legend { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.last-year-swatch { width: 22px; height: 12px; border: 1px dashed var(--muted); background: #eef1ef; opacity: .65; }
.calendar-scroll { overflow-x: auto; margin-bottom: 16px; }
.calendar-nav .button { width: auto; min-height: 38px; }
.task-calendar { min-width: 720px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.calendar-weekdays, .calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays strong { padding: 7px; text-align: center; background: var(--green-dark); color: white; }
.calendar-day { min-height: 125px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-day time { font-weight: 700; }
.calendar-day.outside-month { background: var(--field); color: var(--muted); }
.calendar-day.today time { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: white; }
.calendar-tasks { display: grid; gap: 4px; margin-top: 5px; }
.calendar-task { display: grid; padding: 5px; border-left: 3px solid var(--gold); border-radius: 4px; background: var(--field); color: var(--ink); font-size: .78rem; }
.calendar-task:hover { text-decoration: none; background: var(--wash); }
.calendar-task.range-middle { border-left-color: var(--green); border-radius: 0 4px 4px 0; }
.calendar-task.range-end { border-left-color: var(--green); border-radius: 0 4px 4px 0; }
.calendar-task.range-start:not(.range-end) { border-right: 3px solid var(--green); }
.calendar-task .date-range { color: var(--muted); font-weight: 700; }
.calendar-task.overdue { border-left-color: var(--danger); background: #fff1ef; }
.calendar-task.previous-year-task { opacity: .58; border: 1px dashed var(--muted); border-left: 3px solid var(--muted); background: #eef1ef; }
.previous-year-task a { color: var(--ink); }
.historical-copy-link { margin-top: 3px; font-size: .72rem; font-weight: 700; }
.calendar-date-link { display: flex; align-items: center; justify-content: space-between; color: var(--ink); border-radius: 4px; }
.calendar-date-link span { color: var(--green); font-size: 1.1rem; font-weight: 800; }
.calendar-date-link:hover { text-decoration: none; background: var(--wash); }
.weekday-picker { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.weekday-picker legend { font-weight: 700; }
.weekday-picker label { display: inline-flex; align-items: center; gap: 4px; margin: 4px 12px 4px 0; font-weight: 400; }
.weekday-picker input { width: auto; min-height: auto; }
.recurrence-section { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.recurrence-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.recurrence-header h2 { margin: 0 0 4px; }
.recurrence-summary { margin: 0; }
.recurrence-fields { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger-link { color: var(--danger); border-color: #e7b1aa; }
.roster-calendar-item { display: grid; gap: 5px; padding: 6px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 5px; background: var(--field); font-size: .78rem; }
.roster-status-absent { border-color: #e7b1aa; background: #fff1ef; }
.roster-status-substituted { border-color: #9ab7d1; background: #eef5fb; }
.roster-warning { color: var(--danger); font-weight: 700; }
.compact-roster-form select, .compact-roster-form button { min-height: 34px; padding: 4px 6px; font-size: .75rem; }
.roster-calendar-item .inline-controls { gap: 4px; }
.roster-calendar-item .inline-controls > * { min-height: 32px; padding: 4px; flex-basis: 65px; font-size: .72rem; }
.roster-pattern-card fieldset { max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.roster-assignment-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.availability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.task-attachments { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.attachment-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.attachment-card img, .attachment-card video { display: block; width: 100%; height: 190px; object-fit: cover; background: #17221d; }
.attachment-meta { display: grid; gap: 6px; padding: 10px; overflow-wrap: anywhere; }
.attachment-meta .button-row > * { flex: 1 1 100px; }
.attachment-meta form { display: flex; }
.danger-button { background: var(--danger); }
.danger-button:hover { background: #92362f; }
.user-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--green); color: white; font-weight: 800; }
.user-avatar.small { width: 28px; height: 28px; font-size: .78rem; }
.user-avatar.large { width: 88px; height: 88px; font-size: 2rem; }
.profile-photo-row, .feed-author, .user-chip { display: flex; align-items: center; gap: 10px; }
.profile-photo-row { align-items: flex-start; margin-bottom: 18px; }
.farm-logo-settings { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.farm-logo-settings h3 { margin: 0 0 4px; }
.farm-logo-settings p { margin: 0 0 10px; color: var(--muted); }
.farm-logo-settings form { margin: 8px 0 0; }
.location-preview {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--field);
}

.location-preview-map {
    position: relative;
    min-height: 130px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(47,111,78,.12) 1px, transparent 1px),
        linear-gradient(rgba(47,111,78,.12) 1px, transparent 1px),
        var(--wash);
    background-size: 24px 24px;
}

.location-preview-map span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 3px solid white;
    border-radius: 999px 999px 999px 0;
    background: var(--danger);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    transform: translate(-50%, -65%) rotate(-45deg);
}

.farm-access-list { display: grid; gap: 8px; margin-top: 10px; }
.farm-access-list .mini-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.farm-access-list .mini-card > div { display: grid; }
.farm-access-list form { min-width: 120px; }
.farm-access-list .farm-access-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.farm-access-actions form { margin: 0; }
.farm-create-link { margin: 12px 0 0; font-size: .88rem; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.activity-feed { display: grid; gap: 10px; }
.feed-card { display: grid; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.feed-author time { display: block; color: var(--muted); font-size: .78rem; }
.feed-body { padding-left: 38px; }
.feed-body p { margin: 4px 0; }
.animal-list-identity, .animal-profile-heading { display: flex; align-items: center; gap: 9px; }
.animal-list-identity > span:last-child { display: grid; }
.animal-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--green); color: white; font-weight: 800; }
.animal-profile-photo { display: inline-grid; place-items: center; flex: 0 0 auto; width: 94px; height: 94px; border-radius: 12px; object-fit: cover; background: var(--green); color: white; font-size: 2rem; }
.animal-photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.animal-photo-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.animal-photo-card img { display: block; width: 100%; height: 150px; object-fit: cover; }
.timeline-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 160px)); gap: 6px; margin-top: 7px; }
.timeline-photos img { width: 100%; height: 100px; border-radius: 5px; object-fit: cover; }
.checkbox-label { display: flex; align-items: center; gap: 6px; }
.checkbox-label input { width: auto; min-height: auto; }
.dashboard-settings-list { display: grid; gap: 10px; }
.dashboard-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.dashboard-setting > div:first-child { display: grid; }
.dashboard-setting .button-row { justify-content: flex-end; }
.dashboard-setting form { margin: 0; }
.dashboard-setting button { min-height: 38px; padding: 7px 10px; }
.dashboard-customise-entry { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px 12px; margin-top: 8px; padding: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.dashboard-customise-entry a { color: var(--muted); font-weight: 800; }
.dashboard-layout-editor > .panel-heading { align-items: flex-start; }
.dashboard-layout-editor > .panel-heading p { margin: 3px 0 0; color: var(--muted); }
.dashboard-save-status { margin: 0 0 12px; padding: 8px 10px; border-radius: var(--radius); background: var(--wash); color: var(--green-dark); font-size: .85rem; }
.dashboard-setting .dashboard-setting-identity { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.dashboard-setting-identity > div { display: grid; gap: 2px; }
.dashboard-drag-handle { min-width: 74px; min-height: 46px !important; border: 1px dashed var(--green); background: var(--wash); color: var(--green-dark); cursor: grab; touch-action: none; }
.dashboard-drag-handle:active { cursor: grabbing; }
.dashboard-setting-controls { display: flex; align-items: end; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.dashboard-setting.dragging { opacity: .45; border-color: var(--green); box-shadow: 0 8px 18px rgba(24, 50, 38, .14); }
.dashboard-settings-list.drag-active { padding: 5px; border-radius: var(--radius); background: var(--wash); }
.dashboard-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.dashboard-editor-actions form { margin: 0; }
.widget-size-form { display: flex; align-items: end; gap: 6px; flex: 1 1 240px; }
.widget-size-form label { flex: 1; }
.widget-size-form select, .widget-size-form button { min-height: 38px; }
.dashboard-setting.widget-hidden { opacity: .62; border-style: dashed; }
.compact-calendar { overflow-x: auto; }
.compact-calendar-weekdays, .compact-calendar-week { display: grid; grid-template-columns: repeat(7, minmax(70px, 1fr)); }
.compact-calendar-weekdays strong { padding: 4px; text-align: center; color: var(--muted); }
.compact-calendar-day { min-height: 72px; padding: 4px; border: 1px solid var(--line); border-width: 1px 1px 0 0; overflow: hidden; }
.compact-calendar-day.outside-month { opacity: .45; background: var(--field); }
.compact-date { display: block; font-weight: 800; }
.compact-calendar-task { display: block; overflow: hidden; padding: 2px 3px; border-radius: 3px; background: var(--wash); color: var(--ink); font-size: .72rem; white-space: nowrap; text-overflow: ellipsis; }
.activity-feed { display: grid; gap: 10px; }
.feed-card { display: grid; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.feed-author time { display: block; color: var(--muted); font-size: .78rem; }
.feed-body { padding-left: 38px; }
.feed-body p { margin: 4px 0; }
.animal-form h2 { margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.animal-filters .search-field { grid-column: 1 / -1; }
.tab-nav { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 12px; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.tab-nav a { flex: 0 0 auto; padding: 7px 10px; border-radius: 5px; color: var(--ink); font-weight: 700; }
.tab-nav a.active, .tab-nav a:hover { background: var(--green); color: white; text-decoration: none; }
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.mapping-grid .full-field { grid-column: 1 / -1; }
.import-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 18px; }
.import-summary strong { padding: 10px 14px; border-radius: var(--radius); background: var(--field); }
.danger-text { color: var(--danger) !important; font-weight: 700; }
.json-block { max-height: 360px; overflow: auto; padding: 12px; border-radius: var(--radius); background: #16231d; color: #e8f3ec; white-space: pre-wrap; }
.sop-filters .full-field, .sop-form .full-field { grid-column: 1 / -1; }
.sop-library-grid { display: grid; gap: 12px; }
.sop-library-card { display: grid; align-content: start; }
.sop-library-card h2 { margin: 5px 0 0; }
.sop-library-card.sop-archived { opacity: .68; border-style: dashed; }
.sop-card-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px; margin: 12px 0; }
.sop-card-meta span { display: grid; color: var(--muted); font-size: .82rem; }
.sop-card-meta strong { color: var(--ink); }
.status-active { background: #e2f4e8; color: var(--green-dark); }
.status-draft { background: #fff4cf; color: #5e4706; }
.status-archived { background: #ecefec; color: var(--muted); }
.theme-dark .farm-logo-placeholder,
.theme-dark .paddock-tile { background: var(--field); }
.theme-dark .danger,
.theme-dark .task-overdue,
.theme-dark .calendar-task.overdue,
.theme-dark .roster-status-absent { background: #341716; border-color: #7c3935; }
.theme-dark .priority-high,
.theme-dark .danger-badge { background: #3a1817; color: #f3b2ac; }
.theme-dark .status-completed,
.theme-dark .status-complete,
.theme-dark .status-active { background: var(--success-bg); color: var(--success-text); }
.theme-dark .status-planned,
.theme-dark .status-draft,
.theme-dark .sop-safety-note { background: var(--warning-bg); color: var(--warning-text); }
.theme-dark .status-backlog,
.theme-dark .status-cancelled,
.theme-dark .status-archived { background: var(--field); color: var(--muted); }
@media (prefers-color-scheme: dark) {
    .theme-system .farm-logo-placeholder,
    .theme-system .paddock-tile { background: var(--field); }
    .theme-system .danger,
    .theme-system .task-overdue,
    .theme-system .calendar-task.overdue,
    .theme-system .roster-status-absent { background: #341716; border-color: #7c3935; }
    .theme-system .priority-high,
    .theme-system .danger-badge { background: #3a1817; color: #f3b2ac; }
    .theme-system .status-completed,
    .theme-system .status-complete,
    .theme-system .status-active { background: var(--success-bg); color: var(--success-text); }
    .theme-system .status-planned,
    .theme-system .status-draft,
    .theme-system .sop-safety-note { background: var(--warning-bg); color: var(--warning-text); }
    .theme-system .status-backlog,
    .theme-system .status-cancelled,
    .theme-system .status-archived { background: var(--field); color: var(--muted); }
}
.sop-steps { display: grid; gap: 12px; }
.sop-step { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
.sop-step-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: var(--green); color: white; font-size: 1.05rem; font-weight: 900; }
.sop-step h2 { margin-top: 5px; }
.sop-instruction { line-height: 1.6; white-space: pre-wrap; }
.sop-safety-note { margin-top: 12px; padding: 10px; border-left: 4px solid #d5a72a; border-radius: var(--radius); background: #fff8df; color: #513e0b; }
.sop-safety-note p { margin-bottom: 0; }
.sop-media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.sop-media-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.sop-media-card img, .sop-media-card video { display: block; width: 100%; height: 160px; object-fit: cover; background: #111; }
.sop-media-card > div { padding: 9px; }
.sop-media-card p { margin: 4px 0; }
.sop-document-icon { display: grid; place-items: center; height: 120px; padding: 0 !important; background: var(--wash); color: var(--green-dark); font-size: 1.4rem; font-weight: 900; }
.sop-step-edit-list { display: grid; gap: 10px; }
.sop-step-edit-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.sop-step-edit-card.dragging { opacity: .45; border-color: var(--green); }
.sop-step-edit-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sop-step-drag-handle { min-width: 90px; min-height: 46px; border: 1px dashed var(--green); background: var(--wash); color: var(--green-dark); cursor: grab; }
.sop-step-move-controls { margin-top: 8px; }
.sop-step-move-controls form { margin: 0; }
.sop-step-media-upload { border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; background: var(--paper); }
.sop-media-move-form { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sop-media-move-form button { width: 100%; }
.sop-details-panel { margin-top: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--table-heading-bg); color: var(--table-heading-text); }

.member-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    background: var(--field);
}
.member-card summary { cursor: pointer; }
.member-card summary span { color: var(--muted); display: block; }
.permission-grid, .checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0;
}
.checkbox-grid label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-grid input { width: auto; min-height: auto; }

@media (max-width: 680px) {
    .compact-layout .page-header { align-items: flex-start; flex-direction: column; }
    .compact-page-header { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .button { flex: 1 1 auto; }
    .task-calendar { min-width: 650px; }
    .task-calendar { overflow: visible; }
    .dashboard-setting { align-items: stretch; flex-direction: column; }
    .dashboard-setting .dashboard-setting-identity { align-items: stretch; flex-direction: column; }
    .dashboard-setting-controls { align-items: stretch; flex-direction: column; }
    .dashboard-setting-controls > form, .dashboard-setting-controls > form button, .widget-size-form, .dashboard-editor-actions, .dashboard-editor-actions > * { width: 100%; }
    .dashboard-move-controls { width: 100%; }
    .dashboard-move-controls form, .dashboard-move-controls button { flex: 1; }
    .dashboard-layout-editor > .panel-heading { align-items: stretch; flex-direction: column; }
    .dashboard-customise-entry { align-items: flex-start; flex-direction: column; }
    .dashboard-widget-scroll { max-height: 360px; }
    .trend-chart-wrap { height: 210px; }
    .farm-logo-settings { align-items: stretch; flex-direction: column; }
    .filter-panel-body .filter-grid { grid-template-columns: 1fr; }
    .filter-panel-body .filter-actions { width: 100%; }
    .farm-access-list .mini-card { align-items: stretch; flex-direction: column; }
    .farm-access-list .farm-access-actions { align-items: stretch; flex-direction: column; }
    .farm-access-actions form, .farm-access-actions button, .farm-access-actions .button { width: 100%; }
    body.text-large .account-dropdown { min-width: min(92vw, 340px); }
    body.text-large .responsive-table td { align-items: flex-start; flex-direction: column; }
    .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table th, .responsive-table td {
        display: block;
    }
    .responsive-table thead { display: none; }
    .responsive-table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin-bottom: 12px;
        padding: 8px;
        background: var(--field);
    }
    .responsive-table td {
        border: 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
    }
}

@media (min-width: 760px) {
    .menu-toggle { display: none; }
    .app-header { align-items: center; }
    .header-actions {
        order: 3;
    }
    .main-nav {
        order: 2;
        position: static;
        display: flex;
        align-items: center;
        gap: 6px;
        border: 0;
        box-shadow: none;
        padding: 0;
        flex-wrap: wrap;
    }
    .main-nav a {
        width: auto;
        padding: 5px 8px;
        border-radius: var(--radius);
    }
    .main-nav a:hover { background: var(--wash); text-decoration: none; }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-widget-slot.widget-size-large, .dashboard-widget-slot.widget-size-full { grid-column: 1 / -1; }
    .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid, .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .quick-form { grid-template-columns: 170px 160px 1fr; }
    .quick-form textarea, .quick-form button { grid-column: 1 / -1; }
    .permission-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sop-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
    .kanban-board { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: initial; grid-auto-columns: initial; overflow: visible; }
    .dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-widget-slot.widget-size-small { grid-column: span 1; }
    .dashboard-widget-slot.widget-size-medium { grid-column: span 2; }
    .dashboard-widget-slot.widget-size-large { grid-column: span 3; }
    .dashboard-widget-slot.widget-size-full { grid-column: 1 / -1; }
}

.invitation-card { gap: .75rem; align-items: center; }
.invitation-card > div:first-child { display: grid; gap: .25rem; }
.invitation-card form { margin: 0; }

.workforce-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.workforce-warning-list {
    display: grid;
    gap: 4px;
    margin-top: 6px;
}

.leave-calendar-item {
    border-left-color: #7c3aed;
    background: color-mix(in srgb, var(--field) 78%, #ede9fe);
}

.theme-dark .leave-calendar-item {
    background: color-mix(in srgb, var(--field) 72%, #2e1b58);
}

@media (prefers-color-scheme: dark) {
    .theme-system .leave-calendar-item {
        background: color-mix(in srgb, var(--field) 72%, #2e1b58);
    }
}
