/**
 * LGU-BATIS v2.0 Stylesheet
 * Budget, Accounting & Treasury Integrated System
 * Kael3 Warm Sunset Theme - Clean, Proportional Government UI
 * Built on top of Bootstrap 5.3
 */

/* ============================================================
   CSS VARIABLES - Kael3 Warm Sunset Palette
   ============================================================ */
:root {
    /* Brand Colors - Kael3 Sunset Orange */
    --primary: #FF8C42;
    --primary-light: #FF9F68;
    --primary-lighter: #FFD1A9;
    --primary-dark: #E67A30;
    --primary-bg: #FFF5EB;

    /* Secondary */
    --secondary: #6B7A8F;
    --secondary-light: #8896A8;

    /* Status Colors */
    --success: #28a745;
    --success-light: #5cb85c;
    --success-bg: #eaf7ed;
    --warning: #ffc107;
    --warning-light: #ffdb4d;
    --warning-bg: #fff9e6;
    --danger: #dc3545;
    --danger-light: #e4606d;
    --danger-bg: #fdf0f1;
    --info: #17a2b8;
    --info-light: #3fc5d9;
    --info-bg: #e8f8fb;

    /* Neutrals - Warm Tones */
    --white: #ffffff;
    --bg: #FFF5EB;
    --bg-card: #ffffff;
    --text: #2E3A4E;
    --text-secondary: #6B7A8F;
    --text-muted: #8896A8;
    --border: #F0D9C4;
    --border-light: #FFF0E0;
    --dark: #2E3A4E;

    /* Sidebar - Sunset Gradient */
    --sidebar-width: 250px;
    --sidebar-text: rgba(255,255,255,0.9);
    --sidebar-hover: rgba(255,255,255,0.2);
    --sidebar-active: rgba(255,255,255,0.25);
    --sidebar-active-text: #ffffff;
    --sidebar-section: rgba(255,255,255,0.6);

    /* Navbar */
    --navbar-height: 56px;
    --navbar-bg: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

    /* Radius */
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.875rem;
    --font-size-lg: 1rem;
    --font-size-xl: 1.125rem;
    --font-size-2xl: 1.375rem;
    --font-size-3xl: 1.75rem;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ============================================================
   GLOBAL RESETS & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D4B5A0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B89A82; }

/* ============================================================
   LAYOUT STRUCTURE
   ============================================================ */
.main-wrapper {
    display: block;
    min-height: 100vh;
    background-color: var(--bg);
}

/* --- Sidebar (Sunset Gradient) --- */
.sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #FF8C42 0%, #F76C6C 100%);
    color: var(--sidebar-text);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: var(--transition-slow);
    border-right: 1px solid rgba(255,255,255,0.15);
}

.sidebar-wrapper.collapsed { transform: translateX(calc(var(--sidebar-width) * -1)); }

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 8px;
}
.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.25);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.sidebar-brand-subtext {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.7);
    margin-top: -2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0 8px;
    margin: 0;
}

.sidebar-section-title {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-section);
    padding: 16px 12px 4px;
    margin: 0;
}

.sidebar-nav-item { margin-bottom: 1px; }

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--sidebar-text);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    position: relative;
}
.sidebar-nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
}
.sidebar-nav-link i:first-child {
    width: 18px;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.85;
    flex-shrink: 0;
}
.sidebar-nav-link.active i:first-child { opacity: 1; }

/* Submenu Arrow */
.submenu-arrow {
    margin-left: auto;
    font-size: 0.625rem !important;
    transition: transform 0.2s ease;
    opacity: 0.4 !important;
    width: auto !important;
}
.sidebar-nav-link.has-submenu:not(.collapsed) .submenu-arrow { transform: rotate(90deg); }

/* Submenus */
.sidebar-submenu {
    list-style: none;
    padding: 2px 0 4px 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.sidebar-submenu.show { max-height: 600px; }

/* ============================================================
   Budget Preparation Center
   ============================================================ */
.prep-hero-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff7ef 0%, #ffffff 52%, #fff0df 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.prep-hero-copy h2 {
    margin-bottom: 0.5rem;
}

.prep-eyebrow {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.prep-hero-copy p {
    max-width: 820px;
    margin-bottom: 0;
    color: var(--text-secondary);
}

.prep-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.prep-stat-card,
.prep-source-card,
.prep-domain-card {
    height: 100%;
    padding: 1rem 1.125rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.prep-stat-card strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--dark);
}

.prep-stat-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.prep-source-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.prep-source-card p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.prep-flow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.prep-flow-step {
    position: relative;
    min-height: 100%;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #fff9f4 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.prep-flow-phase {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.prep-flow-step h5 {
    margin: 0.75rem 0 0.45rem;
    font-size: 1rem;
}

.prep-flow-step p {
    margin-bottom: 0.85rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.prep-flow-link {
    font-weight: 600;
}

.prep-domain-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.prep-domain-head i {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.prep-domain-head h5 {
    margin: 0;
}

.prep-domain-list {
    margin: 0;
    padding-left: 1rem;
    color: var(--text-secondary);
}

.prep-domain-list li + li {
    margin-top: 0.45rem;
}

@media (max-width: 992px) {
    .prep-hero-card {
        flex-direction: column;
    }

    .prep-hero-actions {
        justify-content: flex-start;
    }
}

.prep-workbench-card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.prep-workbench-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prep-workbench-section {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.prep-inline-metric {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.prep-table-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.prep-table-shell thead th {
    background: #f8fafc;
    white-space: nowrap;
}

.prep-side-stack {
    display: grid;
    gap: 1rem;
}

.prep-detail-card {
    padding: 1rem 1.1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.prep-detail-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.prep-logic-stack {
    display: grid;
    gap: 0.75rem;
}

.prep-logic-step {
    padding: 0.9rem;
    background: linear-gradient(180deg, #ffffff 0%, #fff9f4 100%);
    border: 1px solid #f0dcc8;
    border-radius: var(--radius);
}

.prep-logic-phase {
    display: inline-flex;
    padding: 0.18rem 0.55rem;
    margin-bottom: 0.55rem;
    border-radius: 999px;
    background: #fff1de;
    color: #a34a00;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.prep-logic-step h6 {
    margin-bottom: 0.35rem;
}

.prep-logic-step p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.prep-checklist {
    margin: 0;
    padding-left: 1rem;
    color: var(--text-secondary);
}

.prep-checklist li + li {
    margin-top: 0.5rem;
}

.prep-empty-note {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.prep-badge-list {
    display: grid;
    gap: 0.75rem;
}

.prep-badge-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #fff1de;
    border: 1px solid #f0dcc8;
    color: #a34a00;
    font-size: 0.78rem;
    font-weight: 700;
}

.prep-target-chip {
    display: block;
    padding: 0.85rem 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #fff9f4 100%);
    border: 1px solid #f0dcc8;
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.prep-target-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.prep-target-chip-disabled {
    pointer-events: none;
    opacity: 0.75;
}

.prep-target-label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.prep-target-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.prep-research-card {
    padding: 1.15rem 1.2rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.prep-research-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.prep-timeline {
    display: grid;
    gap: 0.85rem;
}

.prep-timeline-item {
    display: grid;
    grid-template-columns: minmax(98px, 120px) 1fr;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.9rem;
    border: 1px solid #f0dcc8;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #fff9f4 100%);
}

.prep-timeline-item p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.prep-timeline-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: #fff1de;
    color: #a34a00;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.prep-research-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.prep-research-table thead th {
    background: #f8fafc;
    white-space: nowrap;
}

.prep-rule-card {
    height: 100%;
    padding: 0.95rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #fff9f4 100%);
    border: 1px solid #f0dcc8;
    border-radius: var(--radius);
}

.prep-rule-title {
    margin-bottom: 0.4rem;
    color: var(--dark);
    font-weight: 700;
}

.prep-rule-card p {
    margin-bottom: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.prep-draft-list {
    display: grid;
    gap: 0.75rem;
}

.prep-draft-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fcfcfd;
}

.prep-draft-item.active {
    border-color: #f4b57b;
    background: #fff7ef;
}

.prep-draft-copy {
    min-width: 0;
}

.prep-draft-copy strong {
    display: block;
    margin-bottom: 0.15rem;
}

.prep-draft-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

@media (max-width: 768px) {
    .prep-draft-item {
        flex-direction: column;
    }

    .prep-draft-actions {
        flex-direction: row;
    }

    .prep-timeline-item {
        grid-template-columns: 1fr;
    }
}

.sidebar-submenu li a {
    display: block;
    padding: 5px 12px 5px 40px;
    color: var(--sidebar-text);
    font-size: 0.775rem;
    font-weight: 400;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
    opacity: 0.85;
}
.sidebar-submenu li a:hover { opacity: 1; background: var(--sidebar-hover); color: #fff; }
.sidebar-submenu li a.active {
    opacity: 1;
    color: var(--sidebar-active-text);
    background: var(--sidebar-active);
    font-weight: 500;
}

/* --- Content Area --- */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    transition: var(--transition-slow);
}
.content-wrapper.expanded {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
}

/* --- Navbar --- */
.navbar-wrapper {
    position: sticky;
    top: 0;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border);
    z-index: 1030;
    height: var(--navbar-height);
    box-shadow: var(--shadow-sm);
    width: 100%;
    flex-shrink: 0;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    height: 100%;
    padding: 0 20px;
    gap: 12px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
}

.navbar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.125rem;
    cursor: pointer;
    transition: var(--transition);
}
.navbar-toggle:hover { background: var(--bg); }

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--text);
}
.navbar-brand-icon { font-size: 1.25rem; }

.navbar-center {
    text-align: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px;
}
.navbar-lgu-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-fiscal-info {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.navbar-bell {
    position: relative;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}
.navbar-bell:hover { background: var(--bg); color: var(--text); }
.navbar-bell-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Dropdown */
.navbar-user-dropdown { position: relative; }
.navbar-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
    max-width: 100%;
}
.navbar-user-toggle:hover { border-color: var(--primary-lighter); background: var(--primary-bg); }
.navbar-user-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}
.navbar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 220px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1060;
    max-width: min(220px, calc(100vw - 24px));
}
.navbar-user-dropdown.show .navbar-user-menu { display: block; }

.navbar-user-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    color: var(--text);
    transition: var(--transition);
    text-decoration: none;
}
.navbar-user-menu-item:hover { background: var(--bg); color: var(--primary); }

/* --- Main Content (Phase 3: Bigger Padding) --- */
.main-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
    width: 100%;
    min-width: 0;
}

/* ============================================================
   BOOTSTRAP OVERRIDES - Cards, Forms, Tables, Buttons
   ============================================================ */

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.card-body { padding: 20px; }
.card-footer {
    background: var(--bg);
    border-top: 1px solid var(--border-light);
    padding: 12px 20px;
}

/* --- Forms (Phase 3: BIGGER, PROPORTIONAL, HARMONIOUS) --- */
.form-label {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: block;
}

.form-control,
.form-select {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--white);
    color: var(--text);
    transition: var(--transition);
    width: 100%;
    height: auto;
    min-height: 46px;
}
.form-control,
.form-select,
.input-group,
.select2-container {
    max-width: 100%;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(255,140,66,0.12);
    outline: none;
}
.form-control::placeholder { color: var(--text-muted); font-weight: 400; }

.form-control-sm {
    padding: 6px 10px;
    font-size: var(--font-size-sm);
    min-height: 34px;
}
.form-control-lg {
    padding: 14px 18px;
    font-size: var(--font-size-lg);
    min-height: 52px;
}

/* Form groups spacing */
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

/* Required field indicator */
.form-label .text-danger,
.required-star { color: var(--danger); }

/* Input group */
.input-group .form-control { border-radius: 0; }
.input-group .form-control:first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.input-group .form-control:last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.input-group-text {
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Select2 fix */
.select2-container { width: 100% !important; }
.select2-container .select2-selection--single {
    min-height: 46px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
}

/* --- Buttons (Clean, Proportional) --- */
.btn {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    line-height: 1.4;
    max-width: 100%;
    white-space: nowrap;
}
.btn:focus { box-shadow: 0 0 0 3px rgba(255,140,66,0.15); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #218838; border-color: #218838; color: #fff; }

.btn-warning { background: var(--warning); border-color: var(--warning); color: #2E3A4E; }
.btn-warning:hover { background: #e0a800; border-color: #e0a800; color: #2E3A4E; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; border-color: #c82333; color: #fff; }

.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #556275; border-color: #556275; color: #fff; }

.btn-info { background: var(--info); border-color: var(--info); color: #fff; }

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-outline-success { background: transparent; border-color: var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-outline-secondary { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: var(--font-size-xs); border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: var(--font-size-lg); }

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    opacity: 0.6;
}
.btn-close:hover { opacity: 1; }

/* --- Tables (Clean, Readable) --- */
.table {
    font-size: var(--font-size-sm);
    margin-bottom: 0;
    width: 100%;
}
.table > thead > tr > th {
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    background: var(--bg);
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.table > tbody > tr:last-child > td { border-bottom: none; }
.table-hover > tbody > tr:hover > td { background: rgba(255,140,66,0.04); }

.table-sm > thead > tr > th { padding: 8px 10px; }
.table-sm > tbody > tr > td { padding: 8px 10px; }

/* --- Badges --- */
.badge {
    font-family: var(--font-family);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}
.badge.bg-success, .badge-success { background: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-warning, .badge-warning { background: var(--warning-bg) !important; color: var(--warning) !important; }
.badge.bg-danger, .badge-danger { background: var(--danger-bg) !important; color: var(--danger) !important; }
.badge.bg-info, .badge-info { background: var(--info-bg) !important; color: var(--info) !important; }
.badge.bg-primary, .badge-primary { background: var(--primary-bg) !important; color: var(--primary) !important; }
.badge.bg-secondary { background: #FFF0E0 !important; color: var(--secondary) !important; }

/* --- Modals (Bigger, Cleaner) --- */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--white);
}
.modal-header .modal-title,
.modal-header h5 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg);
    gap: 8px;
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

/* Modal form layout - proportional grid */
.modal-body .row { margin-left: -8px; margin-right: -8px; }
.modal-body .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }

/* ============================================================
   DASHBOARD WIDGETS (KPI Cards) - Phase 3: Bigger
   ============================================================ */
.widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.widget-card.primary::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.widget-card.success::before { background: linear-gradient(90deg, var(--success), var(--success-light)); }
.widget-card.warning::before { background: linear-gradient(90deg, var(--warning), var(--warning-light)); }
.widget-card.danger::before { background: linear-gradient(90deg, var(--danger), var(--danger-light)); }
.widget-card.info::before { background: linear-gradient(90deg, var(--info), var(--info-light)); }

.widget-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 12px;
}
.widget-card.primary .widget-icon { background: var(--primary-bg); color: var(--primary); }
.widget-card.success .widget-icon { background: var(--success-bg); color: var(--success); }
.widget-card.warning .widget-icon { background: var(--warning-bg); color: var(--warning); }
.widget-card.danger .widget-icon { background: var(--danger-bg); color: var(--danger); }

.widget-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.widget-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}
.page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 2px 0 0;
}
.page-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin-right: 6px;
    color: var(--text-muted);
}
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text); font-weight: 500; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-width: 440px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary);
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

.toast-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
}
.toast-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    font-size: 1rem;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.85);
    z-index: 1090;
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
}
.loading-overlay.active { display: flex; }

.spinner-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 40px;
}
.loading-spinner.active { display: block; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--text-muted);
    font-size: 1.5rem;
}
.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.empty-state-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ============================================================
   REPORT STYLES (Print-Ready)
   ============================================================ */
.report-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.report-header {
    text-align: center;
    padding: 24px 32px 16px;
    border-bottom: 2px solid var(--text);
}
.report-header .republic { font-size: 0.8125rem; margin-bottom: 2px; }
.report-header .lgu-name { font-size: 1.125rem; font-weight: 700; text-transform: uppercase; }
.report-header .office-name { font-size: 0.875rem; color: var(--text-secondary); }
.report-header .report-title {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.report-header .report-period { font-size: 0.8125rem; color: var(--text-secondary); }

.report-params {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 32px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: var(--font-size-sm);
}
.report-params label { font-weight: 600; margin-right: 4px; }

.report-body { padding: 0; }

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.report-table th {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 8px 10px;
    font-weight: 600;
    text-align: center;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.report-table td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    vertical-align: top;
}
.report-table .text-end,
.report-table .text-right { text-align: right; }
.report-table .total-row {
    font-weight: 700;
    background: var(--bg);
    border-top: 2px solid var(--text);
}
.report-table .sub-total { font-weight: 600; background: #FFF8F2; }
.report-table .indent-1 { padding-left: 24px; }
.report-table .indent-2 { padding-left: 48px; }

.report-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
}
.report-signatories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-top: 48px;
}
.signatory-block { text-align: center; }
.signatory-line {
    border-top: 1px solid var(--text);
    margin: 0 16px;
    padding-top: 4px;
}
.signatory-name { font-weight: 600; font-size: var(--font-size-sm); }
.signatory-title { font-size: var(--font-size-xs); color: var(--text-secondary); }

/* Report action bar */
.report-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    /* Hide non-print elements */
    .sidebar-wrapper,
    .navbar-wrapper,
    .breadcrumb,
    .page-header-actions,
    .filter-bar,
    .report-actions,
    .btn,
    .toast-container,
    .loading-overlay,
    .no-print { display: none !important; }

    /* Reset layout */
    body {
        background: white !important;
        color: black !important;
        font-size: 10pt;
        margin: 0;
        padding: 0;
    }
    .main-wrapper { display: block; }
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .main-content { padding: 0 !important; }

    /* Report styles for print */
    .report-container {
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    .report-header { border-bottom: 2px solid black; }
    .report-table { font-size: 9pt; }
    .report-table th, .report-table td { border: 1px solid #333; padding: 4px 6px; }
    .report-signatories { margin-top: 60px; }

    .card { border: none !important; box-shadow: none !important; }
    .table { font-size: 9pt; }

    /* Page breaks */
    .page-break-before { page-break-before: always; }
    .page-break-after { page-break-after: always; }
    .no-page-break { page-break-inside: avoid; }

    @page {
        margin: 0.5in;
        size: letter;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-muted { color: var(--text-muted) !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

.currency-value { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ============================================================
   FINANCE MODERNIZATION UI COMPONENTS
   ============================================================ */
.finance-modernization-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top right, #ffe5cc 0, rgba(255, 229, 204, 0) 42%),
        linear-gradient(135deg, #fffaf5 0%, #ffffff 62%);
    box-shadow: var(--shadow-sm);
}

.finance-modernization-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.finance-modernization-header h3 {
    margin-bottom: 0.35rem;
    font-size: 1.125rem;
}

.finance-pill-list {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.finance-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b4a30;
    background: #fff3e5;
    border: 1px solid #ffd9b5;
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    white-space: nowrap;
}

.finance-gauge-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.finance-gauge-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: #fff;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 208px;
}

.finance-gauge-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.finance-gauge-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0;
}

.finance-gauge-ring {
    --gauge-pct: 0;
    --gauge-color: var(--success);
    width: 86px;
    height: 86px;
    border-radius: 50%;
    margin: 0 auto;
    background: conic-gradient(var(--gauge-color) calc(var(--gauge-pct) * 1%), #eceff3 0);
    position: relative;
}

.finance-gauge-ring::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: #fff;
}

.finance-gauge-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    z-index: 1;
}

.finance-gauge-meta {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.finance-gauge-meta strong {
    font-weight: 700;
    color: #2f435c;
}

.finance-link-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.finance-link-chip {
    border: 1px solid #ffddb8;
    border-radius: var(--radius-sm);
    background: #fff8f1;
    padding: 0.6rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    color: #805131;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
}

.finance-link-chip:hover {
    background: #fff0df;
    color: #5f3d24;
}

.audience-message-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.audience-message-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: #fff;
    padding: 0.85rem;
}

.audience-message-card h4 {
    font-size: 0.95rem;
    margin-bottom: 0.45rem;
}

.audience-message-card p {
    margin: 0;
    font-size: 0.79rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.audience-message-card.executive h4 { color: #8d4d21; }
.audience-message-card.staff h4 { color: #1e4f70; }
.audience-message-card.citizen h4 { color: #23663f; }

.mockup-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.mockup-pane {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: #fff;
    padding: 0.75rem;
}

.mockup-pane.before {
    background: linear-gradient(180deg, #fff8f8 0%, #fff 100%);
}

.mockup-pane.after {
    background: linear-gradient(180deg, #f4fffb 0%, #fff 100%);
}

.mockup-pane h5 {
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.mockup-list {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mockup-list li { margin-bottom: 0.28rem; }

.payment-journey {
    counter-reset: payment-step;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.payment-journey li {
    position: relative;
    border: 1px solid #d3e8dc;
    border-radius: var(--radius-sm);
    background: #f8fffb;
    padding: 0.65rem 0.6rem 0.6rem 2rem;
    font-size: 0.75rem;
    color: #2b5940;
    line-height: 1.45;
}

.payment-journey li::before {
    counter-increment: payment-step;
    content: counter(payment-step);
    position: absolute;
    top: 0.58rem;
    left: 0.55rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #1e9a5a;
    color: #fff;
    font-size: 0.69rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.journey-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.journey-cta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px dashed #b6d8c5;
    color: #1f5b3e;
    background: #effaf4;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    font-size: 0.69rem;
    font-weight: 600;
}

.workflow-guide-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fffdf9 0%, #fff 100%);
    padding: 0.85rem;
}

.workflow-guide-card h6 {
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.workflow-guide-card p {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-bottom: 0.55rem;
}

.workflow-checklist {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.workflow-checklist li {
    border: 1px solid #e6edf3;
    border-radius: var(--radius-sm);
    background: #fbfdff;
    padding: 0.42rem 0.55rem;
    font-size: 0.72rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.workflow-checklist li i {
    width: 1rem;
    text-align: center;
}

.workflow-checklist li.ok {
    border-color: #b8e8cd;
    background: #f2fcf6;
    color: #1e6b44;
}

.workflow-checklist li.pending {
    border-color: #f8ddb2;
    background: #fff9ef;
    color: #8a5a23;
}

.validation-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.45rem;
    white-space: nowrap;
}

.validation-chip.valid {
    color: #1e6b44;
    background: #e8faef;
}

.validation-chip.invalid {
    color: #92400e;
    background: #fff5df;
}

.approval-lane {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.approval-lane.three-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.approval-lane .lane-step {
    border: 1px solid #e4e9ef;
    border-radius: var(--radius-sm);
    padding: 0.42rem 0.45rem;
    text-align: center;
    font-size: 0.69rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
}

.approval-lane .lane-step.done {
    border-color: #b8e8cd;
    background: #eefcf4;
    color: #1e6b44;
}

.approval-lane .lane-step.current {
    border-color: #ffd59d;
    background: #fff6ea;
    color: #965113;
}

.service-clarity-note {
    border: 1px dashed #b7d7c6;
    border-radius: var(--radius-sm);
    background: #f3fcf7;
    font-size: 0.73rem;
    color: #1f5d3f;
    padding: 0.55rem 0.65rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar-wrapper {
        transform: translateX(calc(var(--sidebar-width) * -1));
        box-shadow: none;
    }
    .sidebar-wrapper.show {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .content-wrapper { margin-left: 0 !important; }
    .navbar-toggle { display: flex; align-items: center; justify-content: center; }
    .navbar-brand { display: flex; }

    /* Sidebar overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show { display: block; }
}

@media (min-width: 992px) {
    .navbar-brand { display: none; }
    .navbar-toggle { display: none; }
}

@media (max-width: 767.98px) {
    .main-content { padding: 16px; }

    .page-header { flex-direction: column; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1; justify-content: center; }
    .navbar { padding: 0 12px; gap: 8px; }
    .navbar-right { gap: 6px; }
    .navbar-user-toggle {
        padding-right: 8px;
        max-width: 180px;
    }
    .navbar-user-name { max-width: 96px; }

    .page-title { font-size: var(--font-size-xl); }

    /* Stack filters vertically */
    .row.mb-3 > [class*="col-"] { margin-bottom: 8px; }

    /* Modal full width on mobile */
    .modal-dialog { margin: 8px; max-width: calc(100% - 16px); }
    .modal-body { padding: 16px; }

    /* Report adjustments */
    .report-header { padding: 16px; }
    .report-table { font-size: 0.7rem; }
    .report-table th, .report-table td { padding: 4px 6px; }
    .report-signatories { grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (max-width: 575.98px) {
    .main-content { padding: 12px; }
    .widget-value { font-size: 1.25rem; }
    .navbar-user-name { display: none; }
    .navbar-center { display: none; }
    .navbar-user-menu {
        right: 0;
        left: auto;
        width: min(220px, calc(100vw - 24px));
    }
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-wrap: wrap;
    }
    .btn {
        white-space: normal;
        text-align: center;
        justify-content: center;
    }
    .card-footer .btn,
    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        flex: 1 1 100%;
    }

    .finance-gauge-grid,
    .finance-link-grid,
    .audience-message-grid,
    .mockup-split-grid,
    .payment-journey {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .card-footer .d-flex,
    .card-footer.d-flex,
    .modal-footer {
        flex-wrap: wrap;
    }
    .card-footer .btn,
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .finance-gauge-grid,
    .audience-message-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-link-grid,
    .payment-journey {
        grid-template-columns: 1fr;
    }

    .mockup-split-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   LEGACY COMPATIBILITY
   ============================================================ */
/* Support for modules using old class names */
.container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
