:root {
    --dgi-primary: #8F001A;
    --dgi-primary-dark: #6d0014;
    --dgi-primary-light: #a61a33;
    --bs-primary: #8F001A;
    --bs-primary-rgb: 143, 0, 26;
    --bs-link-color: #8F001A;
    --bs-link-hover-color: #6d0014;
}

body {
    background-color: #f4f6f9;
}

.btn-primary {
    --bs-btn-bg: #8F001A;
    --bs-btn-border-color: #8F001A;
    --bs-btn-hover-bg: #6d0014;
    --bs-btn-hover-border-color: #6d0014;
    --bs-btn-active-bg: #5a0010;
    --bs-btn-active-border-color: #5a0010;
    --bs-btn-disabled-bg: #8F001A;
    --bs-btn-disabled-border-color: #8F001A;
}

.btn-outline-primary {
    --bs-btn-color: #8F001A;
    --bs-btn-border-color: #8F001A;
    --bs-btn-hover-bg: #8F001A;
    --bs-btn-hover-border-color: #8F001A;
    --bs-btn-active-bg: #6d0014;
    --bs-btn-active-border-color: #6d0014;
}

.bg-primary {
    background-color: #8F001A !important;
}

.text-primary {
    color: #8F001A !important;
}

.border-primary {
    border-color: #8F001A !important;
}

.nav-pills .nav-link.active {
    background-color: #8F001A;
}

.page-link {
    color: #8F001A;
}

.page-item.active .page-link {
    background-color: #8F001A;
    border-color: #8F001A;
}

.form-check-input:checked {
    background-color: #8F001A;
    border-color: #8F001A;
}

.breadcrumb-item a {
    color: #8F001A;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #6d0014;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background-color: #1a1a2e !important;
    flex-shrink: 0;
}

.sidebar-nav {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar .nav-link {
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-link:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
    flex-shrink: 0;
}

/* Sticky sidebar on desktop */
@media (min-width: 992px) {
    .dashboard-layout {
        align-items: flex-start;
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow: hidden;
    }
}

/* Page header */
.page-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-header-accent {
    height: 3px;
    background: linear-gradient(90deg, #8F001A 0%, #a61a33 50%, #8F001A 100%);
}

.page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.5rem;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.page-header-toggle {
    flex-shrink: 0;
}

.page-header-text {
    min-width: 0;
}

.page-header-panel {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8F001A;
    background: rgba(143, 0, 26, 0.08);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    margin-bottom: 0.3rem;
}

.page-header-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.25;
}

.page-header-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.2rem;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.page-header-meta {
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    white-space: nowrap;
}

.page-content {
    padding: 1.5rem;
}

.dashboard-main {
    min-width: 0;
    background-color: #f4f6f9;
}

.sidebar-logo {
    max-height: 48px;
    width: auto;
}

.sidebar-brand-text {
    font-size: 1.25rem;
    letter-spacing: 0.12em;
    color: #fff;
}

.stat-icon {
    color: #8F001A;
}

.card-header-primary {
    background-color: #8F001A;
    color: #fff;
}

.route-status-bar {
    background-color: #8F001A;
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
}

/* Action buttons */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.action-btn-view:hover {
    background: #e7f1ff;
    border-color: #0d6efd;
    color: #0d6efd;
}

.action-btn-edit:hover {
    background: #fff3cd;
    border-color: #ffc107;
    color: #cc9a06;
}

.action-btn-delete:hover {
    background: #f8d7da;
    border-color: #dc3545;
    color: #dc3545;
}

/* DataTables */
.dataTables_wrapper .dataTables-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables-toolbar-left,
.dataTables_wrapper .dataTables-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

div.dataTables_wrapper div.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

div.dataTables_wrapper div.dataTables_length select {
    width: auto;
    min-width: 72px;
    display: inline-block;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 30px 6px 12px;
    margin: 0;
    background-color: #fff;
}

div.dataTables_wrapper div.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
}

div.dataTables_wrapper div.dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 12px;
    min-width: 220px;
    margin-left: 0 !important;
}

div.dataTables_wrapper div.dataTables_info {
    padding-top: 0.75rem;
    color: #6c757d;
    font-size: 0.875rem;
}

div.dataTables_wrapper div.dataTables_paginate {
    padding-top: 0.75rem;
}

/* Export buttons - separate styled buttons, not joined group */
.dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dt-buttons .btn-group {
    display: contents;
}

.dt-buttons .btn-group > .btn {
    border-radius: 6px !important;
    margin: 0 !important;
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
}

.dt-buttons .btn-group > .btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

.dt-buttons .btn-group > .btn.btn-primary,
.dt-buttons .btn-group > .btn.dt-button.buttons-excel,
.dt-buttons .btn-group > .btn.dt-button.buttons-pdf {
    background-color: #8F001A;
    border-color: #8F001A;
    color: #fff;
}

.dt-buttons .btn-group > .btn.btn-primary:hover,
.dt-buttons .btn-group > .btn.dt-button.buttons-excel:hover,
.dt-buttons .btn-group > .btn.dt-button.buttons-pdf:hover {
    background-color: #6d0014;
    border-color: #6d0014;
    color: #fff;
}

table.dataTable thead th {
    border-bottom: 2px solid #dee2e6 !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

@media (max-width: 991.98px) {
    .page-header-inner {
        padding: 1rem 1.15rem;
    }

    .page-header-title {
        font-size: 1.2rem;
    }

    .page-content {
        padding: 1rem;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        z-index: 1040;
        transition: left 0.25s ease;
    }

    .sidebar.show {
        left: 0;
    }

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

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

.spf-banner {
    background: #d8f4f4;
    color: #1a8f8f;
    font-weight: 700;
    text-align: center;
    padding: 0.65rem 1rem;
    border-radius: 8px 8px 0 0;
    letter-spacing: 0.02em;
    margin-bottom: 0;
}

.spf-banner + .card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.spf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 1rem;
}

.spf-grid-one {
    grid-template-columns: 1fr;
}

.spf-field {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 0.5rem;
}

.spf-label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.spf-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 210px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
}

.spf-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

    .spf-field {
        grid-template-columns: 1fr;
    }
}

.app-list-table thead th {
    background: #1f7fb3;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    font-weight: 600;
}

.app-print {
    max-width: 960px;
    margin: 0 auto;
}

.app-print-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.app-print-logo {
    height: 40px;
}

.app-print-title {
    flex: 1;
    text-align: center;
    color: #333;
}

.app-print-id {
    font-size: 12px;
    font-weight: 600;
}

.app-print-paper {
    background: #fff;
    border: 1px solid #ddd;
    padding: 16px 20px 28px;
}

.app-print-bar {
    background: #0b1f6b;
    color: #fff;
    text-align: center;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 20px;
    margin: 18px 0 10px;
}

.app-print-photo {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 6px;
}

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

.app-print-table th,
.app-print-table td {
    border: 1px solid #e6e6e6;
    padding: 7px 10px;
    vertical-align: top;
}

.app-print-table th {
    width: 18%;
    background: #f7f7f7;
    font-weight: 600;
    color: #333;
}

.app-print-edu th {
    background: #fff;
    text-align: center;
    width: auto;
}

.app-print-statement {
    font-size: 13px;
    line-height: 1.55;
    padding: 8px 4px 16px;
    white-space: pre-line;
}

@media print {
    .d-print-none,
    .admin-sidebar,
    .top-navbar,
    nav.breadcrumb {
        display: none !important;
    }

    .app-print-paper {
        border: none;
    }
}

.ws-modal .modal-content {
    border: none;
    border-radius: 10px;
}

.ws-modal .modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 12px 18px;
}

.ws-tabs {
    border-bottom: 1px solid #dee2e6;
}

.ws-tabs .nav-link {
    color: #5c6570;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 8px 14px;
}

.ws-tabs .nav-link.active {
    color: #0b1f6b;
    background: transparent;
    border-bottom-color: #0b1f6b;
}

.ws-banner {
    background: #c8f4f7;
    color: #0b1f6b;
    text-align: center;
    font-weight: 700;
    padding: 10px 12px;
    margin: 8px 0 14px;
}

.ws-meta {
    font-size: 13px;
    line-height: 1.7;
}

.ws-info th {
    width: 140px;
    color: #555;
    font-weight: 600;
    background: #fafafa;
}

.ws-offer-row tbody tr {
    background: #eef9ee;
}

.ws-route-form .col-form-label {
    font-size: 13px;
    font-weight: 600;
}
