/* ==========================================================================
   Vestigo Insurance Brokers - Marine Declaration Management System
   Custom CSS (no external frameworks)
   ========================================================================== */

:root {
    --navy: #1B2A4A;
    --navy-light: #28406b;
    --navy-dark: #121d33;
    --gold: #C9A84C;
    --gold-light: #ddc283;
    --white: #FFFFFF;
    --green: #2E7D32;
    --green-bg: #E6F4EA;
    --amber: #B8860B;
    --amber-bg: #FFF6DD;
    --red: #C62828;
    --red-bg: #FBEAEA;
    --gray-bg: #F4F6FA;
    --border-color: #E1E5EC;
    --text-dark: #1B2A4A;
    --text-muted: #6B7785;
    --sidebar-width: 250px;
    --topbar-height: 64px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background-color: var(--gray-bg);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--navy);
    text-decoration: none;
}

/* ==========================================================================
   Login Page
   ========================================================================== */

.login-body {
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    border-top: 5px solid var(--gold);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    padding: 36px 32px;
    width: 100%;
}

.login-brand {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo-img {
    display: block;
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.login-company {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--navy);
    margin-top: 10px;
}

.login-tagline {
    font-size: 11px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 6px;
}

.login-divider {
    height: 1px;
    background-color: var(--gold);
    margin: 20px 0 24px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--navy);
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}

.btn-login {
    background-color: var(--gold);
    color: var(--navy);
    font-weight: 700;
    margin-top: 6px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-login:hover {
    background-color: var(--gold-light);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.35);
}

.login-copyright {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
}

/* ==========================================================================
   App Shell / Sidebar / Topbar
   ========================================================================== */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo-pill {
    width: 180px;
    height: 45px;
    background-color: var(--white);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px 10px;
}

.sidebar-logo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-company {
    font-size: 12px;
    color: var(--gold);
    margin-top: 4px;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: background-color 0.15s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(201, 168, 76, 0.4);
}

.nav-link.active {
    background-color: rgba(201, 168, 76, 0.15);
    border-left-color: var(--gold);
    color: var(--gold);
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.nav-sublink {
    padding: 8px 20px 8px 44px;
    font-size: 13px;
    font-weight: 400;
}

.nav-section-label {
    padding: 16px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.nav-sublink .nav-icon {
    font-size: 10px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-tagline {
    line-height: 1.4;
}

.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--navy);
    cursor: pointer;
    padding: 4px 8px;
}

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

.content {
    padding: 24px;
    flex: 1;
    width: 100%;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--navy);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--navy-light);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--navy);
    border-color: var(--navy);
}

.btn-secondary:hover {
    background-color: var(--gray-bg);
}

.btn-danger {
    background-color: var(--white);
    color: var(--red);
    border-color: var(--red);
}

.btn-danger:hover {
    background-color: var(--red-bg);
}

.btn-link {
    background: none;
    color: var(--navy);
    text-decoration: underline;
    border: none;
    padding: 9px 4px;
}

.btn-logout {
    background-color: var(--gold);
    color: var(--navy);
}

.btn-logout:hover {
    background-color: var(--gold-light);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ==========================================================================
   Alerts / Flash Messages
   ========================================================================== */

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 13px;
}

.alert-success {
    background-color: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green);
}

.alert-error {
    background-color: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
}

.toast {
    padding: 12px 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success {
    background-color: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green);
}

.toast-error {
    background-color: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red);
}

.toast-hide {
    opacity: 0;
    transform: translateX(40px);
}

/* ==========================================================================
   Panels
   ========================================================================== */

.panel {
    background-color: var(--white);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-header h2 {
    font-size: 18px;
    color: var(--navy);
    font-weight: 700;
}

.panel-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.form-section-title {
    color: var(--navy);
    font-size: 15px;
    font-weight: 700;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
}

/* ==========================================================================
   Search
   ========================================================================== */

.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    min-width: 240px;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
}

.filter-select {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    background-color: var(--white);
}

.filter-select:focus {
    outline: none;
    border-color: var(--gold);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th, .data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background-color: var(--navy);
    color: var(--white);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background-color: var(--gray-bg);
}

.sortable-table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.sortable-table th[data-sort]:hover {
    background-color: var(--navy-light);
}

.sortable-table th.sort-asc::after {
    content: ' \25B2';
    font-size: 10px;
}

.sortable-table th.sort-desc::after {
    content: ' \25BC';
    font-size: 10px;
}

.empty-row {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
    white-space: normal;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.inline-form {
    display: inline-block;
}

.client-link {
    color: var(--navy);
    font-weight: 600;
    text-decoration: underline;
}

/* Row colour coding by utilisation */
.row-green {
    background-color: var(--green-bg);
}

.row-amber {
    background-color: var(--amber-bg);
}

.row-red {
    background-color: var(--red-bg);
}

.row-selected {
    background-color: rgba(201, 168, 76, 0.15);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green {
    background-color: var(--green-bg);
    color: var(--green);
}

.badge-amber {
    background-color: var(--amber-bg);
    color: var(--amber);
}

.badge-red {
    background-color: var(--red-bg);
    color: var(--red);
}

/* ==========================================================================
   Metric Cards (Dashboard)
   ========================================================================== */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background-color: var(--white);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-left: 5px solid var(--navy);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.metric-link {
    display: block;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.metric-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: var(--gold);
}

.metric-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 4px;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-navy {
    border-left-color: var(--navy);
}

.metric-navy .metric-value {
    color: var(--navy);
}

.metric-gold {
    border-left-color: var(--gold);
}

.metric-gold .metric-value {
    color: var(--gold);
}

.metric-green {
    border-left-color: var(--green);
}

.metric-green .metric-value {
    color: var(--green);
}

.metric-red {
    border-left-color: var(--red);
}

.metric-red .metric-value {
    color: var(--red);
}

.metric-amber {
    border-left-color: var(--amber);
}

.metric-amber .metric-value {
    color: var(--amber);
}

.alert-icon {
    font-size: 20px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--navy);
    font-size: 13px;
}

.required {
    color: var(--red);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.readonly-field {
    background-color: var(--gray-bg);
    font-weight: 700;
    color: var(--navy);
}

.field-hint {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 4px;
    white-space: normal;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.client-form textarea {
    resize: vertical;
}

.import-form .form-group {
    margin-bottom: 16px;
}

/* ==========================================================================
   Detail View (Client View / Reports)
   ========================================================================== */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 24px;
    margin-bottom: 8px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item-full {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
}

.detail-highlight {
    color: var(--navy);
    font-size: 16px;
}

.text-red {
    color: var(--red) !important;
}

/* ==========================================================================
   Utilisation Bars
   ========================================================================== */

.utilisation-bar {
    width: 100%;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.utilisation-bar.large {
    height: 16px;
}

.utilisation-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.bar-green {
    background-color: var(--green);
}

.bar-amber {
    background-color: var(--amber);
}

.bar-red {
    background-color: var(--red);
}

.utilisation-section {
    margin-top: 16px;
}

.utilisation-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}

/* ==========================================================================
   Summary Card (Declaration Detail)
   ========================================================================== */

.summary-card {
    background-color: var(--gray-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}

/* ==========================================================================
   Declaration Table
   ========================================================================== */

.declaration-table {
    min-width: 1500px;
}

.declaration-table th, .declaration-table td {
    text-align: center;
}

.period-cell {
    text-align: left !important;
    font-weight: 700;
    color: var(--navy);
}

.amount-input {
    width: 95px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: right;
    font-size: 12px;
}

.declaration-table input[type="date"] {
    width: 130px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.declaration-table select {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.total-declared-cell {
    font-weight: 700;
    color: var(--navy);
    background-color: var(--gray-bg);
}

.date-action-cell {
    min-width: 140px;
}

.date-display {
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

/* ==========================================================================
   Card Grid (Declarations List)
   ========================================================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.client-card {
    display: block;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.client-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.client-card-title {
    font-weight: 700;
    color: var(--navy);
    font-size: 15px;
}

.client-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 12px;
}

.client-card-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.client-card-row strong {
    color: var(--text-dark);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

.print-header {
    display: none;
}

@media print {
    .sidebar, .topbar, .no-print, .sidebar-overlay, .sidebar-toggle {
        display: none !important;
    }

    .main-area {
        margin-left: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    .panel {
        box-shadow: none;
        border: none;
    }

    .print-header {
        display: block;
        text-align: center;
        margin-bottom: 16px;
        border-bottom: 2px solid var(--navy);
        padding-bottom: 12px;
    }

    .print-header h1 {
        color: var(--navy);
        font-size: 20px;
        letter-spacing: 2px;
    }

    .print-header p {
        color: var(--gold);
        font-size: 12px;
        font-weight: 700;
        margin-top: 4px;
    }

    body {
        background-color: var(--white);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .sidebar-toggle {
        display: inline-block;
    }

    .sidebar-overlay.show {
        display: block;
    }

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

    .form-group-full {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .content {
        padding: 16px;
    }

    .panel {
        padding: 14px;
    }

    .page-title {
        font-size: 16px;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar-user {
        display: none;
    }

    .metric-value {
        font-size: 20px;
    }

    .search-input {
        min-width: 0;
        flex: 1;
    }

    .panel-header-actions {
        width: 100%;
    }

    .panel-header-actions .btn {
        flex: 1;
    }
}

/* ==========================================================================
   Security / Error Pages (403, Session Expired, Account Locked, Password Expired)
   ========================================================================== */

.security-card {
    text-align: center;
}

.security-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
}

.security-icon-red {
    color: var(--red);
}

.security-icon-gold {
    color: var(--gold);
}

.security-title {
    color: var(--navy);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.security-message {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.security-card .login-form {
    text-align: left;
}

.security-card .btn-block {
    margin-bottom: 8px;
}

/* ==========================================================================
   Session Timer / Status Pills
   ========================================================================== */

.session-timer {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.session-timer.session-timer-warn {
    color: var(--red);
}

.badge-gray {
    background-color: var(--gray-bg);
    color: var(--text-muted);
}

.badge-navy {
    background-color: rgba(27, 42, 74, 0.1);
    color: var(--navy);
}

/* ==========================================================================
   Checkboxes, permission grids & profile/admin panels
   ========================================================================== */

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
}

.permission-table th, .permission-table td {
    vertical-align: middle;
}

.permission-table td.permission-radios {
    white-space: nowrap;
}

.permission-radio-group {
    display: flex;
    gap: 14px;
}

.permission-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.stat-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-pill {
    background-color: var(--gray-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 16px;
    min-width: 120px;
}

.stat-pill-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--navy);
}

.stat-pill-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }

    .login-logo-img {
        max-width: 200px;
    }

    .login-company {
        font-size: 13px;
    }

    .login-divider {
        margin: 16px 0 20px;
    }
}

/* ==========================================================================
   Inline Link Button (e.g., "+ Add Branch" next to label)
   ========================================================================== */

.btn-inline-link {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 8px;
    text-decoration: none;
    vertical-align: middle;
    transition: color 0.15s ease;
}

.btn-inline-link:hover {
    color: var(--navy);
}

/* ==========================================================================
   Modal Overlay / Quick Add Branch
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background-color: var(--white);
    border-radius: 8px;
    border-top: 4px solid var(--gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: var(--navy);
}

.modal-body {
    padding: 20px 24px 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-actions {
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
}

/* ==========================================================================
   Branch Management (insurer edit page)
   ========================================================================== */

.branch-add-form {
    background-color: var(--gray-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 8px;
}

.branch-add-form .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.edit-branch-name,
.edit-branch-city,
.edit-branch-state {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background-color: #fffef5;
}

.edit-branch-state {
    background-color: var(--gray-bg);
    color: var(--text-muted);
}
