/* ============================================
           Parcela Design System
           Civic Institutional - Clean, Authoritative
           ============================================ */

        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            /* Core palette */
            --navy-900: #0f1a2e;
            --navy-800: #1a2744;
            --navy-700: #243556;
            --navy-600: #2e4370;
            --navy-500: #3d5a8a;
            --slate-700: #374151;
            --slate-600: #4b5563;
            --slate-500: #64748b;
            --slate-400: #94a3b8;
            --slate-300: #cbd5e1;
            --slate-200: #e2e8f0;
            --slate-100: #f1f5f9;
            --slate-50: #f8fafc;

            /* Accents */
            --civic-blue: #2563eb;
            --civic-blue-light: #3b82f6;
            --civic-blue-faint: #eff6ff;
            --amber-500: #d97706;
            --amber-100: #fef3c7;
            --green-700: #15803d;
            --green-100: #dcfce7;
            --red-700: #b91c1c;
            --red-100: #fee2e2;
            --orange-600: #ea580c;
            --orange-100: #fff7ed;

            /* Typography */
            --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
            --font-display: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

            /* Spacing */
            --space-xs: 0.25rem;
            --space-sm: 0.5rem;
            --space-md: 1rem;
            --space-lg: 1.5rem;
            --space-xl: 2rem;
            --space-2xl: 3rem;

            /* Layout */
            --sidebar-width: 250px;
            --content-max: 1200px;

            /* Shadows */
            --shadow-sm: 0 1px 2px rgba(15, 26, 46, 0.06);
            --shadow-md: 0 2px 8px rgba(15, 26, 46, 0.08);
            --shadow-lg: 0 4px 16px rgba(15, 26, 46, 0.1);

            /* Radius */
            --radius-sm: 4px;
            --radius-md: 6px;
            --radius-lg: 8px;
        }

        html {
            font-size: 16px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            overflow-x: hidden;
        }

        body {
            font-family: var(--font-body);
            color: var(--slate-700);
            background: var(--slate-100);
            line-height: 1.7;
            font-size: 1.1rem;
            min-height: 100vh;
            display: flex;
            overflow-x: hidden;
            width: 100%;
        }

        /* ---- Sidebar ---- */

        .sidebar {
            width: var(--sidebar-width);
            background: var(--navy-900);
            color: #fff;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            z-index: 100;
        }

        .sidebar-brand {
            padding: var(--space-lg) var(--space-lg) var(--space-md);
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }

        .sidebar-brand .product-name {
            font-family: var(--font-display);
            font-size: 1.35rem;
            color: #fff;
            text-decoration: none;
            letter-spacing: 0.01em;
            display: block;
        }

        .sidebar-brand .municipality-name {
            font-size: 0.8rem;
            color: var(--slate-400);
            margin-top: 2px;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .sidebar-nav {
            padding: var(--space-md) 0;
            flex: 1;
            list-style: none;
            overflow-y: auto;
        }

        .sidebar-nav li { margin: 0; }

        .sidebar-nav a {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            padding: 0.6rem var(--space-lg);
            color: var(--slate-400);
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 400;
            transition: all 0.15s ease;
            border-left: 3px solid transparent;
        }

        .sidebar-nav a:hover {
            color: #fff;
            background: rgba(255,255,255,0.05);
        }

        .sidebar-nav a.active {
            color: #fff;
            background: rgba(255,255,255,0.08);
            border-left-color: var(--civic-blue-light);
            font-weight: 600;
        }

        .sidebar-nav .nav-icon {
            width: 18px;
            height: 18px;
            opacity: 0.7;
            flex-shrink: 0;
        }

        .sidebar-nav .nav-parent {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            padding: 0.6rem var(--space-lg);
            color: var(--slate-400);
            font-size: 0.9rem;
            font-weight: 400;
        }

        .sidebar-nav .nav-sub {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .sidebar-nav .nav-sub a {
            padding-left: calc(var(--space-lg) + 18px + var(--space-sm));
            font-size: 0.85rem;
        }

        /* Inline editable fields */
        .inline-editable {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            cursor: text;
            border-bottom: 1px dashed #cbd5e1;
            padding: 2px 4px;
            border-radius: 3px;
            transition: background 0.15s ease;
        }

        .inline-editable:hover {
            background-color: #f0f4ff;
        }

        .inline-editable__pencil {
            width: 12px;
            height: 12px;
            color: #94a3b8;
            opacity: 0;
            transition: opacity 0.15s ease;
            flex-shrink: 0;
        }

        .inline-editable:hover .inline-editable__pencil {
            opacity: 1;
        }

        .inline-editable__empty {
            color: #94a3b8;
            font-style: italic;
        }

        .sidebar-nav a:hover .nav-icon,
        .sidebar-nav a.active .nav-icon { opacity: 1; }

        .sidebar-section-label {
            padding: var(--space-lg) var(--space-lg) var(--space-xs);
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--slate-500);
            font-weight: 600;
        }

        .sidebar-footer {
            padding: var(--space-md) var(--space-lg);
            border-top: 1px solid rgba(255,255,255,0.08);
            font-size: 0.75rem;
            color: var(--slate-500);
        }

        /* ---- Main content ---- */

        .main-wrap {
            margin-left: var(--sidebar-width);
            flex: 1;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            min-width: 0;
            max-width: 100%;
        }

        .topbar {
            background: #fff;
            border-bottom: 1px solid var(--slate-200);
            padding: 0 var(--space-2xl);
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 50;
        }

        .topbar-breadcrumb {
            font-size: 0.85rem;
            color: var(--slate-500);
        }

        .topbar-breadcrumb a {
            color: var(--slate-500);
            text-decoration: none;
        }

        .topbar-breadcrumb a:hover { color: var(--civic-blue); }

        .topbar-breadcrumb .sep {
            margin: 0 0.4rem;
            color: var(--slate-300);
        }

        .topbar-breadcrumb .current {
            color: var(--slate-700);
            font-weight: 600;
        }

        .topbar-actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .topbar-actions .auth-btn {
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--slate-600);
            text-decoration: none;
            padding: 0.35em 0.85em;
            border-radius: var(--radius-md);
            border: 1px solid var(--slate-200);
            background: #fff;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .topbar-actions .auth-btn:hover {
            background: var(--slate-50);
            border-color: var(--slate-300);
            color: var(--navy-700);
        }

        .topbar-user {
            font-size: 0.82rem;
            color: var(--slate-600);
            display: flex;
            align-items: center;
            gap: 0.4em;
        }

        .topbar-user-avatar {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: 1px solid var(--slate-200);
        }

        .content {
            padding: var(--space-2xl);
            max-width: var(--content-max);
            width: 100%;
            flex: 1;
            min-width: 0;
        }

        .page-footer {
            padding: var(--space-lg) var(--space-2xl);
            font-size: 0.8rem;
            color: var(--slate-400);
            border-top: 1px solid var(--slate-200);
        }

        /* ---- Page header ---- */

        .page-header {
            margin-bottom: var(--space-2xl);
        }

        .page-header h1 {
            font-family: var(--font-display);
            font-size: 1.75rem;
            color: var(--navy-800);
            font-weight: 400;
            line-height: 1.3;
            margin-bottom: 0.25rem;
        }

        .page-header .subtitle {
            color: var(--slate-500);
            font-size: 1rem;
        }

        /* ---- Cards ---- */

        .card {
            background: #fff;
            border: 1px solid var(--slate-200);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            padding: var(--space-lg);
            margin-bottom: var(--space-md);
            overflow: hidden;
        }

        .card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: var(--space-md);
            padding-bottom: var(--space-sm);
            border-bottom: 1px solid var(--slate-100);
        }

        .card-header h2,
        .card-header h3 {
            font-family: var(--font-body);
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--navy-800);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin: 0;
        }

        /* ---- Stat cards ---- */

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: var(--space-md);
            margin-bottom: var(--space-2xl);
        }

        .stat-card {
            background: #fff;
            border: 1px solid var(--slate-200);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            padding: var(--space-lg);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
        }

        .stat-card--blue::before { background: var(--civic-blue); }
        .stat-card--amber::before { background: var(--amber-500); }
        .stat-card--green::before { background: var(--green-700); }
        .stat-card--red::before { background: var(--red-700); }

        .stat-card .stat-value {
            font-family: var(--font-display);
            font-size: 2.5rem;
            color: var(--navy-800);
            line-height: 1;
            margin-bottom: 0.25rem;
        }

        .stat-card .stat-label {
            font-size: 0.8rem;
            color: var(--slate-500);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            font-weight: 600;
        }

        /* ---- Tables ---- */

        .data-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
        }

        .data-table thead th {
            text-align: left;
            padding: 0.65rem var(--space-md);
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--slate-500);
            background: var(--slate-50);
            border-bottom: 2px solid var(--slate-200);
            white-space: nowrap;
        }

        .data-table tbody td {
            padding: 0.75rem var(--space-md);
            border-bottom: 1px solid var(--slate-100);
            color: var(--slate-700);
            vertical-align: top;
        }

        .data-table tbody tr:hover {
            background: var(--civic-blue-faint);
        }

        .data-table tbody tr:last-child td {
            border-bottom: none;
        }

        .data-table a {
            color: var(--civic-blue);
            text-decoration: none;
            font-weight: 600;
        }

        .data-table a:hover {
            text-decoration: underline;
        }

        .data-table .muted {
            color: var(--slate-400);
        }

        /* ---- Badges ---- */

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 0.3em;
            padding: 0.2em 0.65em;
            font-size: 0.78rem;
            font-weight: 600;
            border-radius: 999px;
            white-space: nowrap;
            line-height: 1.4;
        }

        .badge--blue {
            background: var(--civic-blue-faint);
            color: var(--civic-blue);
            border: 1px solid rgba(37, 99, 235, 0.15);
        }

        .badge--green {
            background: var(--green-100);
            color: var(--green-700);
            border: 1px solid rgba(21, 128, 61, 0.15);
        }

        .badge--amber {
            background: var(--amber-100);
            color: var(--amber-500);
            border: 1px solid rgba(217, 119, 6, 0.15);
        }

        .badge--red {
            background: var(--red-100);
            color: var(--red-700);
            border: 1px solid rgba(185, 28, 28, 0.15);
        }

        .badge--slate {
            background: var(--slate-100);
            color: var(--slate-600);
            border: 1px solid var(--slate-200);
        }

        .badge--orange {
            background: var(--orange-100);
            color: var(--orange-600);
            border: 1px solid rgba(234, 88, 12, 0.15);
        }

        /* ---- Progress steps (process tracker) ---- */

        .process-tracker {
            display: flex;
            gap: 0;
            list-style: none;
            padding: 0;
            margin: var(--space-lg) 0;
            background: var(--slate-50);
            border-radius: var(--radius-lg);
            border: 1px solid var(--slate-200);
            overflow: hidden;
        }

        .process-tracker li {
            flex: 1;
            text-align: center;
            padding: var(--space-md) var(--space-sm);
            font-size: 0.82rem;
            color: var(--slate-400);
            position: relative;
            font-weight: 400;
            border-right: 1px solid var(--slate-200);
        }

        .process-tracker li:last-child { border-right: none; }

        .process-tracker li small {
            display: block;
            font-size: 0.7rem;
            margin-top: 2px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .process-tracker li.completed {
            background: var(--green-100);
            color: var(--green-700);
        }

        .process-tracker li.completed::after {
            content: '';
            display: block;
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--green-700);
        }

        .process-tracker li.current {
            background: var(--civic-blue-faint);
            color: var(--civic-blue);
            font-weight: 700;
        }

        .process-tracker li.current::after {
            content: '';
            display: block;
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--civic-blue);
        }

        /* ---- Section headings ---- */

        .section-heading {
            font-family: var(--font-body);
            font-size: 0.85rem;
            font-weight: 700;
            color: var(--navy-800);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin: var(--space-2xl) 0 var(--space-md);
            padding-bottom: var(--space-sm);
            border-bottom: 2px solid var(--slate-200);
        }

        .section-heading:first-child { margin-top: 0; }

        /* ---- Detail grid ---- */

        .detail-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: var(--space-md);
            margin-bottom: var(--space-lg);
        }

        @media (max-width: 768px) {
            .detail-grid { grid-template-columns: 1fr; }
        }

        .detail-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .detail-list li {
            display: flex;
            padding: 0.6rem 0;
            border-bottom: 1px solid var(--slate-100);
            font-size: 0.95rem;
        }

        .detail-list li:last-child { border-bottom: none; }

        .detail-list .detail-label {
            width: 140px;
            flex-shrink: 0;
            color: var(--slate-500);
            font-weight: 600;
            font-size: 0.82rem;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .detail-list .detail-value {
            color: var(--slate-700);
            flex: 1;
        }

        .detail-list .detail-value a {
            color: var(--civic-blue);
            text-decoration: none;
        }

        .detail-list .detail-value a:hover {
            text-decoration: underline;
        }

        /* ---- Collapsible sections ---- */

        details {
            background: #fff;
            border: 1px solid var(--slate-200);
            border-radius: var(--radius-md);
            margin-bottom: var(--space-sm);
        }

        details summary {
            padding: var(--space-md);
            cursor: pointer;
            font-weight: 600;
            color: var(--navy-800);
            font-size: 0.9rem;
            list-style: none;
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        details summary::before {
            content: '';
            display: inline-block;
            width: 6px;
            height: 6px;
            border-right: 2px solid var(--slate-400);
            border-bottom: 2px solid var(--slate-400);
            transform: rotate(-45deg);
            transition: transform 0.15s ease;
            flex-shrink: 0;
        }

        details[open] summary::before {
            transform: rotate(45deg);
        }

        details summary::-webkit-details-marker { display: none; }

        details > :not(summary) {
            padding: 0 var(--space-md) var(--space-md);
            color: var(--slate-600);
            font-size: 0.95rem;
            line-height: 1.7;
        }

        /* ---- Search input ---- */

        .search-input {
            width: 100%;
            padding: 0.65rem var(--space-md) 0.65rem 2.5rem;
            font-size: 0.9rem;
            font-family: var(--font-body);
            border: 1px solid var(--slate-300);
            border-radius: var(--radius-md);
            background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 0.85rem center no-repeat;
            color: var(--slate-700);
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
            margin-bottom: var(--space-lg);
        }

        .search-input:focus {
            outline: none;
            border-color: var(--civic-blue);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .search-input::placeholder {
            color: var(--slate-400);
        }

        /* ---- List controls (toggle + search) ---- */

        .list-controls {
            display: flex;
            align-items: center;
            gap: var(--space-md);
            margin-bottom: var(--space-lg);
        }

        .list-controls .search-input {
            flex: 1;
            margin-bottom: 0;
        }

        .toggle-group {
            display: flex;
            border: 1px solid var(--slate-300);
            border-radius: var(--radius-md);
            overflow: hidden;
            flex-shrink: 0;
        }

        .toggle-btn {
            padding: 0.55rem 1rem;
            font-size: 0.85rem;
            font-family: var(--font-body);
            font-weight: 500;
            color: var(--slate-600);
            background: #fff;
            text-decoration: none;
            border-right: 1px solid var(--slate-300);
            transition: background 0.15s ease, color 0.15s ease;
            cursor: pointer;
        }

        .toggle-btn:last-child { border-right: none; }
        .toggle-btn:hover { background: var(--slate-100); text-decoration: none; }

        .toggle-btn--active {
            background: var(--civic-blue);
            color: #fff;
        }

        .toggle-btn--active:hover {
            background: var(--civic-blue);
            color: #fff;
        }

        /* ---- Empty state ---- */

        .empty-state {
            text-align: center;
            padding: var(--space-2xl);
            color: var(--slate-400);
            font-size: 0.95rem;
        }

        /* ---- Links ---- */

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

        /* ---- Utility ---- */

        .mb-0 { margin-bottom: 0; }
        .mb-md { margin-bottom: var(--space-md); }
        .mb-lg { margin-bottom: var(--space-lg); }
        .mb-2xl { margin-bottom: var(--space-2xl); }
        .text-muted { color: var(--slate-400); }

        /* (responsive rules are at end of stylesheet) */

        /* ---- Articles / process cards ---- */

        .workflow-card {
            background: #fff;
            border: 1px solid var(--slate-200);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            padding: var(--space-lg);
            margin-bottom: var(--space-md);
        }

        .workflow-card h3 {
            font-family: var(--font-display);
            font-size: 1.15rem;
            color: var(--navy-800);
            margin: 0 0 0.25rem;
        }

        .workflow-card .workflow-meta {
            font-size: 0.8rem;
            color: var(--slate-500);
            margin-bottom: var(--space-md);
        }

        .workflow-card--complete {
            opacity: 0.6;
            border-left: 3px solid var(--green-700);
        }

        /* ---- Hero Search ---- */

        .search-hero {
            background: #fff;
            border-bottom: 1px solid var(--slate-200);
            padding: var(--space-lg) var(--space-2xl);
            display: flex;
            justify-content: center;
        }

        .search-hero-inner {
            position: relative;
            width: 100%;
            max-width: 640px;
        }

        .search-hero .search-input {
            width: 100%;
            margin-bottom: 0;
            padding: 0.85rem var(--space-lg) 0.85rem 3rem;
            font-size: 1rem;
            border-radius: var(--radius-lg);
            border: 2px solid var(--slate-300);
            background-size: 18px;
            background-position: 0.9rem center;
            box-shadow: var(--shadow-md);
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }

        .search-hero .search-input:focus {
            border-color: var(--civic-blue);
            box-shadow: var(--shadow-md), 0 0 0 4px rgba(37, 99, 235, 0.1);
        }

        .search-hero .search-input::placeholder {
            color: var(--slate-400);
            font-weight: 400;
        }

        .search-dropdown {
            background: #fff;
            border: 1px solid var(--slate-200);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            max-height: 480px;
            overflow-y: auto;
            margin-top: 4px;
        }

        .search-group {
            padding: var(--space-xs) 0;
            border-bottom: 1px solid var(--slate-100);
        }

        .search-group:last-child { border-bottom: none; }

        .search-group-label {
            padding: var(--space-sm) var(--space-md) var(--space-xs);
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--slate-500);
        }

        .search-result {
            display: block;
            padding: var(--space-sm) var(--space-md);
            text-decoration: none;
            color: var(--slate-700);
            transition: background 0.1s ease;
        }

        .search-result:hover {
            background: var(--civic-blue-faint);
            text-decoration: none;
        }

        .search-result-title {
            display: block;
            font-weight: 600;
            font-size: 0.92rem;
            color: var(--navy-800);
        }

        .search-result-meta {
            display: block;
            font-size: 0.8rem;
            color: var(--slate-500);
            margin-top: 1px;
        }

        .search-empty {
            padding: var(--space-lg);
            text-align: center;
            color: var(--slate-400);
            font-size: 0.95rem;
        }

        .search-see-all {
            display: block;
            padding: 0.5rem var(--space-md);
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--civic-blue);
            text-decoration: none;
            border-top: 1px solid var(--slate-100);
        }
        .search-see-all:hover {
            background: var(--slate-50);
        }

        .search-see-all-global {
            display: block;
            padding: 0.65rem var(--space-md);
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--civic-blue);
            text-decoration: none;
            text-align: center;
            border-top: 1px solid var(--slate-200);
            background: var(--slate-50);
            border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        }
        .search-see-all-global:hover {
            background: var(--slate-100);
        }

        /* ---- Overdue row ---- */

        .data-table tbody tr.row-overdue {
            background: var(--red-100);
        }

        .data-table tbody tr.row-overdue:hover {
            background: #fecaca;
        }

        /* ---- Timeline ---- */

        .timeline { padding: var(--space-md) 0; }

        .timeline-entry {
            display: flex;
            gap: var(--space-md);
            padding-bottom: var(--space-lg);
        }

        .timeline-entry:last-child { padding-bottom: 0; }
        .timeline-entry:last-child .timeline-line { display: none; }

        .timeline-marker {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex-shrink: 0;
            width: 20px;
        }

        .timeline-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--slate-300);
            border: 2px solid #fff;
            box-shadow: 0 0 0 2px var(--slate-300);
            flex-shrink: 0;
            margin-top: 4px;
        }

        .timeline-dot--current {
            background: var(--civic-blue);
            box-shadow: 0 0 0 2px var(--civic-blue);
        }

        .timeline-dot--flagged {
            background: var(--red-700);
            box-shadow: 0 0 0 2px var(--red-700);
        }

        .timeline-line {
            width: 2px;
            flex: 1;
            background: var(--slate-200);
            margin-top: 4px;
        }

        .timeline-content { flex: 1; min-width: 0; }

        .timeline-date {
            font-size: 0.78rem;
            color: var(--slate-500);
            font-weight: 600;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .timeline-title {
            font-size: 0.95rem;
            color: var(--navy-800);
            font-weight: 600;
            margin-bottom: 4px;
        }

        .timeline-desc {
            font-size: 0.92rem;
            color: var(--slate-600);
            line-height: 1.6;
            margin-bottom: 2px;
        }

        .timeline-actor {
            font-size: 0.78rem;
            color: var(--slate-500);
            font-style: italic;
        }

        .timeline-doc { font-size: 0.82rem; margin-top: 4px; }

        .timeline-flag-note {
            font-size: 0.82rem;
            color: var(--red-700);
            background: var(--red-100);
            padding: var(--space-xs) var(--space-sm);
            border-radius: var(--radius-sm);
            margin-top: 4px;
            display: inline-block;
        }

        .timeline-entry--flagged .timeline-content {
            border-left: 3px solid var(--red-700);
            padding-left: var(--space-sm);
        }

        .timeline-entry--current .timeline-content {
            border-left: 3px solid var(--civic-blue);
            padding-left: var(--space-sm);
        }

        /* ---- Forms ---- */

        .form-label {
            display: block;
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--slate-600);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: var(--space-xs);
        }

        .form-input, .form-select, .form-textarea {
            width: 100%;
            padding: 0.55rem var(--space-sm);
            font-size: 0.9rem;
            font-family: var(--font-body);
            border: 1px solid var(--slate-300);
            border-radius: var(--radius-sm);
            color: var(--slate-700);
            background: #fff;
            transition: border-color 0.15s ease;
        }

        .form-input:focus, .form-select:focus, .form-textarea:focus {
            outline: none;
            border-color: var(--civic-blue);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .form-group { margin-bottom: var(--space-md); flex: 1; }
        .form-row { display: flex; gap: var(--space-md); }

        .form-error {
            font-size: 0.8rem;
            color: var(--red-700);
            margin-top: 2px;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            padding: 0.5rem var(--space-md);
            font-size: 0.85rem;
            font-weight: 600;
            font-family: var(--font-body);
            border: 1px solid var(--slate-300);
            border-radius: var(--radius-md);
            background: #fff;
            color: var(--slate-700);
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .btn:hover { background: var(--slate-50); border-color: var(--slate-400); }

        .btn-primary {
            background: var(--civic-blue);
            color: #fff;
            border-color: var(--civic-blue);
        }

        .btn-primary:hover { background: var(--civic-blue-light); }

        .btn-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

        .activity-form {
            background: var(--slate-50);
            border: 1px solid var(--slate-200);
            border-radius: var(--radius-md);
            padding: var(--space-lg);
            margin-bottom: var(--space-md);
        }

        /* ---- Table scroll wrapper ---- */

        .table-scroll {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* ---- Mobile menu button ---- */

        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            padding: var(--space-xs);
            cursor: pointer;
            color: var(--slate-600);
            flex-shrink: 0;
        }

        .sidebar-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            z-index: 99;
        }

        .sidebar-backdrop.visible { display: block; }

        /* ============================================
           Responsive: Tablet (≤900px)
           ============================================ */

        @media (max-width: 900px) {
            .sidebar {
                display: flex;
                transform: translateX(-100%);
                transition: transform 0.25s ease;
            }

            .sidebar.sidebar--open {
                transform: translateX(0);
            }

            .main-wrap { margin-left: 0; }

            .mobile-menu-btn { display: flex; }

            .topbar {
                padding: 0 var(--space-md);
                gap: var(--space-sm);
            }

            .search-hero {
                padding: var(--space-md);
            }

            .content {
                padding: var(--space-lg);
            }

            .page-footer {
                padding: var(--space-md);
            }
        }

        /* ============================================
           Responsive: Small tablet (≤640px)
           ============================================ */

        @media (max-width: 640px) {
            .content {
                padding: var(--space-md);
            }

            .page-header {
                margin-bottom: var(--space-lg);
            }

            .page-header h1 {
                font-size: 1.25rem;
            }

            .page-header .subtitle {
                font-size: 0.88rem;
            }

            /* Detail list: stack label above value */
            .detail-list li {
                flex-direction: column;
                gap: 2px;
            }

            .detail-list .detail-label {
                width: auto;
            }

            /* List controls: stack vertically */
            .list-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .list-controls .toggle-group {
                align-self: flex-start;
            }

            /* Process tracker: horizontal scroll */
            .process-tracker {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .process-tracker li {
                min-width: 110px;
                flex: 0 0 auto;
            }

            /* Forms: stack rows */
            .form-row {
                flex-direction: column;
            }

            /* Section headings */
            .section-heading {
                margin-top: var(--space-lg);
                font-size: 0.8rem;
            }

            /* Cards */
            .card {
                padding: var(--space-md);
            }

            .workflow-card {
                padding: var(--space-md);
            }

            /* Search hero */
            .search-hero {
                padding: var(--space-sm) var(--space-md);
            }

            .search-hero .search-input {
                font-size: 0.9rem;
                padding: 0.65rem var(--space-md) 0.65rem 2.5rem;
            }

            /* Timeline */
            .timeline-entry {
                gap: var(--space-sm);
            }

            /* Stat cards */
            .stat-card .stat-value {
                font-size: 2rem;
            }
        }

        /* ============================================
           Responsive: Phone (≤480px)
           ============================================ */

        @media (max-width: 480px) {
            .stats-grid {
                grid-template-columns: 1fr 1fr;
            }

            .page-header h1 {
                font-size: 1.15rem;
            }

            .topbar-breadcrumb {
                font-size: 0.78rem;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                min-width: 0;
            }

            .badge {
                font-size: 0.72rem;
                padding: 0.15em 0.5em;
            }

            .stat-card .stat-value {
                font-size: 1.75rem;
            }

            .stat-card .stat-label {
                font-size: 0.72rem;
            }
        }

/* ── Agenda drag ────────────────────────────────────────── */

.agenda-row--ghost {
    opacity: 0.3;
    background: var(--blue-50, #eff6ff);
}

/* ── Autocomplete (shared) ───────────────────────────────── */

.card:has(.ac-dropdown) {
    overflow: visible;
}

.ac-dropdown {
    display: none;
    position: absolute;
    z-index: 9999;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 240px;
    overflow-y: auto;
}

.ac-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

.ac-item:last-child {
    border-bottom: none;
}

.ac-item:hover {
    background: #f8fafc;
}

.ac-item__label {
    font-weight: 500;
    color: #1e293b;
}

.ac-item__sub {
    font-size: 0.8rem;
    color: #64748b;
}

.ac-empty {
    padding: 8px 12px;
    color: #64748b;
}
.ac-create {
    padding: 8px 12px;
    color: var(--civic-blue, #2563eb);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-top: 1px solid var(--slate-200, #e2e8f0);
}
.ac-create:hover {
    background: var(--civic-blue-faint, #eff6ff);
}
.ac-create-form {
    padding: 8px 12px;
}

/* ============================================
   Meeting Landing Page
   ============================================ */

/* ── Next-meeting hero ── */

.meeting-hero {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    border-left: 4px solid var(--civic-blue);
}

.meeting-hero__eyebrow {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--civic-blue);
    background: var(--civic-blue-faint);
    border-bottom: 1px solid rgba(37, 99, 235, 0.08);
}

.meeting-hero__body {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
}

.meeting-hero__date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: var(--space-sm) var(--space-md);
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.meeting-hero__month {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--civic-blue);
    line-height: 1;
}

.meeting-hero__day {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--navy-800);
    line-height: 1.1;
}

.meeting-hero__info {
    flex: 1;
    min-width: 0;
}

.meeting-hero__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--navy-800);
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}

.meeting-hero__title:hover {
    color: var(--civic-blue);
    text-decoration: none;
}

.meeting-hero__meta {
    font-size: 0.88rem;
    color: var(--slate-500);
    margin-bottom: var(--space-sm);
}

.meeting-hero__stats {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.meeting-hero__agenda-count {
    font-size: 0.82rem;
    color: var(--slate-500);
}

.meeting-hero__action {
    flex-shrink: 0;
    text-decoration: none;
}

.meeting-hero__action:hover {
    text-decoration: none;
}

/* ── Filter bar ── */

.meeting-filters {
    margin-bottom: var(--space-lg);
}

.meeting-filters__row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.meeting-filters__jurisdictions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--slate-600);
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

.filter-chip:hover {
    background: var(--slate-100);
    border-color: var(--slate-400);
    text-decoration: none;
    color: var(--slate-700);
}

.filter-chip--active {
    background: var(--navy-800);
    color: #fff;
    border-color: var(--navy-800);
}

.filter-chip--active:hover {
    background: var(--navy-700);
    border-color: var(--navy-700);
    color: #fff;
}

.meeting-filters__search {
    margin-left: auto;
    flex: 1;
    min-width: 200px;
}

.meeting-filters__search-input {
    width: 100%;
    margin-bottom: 0;
    padding: 0.45rem var(--space-md) 0.45rem 2.2rem;
    font-size: 0.85rem;
    background-size: 14px;
}

.meeting-filters__active {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--slate-500);
}

.meeting-filters__clear {
    margin-left: var(--space-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--civic-blue);
    text-decoration: none;
}

.meeting-filters__clear:hover {
    text-decoration: underline;
}

/* ── Meeting cards (upcoming view) ── */

.meeting-card-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--slate-200);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.meeting-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: #fff;
    text-decoration: none;
    color: var(--slate-700);
    transition: background 0.12s ease;
}

.meeting-card:hover {
    background: var(--civic-blue-faint);
    text-decoration: none;
}

.meeting-card__date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    flex-shrink: 0;
}

.meeting-card__month {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
    line-height: 1;
}

.meeting-card__day {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 300;
    color: var(--navy-800);
    line-height: 1.1;
}

.meeting-card__info {
    flex: 1;
    min-width: 0;
}

.meeting-card__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--navy-800);
}

.meeting-card__meta {
    font-size: 0.82rem;
    color: var(--slate-500);
    margin-top: 1px;
}

.meeting-card__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.meeting-card__count {
    font-size: 0.78rem;
    color: var(--slate-400);
    white-space: nowrap;
}

/* ── Responsive: meeting landing ── */

@media (max-width: 640px) {
    .meeting-hero__body {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .meeting-hero__action {
        align-self: stretch;
        text-align: center;
    }

    .meeting-filters__row {
        flex-direction: column;
        align-items: stretch;
    }

    .meeting-filters__search {
        margin-left: 0;
    }

    .meeting-filters__search-input {
        width: 100%;
    }

    .meeting-card {
        padding: var(--space-md);
    }

    .meeting-card__right {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }
}