/* Base styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
main {
    flex: 1 0 auto;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
header {
    background-color: var(--primary-color);
    padding: 1rem 0;
    width: 100%;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0;
    padding: 0;
}

.nav-links a,
.nav-links .nav-link {
    color: white !important;
    text-decoration: none;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links .nav-link:hover {
    color: var(--secondary-color) !important;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu span {
    color: white;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 100;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px 0;
    transition: var(--transition);
}

/* Footer (static page footer) */
.site-footer,
footer {
    margin-top: auto;
    background-color: var(--primary-color);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    position: static;
    width: 100%;
    background-color: transparent;
    transform: none;
    z-index: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    color: white;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    padding: 1.25rem 1rem;
}

.footer-content .footer-links {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0;
}

.footer-content .footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.25rem 0.15rem;
}

.footer-content .footer-links a:hover {
    text-decoration: underline;
}

.footer-content .footer-sep {
    margin: 0 0.5rem;
    opacity: 0.7;
}

@media (max-width: 576px) {
    .footer-content {
        font-size: 0.95rem;
        padding: 1rem;
    }

    .footer-content .footer-links {
        flex-direction: column;
        gap: 0.35rem;
    }

    .footer-content .footer-sep {
        display: none;
    }
}

/* Unified login mode toggle */
.login-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.35rem;
    background: #eef2f6;
    border-radius: 8px;
}

.login-mode-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    background: transparent;
}

.login-mode-btn:hover {
    text-decoration: none;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.7);
}

.login-mode-btn.active {
    background: #fff;
    color: var(--secondary-color);
    box-shadow: var(--shadow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    text-align: center;
    min-height: 38px;
    line-height: 1;
    white-space: nowrap;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    min-height: 32px;
}

.btn-secondary {
    background-color: var(--text-light);
}

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

.btn-primary {
    color: #fff;
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-secondary:hover {
    background-color: #e9ecef;
    border-color: #ddd;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group .btn:not(:last-child) {
    margin-right: -1px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    text-align: center;
}

.alert-success {
    background-color: var(--success-color);
    color: white;
}

.alert-danger {
    background-color: var(--danger-color);
    color: white;
}

/* Cards */
.card {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Forms */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
    margin-top: 2rem;
    text-align: right;
}

.form-actions .btn {
    margin-left: 0.5rem;
}

.form-actions .btn-primary {
    color: #fff;
    background-color: #3498db;
    border-color: #3498db;
}

.form-actions .btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.form-actions .btn-secondary:hover {
    background-color: #e9ecef;
    border-color: #ddd;
}

.form-actions .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.form-actions .btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.form-actions .btn-group .btn {
    position: relative;
    flex: 1 1 auto;
}

.form-actions .btn-group .btn:not(:last-child) {
    margin-right: -1px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.form-actions .btn-group .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Tables */
.table-container {
    margin: 1rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
}

.table {
    width: 100%;
    margin-bottom: 0;
    background-color: transparent;
    border-collapse: collapse;
}

.table th,
.table td {
    min-width: 120px;
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table th:first-child,
.table td:first-child {
    min-width: 150px; /* Name column */
}

.table th:nth-child(2),
.table td:nth-child(2) {
    min-width: 200px; /* Email column */
}

.table th:nth-child(3),
.table td:nth-child(3) {
    min-width: 120px; /* Phone column */
}

.table th:nth-child(4),
.table td:nth-child(4) {
    min-width: 150px; /* Company column */
}

.table th:nth-child(5),
.table td:nth-child(5) {
    min-width: 100px; /* Status column */
}

.table th:last-child,
.table td:last-child {
    min-width: 120px; /* Actions column */
}

.table th {
    background-color: #e9ecef;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
    vertical-align: bottom;
    text-align: left;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.2s ease;
}

.table th:hover {
    color: #0d6efd;
}

.table th.no-sort {
    cursor: default;
}

.table th.no-sort:hover {
    color: #495057;
}

.table th a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.75rem;
}

.table th a.sort-asc::after {
    content: "↑";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.2em;
}

.table th a.sort-desc::after {
    content: "↓";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.2em;
}

.table tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e9ecef;
}

/* Welcome section */
.welcome-section {
    margin-top: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

.welcome-section h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.welcome-section p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 4rem;
    text-align: center;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    margin-bottom: 0;
}

/* Call to action section */
.cta-section {
    text-align: center;
    margin-top: 3rem;
}

/* Error section */
.error-section {
    text-align: center;
    padding: 4rem 0;
}

.error-section h1 {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-section p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h1 {
    margin: 0;
    color: #2c3e50;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 4px;
}

.badge-success {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Forms */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -1rem;
    margin-left: -1rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #f8f9fa;
    opacity: 1;
}

.form-text {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Custom Checkboxes */
.custom-control {
    position: relative;
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5rem;
}

.custom-control-input {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
}

.custom-control-label::before {
    position: absolute;
    top: 0.25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
    color: #fff;
    border-color: #3498db;
    background-color: #3498db;
}

/* Error Pages */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.error-content {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

.error-content h1 {
    font-size: 6rem;
    margin: 0;
    color: #3498db;
    line-height: 1;
}

.error-content h2 {
    font-size: 2rem;
    margin: 1rem 0;
    color: #2c3e50;
}

.error-content p {
    color: #666;
    margin-bottom: 2rem;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    width: 100%;
}

.col {
    flex: 1 0 0%;
    padding: 0 1rem;
}

/* Base column widths (for mobile first) */
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }

/* Utility Classes */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Media Queries */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
    
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
}

@media (min-width: 992px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        z-index: 99;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .user-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-container {
        padding: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevent zoom on mobile */
    }
}

.invalid-feedback {
    display: none;
    color: red;
}

.was-validated .form-control:invalid ~ .invalid-feedback {
    display: block;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-grid .checkbox-group {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: center;
}

.form-grid .button-group {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.form-grid .button-group .btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Filter Section */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.filter-grid .form-group {
    margin-bottom: 0;
}

.filter-grid .form-group label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.filter-grid .form-control {
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

.filter-actions {
    display: block;
    margin: auto;
}

.filter-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions .btn {
        width: 100%;
    }
}

.pagination-controls {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-wrapper .record-count {
    color: #6c757d;
    font-size: 0.875rem;
    white-space: nowrap;
}

.pagination-wrapper form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-left: auto;
}

.pagination-wrapper label {
    margin: 0;
    white-space: nowrap;
}

.pagination-wrapper .form-select-sm,
.pagination-wrapper .form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    width: auto;
    min-width: 60px;
}

.pagination-wrapper .form-control-sm {
    width: 60px;
    text-align: center;
}

.pagination-wrapper .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
    min-width: 32px;
}

.pagination-wrapper .btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.pagination-wrapper span {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination-wrapper .record-count {
        text-align: center;
    }
    
    .pagination-wrapper form {
        margin-left: 0;
        justify-content: center;
    }
}

/* Contacts table specific styles */
.contacts-table th,
.contacts-table td {
    min-width: 120px;
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.contacts-table th:first-child,
.contacts-table td:first-child {
    min-width: 150px; /* Name column */
}

.contacts-table th:nth-child(2),
.contacts-table td:nth-child(2) {
    min-width: 200px; /* Email column */
}

.contacts-table th:nth-child(3),
.contacts-table td:nth-child(3) {
    min-width: 120px; /* Phone column */
}

.contacts-table th:nth-child(4),
.contacts-table td:nth-child(4) {
    min-width: 150px; /* Company column */
}

.contacts-table th:nth-child(5),
.contacts-table td:nth-child(5) {
    min-width: 100px; /* Status column */
}

.contacts-table th:last-child,
.contacts-table td:last-child {
    min-width: 120px; /* Actions column */
}

/* Users table specific styles */
.table th span {
    display: inline-block;
    padding-right: 20px;
}

.table th .sort-link {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.75rem;
}

.table th .sort-link.sort-asc::after {
    content: "↑";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.2em;
}

.table th .sort-link.sort-desc::after {
    content: "↓";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.2em;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.25rem;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    color: #0d6efd;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0a58ca;
}

.pagination .active span {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.pagination .disabled span {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Filters */
.filters-container {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.filters-form {
    margin-bottom: 0;
}

.filters-form .form-group {
    margin-bottom: 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    color: #fff;
    background-color: #198754;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group .btn:not(:last-child) {
    margin-right: -1px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Lookup pages: filter and Add button on one row */
.lookup-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.lookup-toolbar .lookup-filter-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}
.lookup-toolbar .lookup-filter-form label {
    margin: 0;
    white-space: nowrap;
}
.lookup-toolbar .lookup-filter-form select {
    width: auto;
    min-width: 6rem;
}
.clipping-preview {
    white-space: pre-wrap;
    word-break: break-word;
    color: #334155;
}
.lookup-toolbar .lookup-add-btn {
    flex-shrink: 0;
}

.bulk-col {
    width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}
.bulk-actions-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.bulk-actions-form label {
    margin: 0;
    white-space: nowrap;
}
.bulk-actions-form select {
    min-width: 10rem;
}

/* Claim form — full-width edit layout */
.claim-form-page {
    max-width: 100%;
    width: 100%;
}
.claim-form-page .welcome-section {
    max-width: none;
    width: 100%;
}
.claim-form-card {
    background: var(--bg-light, #fff);
    padding: 1.5rem 1.75rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: none;
}
.claim-form {
    width: 100%;
}
.claim-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem 1.5rem;
    width: 100%;
}
.claim-details-grid .form-group {
    margin-bottom: 0;
}
.claim-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}
.claim-tab-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}
.claim-tab-btn.active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}
.claim-tab-pane {
    display: none;
    margin-top: 0.5rem;
    width: 100%;
}
.claim-tab-pane.active {
    display: block;
}
.claim-section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.claim-section-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}
.claim-add-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.claim-add-panel-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}
.claim-add-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.claim-add-grid .full-span {
    grid-column: 1 / -1;
}
.claim-add-panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.claim-empty-hint {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0.75rem 0 0;
}
.claim-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}
.file-number-lock-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.file-number-lock-row .form-control {
    flex: 1;
}
.file-number-lock-row .form-control[readonly] {
    background: #f1f5f9;
    cursor: default;
}
.lookup-input-wrap {
    position: relative;
    min-width: 220px;
}
.lookup-dropdown {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    max-height: 240px;
    overflow-y: auto;
}
.lookup-option {
    padding: 0.45rem 0.75rem;
    cursor: pointer;
}
.lookup-option:hover,
.lookup-option:focus {
    background: #eef2ff;
    outline: none;
}
.lookup-empty {
    padding: 0.5rem 0.75rem;
    color: #64748b;
}
.claim-inline-table {
    width: 100%;
    table-layout: auto;
}
.claim-inline-table th,
.claim-inline-table td {
    position: static;
    min-width: 0;
}
.claim-inline-table th[data-sort] {
    padding-right: 1.25rem;
}
.claim-inline-table th.sort-asc::after,
.claim-inline-table th.sort-desc::after {
    position: static;
    display: inline;
    margin-left: 0.25rem;
    font-size: 0.7em;
    color: #6c757d;
    transform: none;
}
.claim-inline-table th.sort-asc::after {
    content: "▲";
}
.claim-inline-table th.sort-desc::after {
    content: "▼";
}
.checkbox-inline-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.75rem;
    font-weight: 500;
}
.claim-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}
.claim-modal[hidden] {
    display: none !important;
}
.claim-modal-dialog {
    max-width: 420px;
    width: calc(100% - 2rem);
    margin: 1rem;
    padding: 1.5rem;
}
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }
@media (max-width: 992px) {
    .claim-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .claim-details-grid,
    .claim-add-grid {
        grid-template-columns: 1fr;
    }
}
