/* ========================================
   Pre-Hospital Care Records - Corporate Design
   Professional, Clean with Heavy Shadows
   ======================================== */

/* ========================================
   CSS Variables - Design Tokens
   ======================================== */
:root {
    /* Primary Palette - Bold Corporate Colors */
    --primary: #0052CC;
    --primary-hover: #0041A3;
    --primary-light: #E6F0FF;

    /* Accent Colors - Flashy & Vibrant */
    --accent-success: #00875A;
    --accent-warning: #FF8B00;
    --accent-danger: #DE350B;
    --accent-info: #0065FF;
    --accent-purple: #5243AA;
    --accent-teal: #00A3BF;

    /* Neutral Palette - HIGH CONTRAST for visibility */
    --text-primary: #1a1a1a;
    --text-secondary: #333333;
    --text-muted: #555555;
    --border-color: #DFE1E6;
    --bg-light: #F4F5F7;
    --bg-white: #FFFFFF;

    /* Shadows - Subtle & Clean */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 6px 12px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 2px 6px rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 0.6875rem;    /* 11px */
    --font-size-sm: 0.75rem;      /* 12px */
    --font-size-base: 0.875rem;   /* 14px */
    --font-size-md: 1rem;         /* 16px */
    --font-size-lg: 1.25rem;      /* 20px */
    --font-size-xl: 1.5rem;       /* 24px */
    --font-size-2xl: 2rem;        /* 32px */

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

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

/* ========================================
   Base Styles
   ======================================== */
body {
    background-color: #EBECF0;
    padding: var(--space-lg);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.5;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* ========================================
   Main Container
   ======================================== */
.records-container {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}

/* ========================================
   Header Section - Strong Hierarchy
   ======================================== */
.header-section {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 3px solid var(--primary);
}

.header-section h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #000000 !important;
    margin: 0 0 var(--space-sm) 0;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-section h1 i {
    color: var(--primary);
    font-size: var(--font-size-lg);
}

.header-section h2 {
    font-size: var(--font-size-base);
    color: #333333 !important;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0;
}

/* ========================================
   Statistics Cards - Heavy Shadows
   ======================================== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background-color: var(--bg-white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    border-left: 5px solid var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    opacity: 0.05;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: var(--font-size-2xl);
    margin: 0 0 var(--space-xs) 0;
    font-weight: 800;
    color: #000000 !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-card p {
    margin: 0;
    color: #222222 !important;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card p i {
    margin-right: var(--space-xs);
    color: #444444 !important;
}

/* Card Color Variants */
.stat-card:nth-child(5) { border-left-color: var(--primary); }
.stat-card:nth-child(5)::after { background-color: var(--primary); }

.stat-card:nth-child(6) { border-left-color: var(--accent-success); }
.stat-card:nth-child(6)::after { background-color: var(--accent-success); }

.stat-card:nth-child(7) { border-left-color: var(--accent-warning); }
.stat-card:nth-child(7)::after { background-color: var(--accent-warning); }

.stat-card:nth-child(8) { border-left-color: var(--accent-teal); }
.stat-card:nth-child(8)::after { background-color: var(--accent-teal); }

/* ========================================
   Action Section
   ======================================== */
.action-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background-color: var(--bg-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.search-box {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input::placeholder {
    color: #666666;
}

.search-box input {
    color: #1a1a1a !important;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.action-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ========================================
   Custom Buttons - Bold & Corporate
   ======================================== */
.btn-custom {
    padding: 10px 20px;
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none !important;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    white-space: nowrap;
    font-family: var(--font-family);
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-custom:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-custom:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Remove underline from all buttons globally */
button, .btn, .btn-custom, .btn-table,
[type="button"], [type="submit"], [role="button"],
a, a:hover, a:focus, a:active {
    text-decoration: none !important;
}

/* Notiflix button overrides */
#NotiflixConfirmWrap button, #NotiflixConfirmWrap a,
#NotiflixNotifyWrap button, #NotiflixNotifyWrap a,
#NotiflixReportWrap button, #NotiflixReportWrap a,
#NotiflixBlockWrap button, #NotiflixBlockWrap a,
.notiflix-confirm-button, .notiflix-report-button, .nx-button,
[id^="Notiflix"] button, [id^="Notiflix"] a,
[class*="notiflix"] button, [class*="notiflix"] a {
    text-decoration: none !important;
}

/* Ensure button links inherit color */
a.btn-custom,
a.btn-table,
a.btn-primary-custom,
a.btn-secondary-custom,
a.btn-success-custom,
a.btn-view,
a.btn-edit,
a.btn-delete,
a.btn-success {
    color: #FFFFFF !important;
}

a.btn-custom:hover,
a.btn-table:hover {
    color: #FFFFFF !important;
}

.btn-primary-custom {
    background-color: var(--primary);
    color: #FFFFFF !important;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    color: #FFFFFF !important;
}

.btn-secondary-custom {
    background-color: #505F79;
    color: #FFFFFF !important;
}

.btn-secondary-custom:hover {
    background-color: #42526E;
    color: #FFFFFF !important;
}

.btn-success-custom {
    background-color: var(--accent-success);
    color: #FFFFFF !important;
}

.btn-success-custom:hover {
    background-color: #006644;
    color: #FFFFFF !important;
}

/* ========================================
   Filters Section
   ======================================== */
.filters-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.filters-card .form-label {
    font-weight: 700;
    color: #1a1a1a !important;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    display: block;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    padding: 10px 12px;
    color: #1a1a1a !important;
    background-color: var(--bg-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-weight: 500;
}

.form-control::placeholder {
    color: #666666;
    font-weight: 400;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

/* ========================================
   Table Container - Elevated Design
   ======================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background-color: var(--bg-white);
    box-shadow: var(--shadow-elevated);
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-white);
    font-size: var(--font-size-base);
}

.custom-table thead {
    background-color: #0052CC !important;
}

.custom-table th {
    padding: 16px 14px;
    text-align: left;
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #FFFFFF !important;
    white-space: nowrap;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.2) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    background-color: #0052CC !important;
}

.custom-table th:last-child {
    border-right: none !important;
}

.custom-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    color: #1a1a1a !important;
    vertical-align: middle;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.custom-table td:first-child {
    font-weight: 700;
    color: #333333 !important;
    border-right: 1px solid var(--border-color);
}

.custom-table tbody tr {
    transition: background-color 0.15s ease;
}

.custom-table tbody tr:nth-child(even) {
    background-color: #e8f0fe;
}

.custom-table tbody tr:hover {
    background-color: var(--primary-light);
}

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

/* Ensure icons and text in table cells are visible */
.custom-table td i {
    color: #444444 !important;
}

.custom-table td strong {
    color: #000000 !important;
    font-weight: 700;
}

.custom-table td .text-muted {
    color: #555555 !important;
}

/* Force all table text to be dark */
.custom-table td,
.custom-table td * {
    color: #1a1a1a;
}

.custom-table td a {
    color: #0052CC !important;
    font-weight: 600;
}

/* ========================================
   Status Badges - Vibrant Colors
   ======================================== */
.badge-custom {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    display: inline-block;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.status-completed {
    background-color: var(--accent-success);
    color: #FFFFFF !important;
}

.status-draft {
    background-color: var(--accent-warning);
    color: #FFFFFF !important;
}

.status-pending {
    background-color: var(--accent-info);
    color: #FFFFFF !important;
}

.status-archived {
    background-color: var(--accent-purple);
    color: #FFFFFF !important;
}

/* ========================================
   Table Action Buttons
   ======================================== */
.action-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    display: inline-block;
    margin: 0 2px;
}

.btn-table {
    padding: 8px 14px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-table:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-table:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-view {
    background-color: var(--accent-info);
    color: #FFFFFF !important;
}

.btn-view:hover {
    background-color: #0052CC;
    color: #FFFFFF !important;
}

.btn-edit {
    background-color: var(--accent-warning);
    color: #FFFFFF !important;
}

.btn-edit:hover {
    background-color: #FF991F;
    color: #FFFFFF !important;
}

.btn-delete {
    background-color: var(--accent-danger);
    color: #FFFFFF !important;
}

.btn-delete:hover {
    background-color: #BF2600;
    color: #FFFFFF !important;
}

.btn-success {
    background-color: var(--accent-success) !important;
    color: #FFFFFF !important;
    border: none !important;
}

.btn-success:hover {
    background-color: #006644 !important;
    color: #FFFFFF !important;
}

/* ========================================
   Action Dropdown Menu
   ======================================== */
.action-dropdown {
    text-align: center;
}

.action-dropdown-btn {
    background-color: var(--primary);
    border: 1px solid var(--primary);
    color: #FFFFFF !important;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.action-dropdown-btn:hover {
    background-color: var(--primary-hover);
    color: #FFFFFF !important;
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.action-dropdown-btn:focus,
.action-dropdown-btn.show {
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--primary-hover);
    color: #FFFFFF !important;
}

.action-dropdown-btn::after {
    display: none; /* Remove the default Bootstrap caret */
}

.action-chevron {
    font-size: 9px;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.action-dropdown.show .action-chevron {
    transform: rotate(180deg);
}

.action-dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    min-width: 160px;
    z-index: 1050;
}

.action-dropdown-menu .dropdown-item {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: #1a1a1a !important;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s ease;
}

.action-dropdown-menu .dropdown-item:hover {
    background-color: var(--primary-light);
    color: #0052CC !important;
}

.action-dropdown-menu .dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: var(--font-size-sm);
}

.action-dropdown-menu .dropdown-item-danger {
    color: #DE350B !important;
}

.action-dropdown-menu .dropdown-item-danger:hover {
    background-color: #fff0f0;
    color: #BF2600 !important;
}

.action-dropdown-menu .dropdown-item-danger i {
    color: #DE350B !important;
}

.action-dropdown-menu .dropdown-divider {
    margin: 4px 0;
    border-top-color: var(--border-color);
}

/* ========================================
   Skeleton Loaders
   ======================================== */
.skeleton {
    background: #DFE1E6;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-loader {
    display: none;
}

.loading .skeleton-loader {
    display: table-row-group;
}

.loading .table-content {
    display: none;
}

.skeleton-card {
    background-color: var(--bg-white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 5px solid #DFE1E6;
}

.skeleton-title {
    height: 32px;
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
}

.skeleton-text.short {
    width: 60%;
}

.loading .stats-cards .stat-card {
    display: none;
}

.loading .stats-cards .skeleton-card {
    display: block;
}

.stats-cards .skeleton-card {
    display: none;
}

.skeleton-row {
    display: table-row;
}

.skeleton-cell {
    display: table-cell;
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-bar {
    height: 14px;
    border-radius: var(--radius-sm);
    margin: 4px 0;
}

.skeleton-bar.short { width: 60%; }
.skeleton-bar.medium { width: 80%; }
.skeleton-bar.long { width: 95%; }

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: #333333 !important;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: var(--space-lg);
    color: #888888 !important;
}

.empty-state p {
    font-size: var(--font-size-md);
    margin-bottom: var(--space-lg);
    color: #1a1a1a !important;
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    border: none;
    transition: all 0.2s ease;
    font-size: var(--font-size-md);
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25);
}

.back-to-top.show {
    display: flex;
}

/* ========================================
   Pagination - Corporate Style
   ======================================== */
.pagination {
    gap: 4px;
}

.pagination .page-link {
    border: 2px solid var(--border-color);
    color: #1a1a1a !important;
    font-weight: 600;
    font-size: var(--font-size-sm);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
    margin: 0 2px;
}

.pagination .page-link:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary) !important;
    box-shadow: var(--shadow-md);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF !important;
    box-shadow: var(--shadow-md);
}

.pagination .page-item.disabled .page-link {
    color: #666666 !important;
    background-color: var(--bg-light);
    border-color: var(--border-color);
    box-shadow: none;
}

/* ========================================
   Modal Styles - Corporate Design
   ======================================== */
#viewRecordModal .modal-dialog {
    max-width: 900px;
}

#viewRecordModal .modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#viewRecordModal .modal-header {
    background-color: #0052CC;
    color: #FFFFFF;
    border-bottom: none;
    padding: 18px 24px;
}

#viewRecordModal .modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: #FFFFFF !important;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

#viewRecordModal .modal-title i {
    color: #FFFFFF !important;
    opacity: 0.9;
    margin-right: 10px;
}

#viewRecordModal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

#viewRecordModal .btn-close:hover {
    opacity: 1;
}

#viewRecordModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
    background-color: #FFFFFF;
}

#viewRecordModal .modal-footer {
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    gap: 10px;
}

#viewRecordModal .modal-footer .btn {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#viewRecordModal .modal-footer .btn-outline-secondary {
    color: #555555;
    border-color: var(--border-color);
}

#viewRecordModal .modal-footer .btn-outline-secondary:hover {
    background-color: #F4F5F7;
    color: #1a1a1a;
}

#viewRecordModal .modal-footer .btn-outline-primary {
    color: #0052CC;
    border-color: #0052CC;
}

#viewRecordModal .modal-footer .btn-outline-primary:hover {
    background-color: #0052CC;
    color: #FFFFFF;
}

#viewRecordModal .modal-footer .btn-primary {
    background-color: #0052CC;
    border-color: #0052CC;
    color: #FFFFFF;
}

#viewRecordModal .modal-footer .btn-primary:hover {
    background-color: #0041A3;
    border-color: #0041A3;
}

/* Scrollbar styling for modal */
#viewRecordModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#viewRecordModal .modal-body::-webkit-scrollbar-track {
    background: #E8E8E8;
    border-radius: 4px;
}

#viewRecordModal .modal-body::-webkit-scrollbar-thumb {
    background: #B3BAC5;
    border-radius: 4px;
}

#viewRecordModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #8993A4;
}

/* ========================================
   Record Count Display
   ======================================== */
.records-container > div[style*="background-color: #f8f9fa"] {
    background-color: var(--primary-light) !important;
    border: 2px solid var(--primary) !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-md) !important;
    box-shadow: var(--shadow-sm) !important;
}

.records-container > div[style*="background-color: #f8f9fa"] strong {
    color: #0052CC !important;
    font-weight: 700 !important;
    font-size: var(--font-size-base) !important;
}

.records-container > div[style*="background-color: #f8f9fa"] strong i {
    color: #0052CC !important;
}

/* ========================================
   Responsive Design - Tablet
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: var(--space-md);
    }

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

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

    .action-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .action-buttons {
        justify-content: center;
    }

    .back-to-top {
        width: 46px;
        height: 46px;
        bottom: 16px;
        right: 16px;
    }

    .header-section h1 {
        font-size: var(--font-size-lg);
    }
}

/* ========================================
   Responsive Design - Mobile
   ======================================== */
@media (max-width: 576px) {
    body {
        padding: var(--space-sm);
    }

    .records-container {
        padding: var(--space-md);
        border-radius: var(--radius-md);
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .stat-card h3 {
        font-size: var(--font-size-xl);
    }

    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 12px;
        right: 12px;
    }

    /* Adjust button sizes for mobile */
    .btn-table {
        padding: 6px 10px;
        font-size: 10px;
        margin: 1px;
    }

    .btn-custom {
        padding: 8px 16px;
        font-size: var(--font-size-sm);
    }

    /* Adjust table font size for mobile */
    .custom-table {
        font-size: var(--font-size-sm);
    }

    .custom-table th {
        padding: 12px 10px;
        font-size: 10px;
    }

    .custom-table td {
        padding: 10px;
    }

    /* Modal adjustments for mobile */
    #viewRecordModal .modal-dialog {
        max-width: 100vw;
        margin: 0;
    }

    #viewRecordModal .modal-body {
        max-height: 60vh;
        padding: var(--space-md);
    }

    #viewRecordModal .modal-header,
    #viewRecordModal .modal-footer {
        padding: var(--space-md);
    }

    .header-section h1 {
        font-size: var(--font-size-md);
    }

    .header-section h2 {
        font-size: var(--font-size-sm);
    }

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

/* ========================================
   Print Styles
   ======================================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .records-container {
        box-shadow: none;
        padding: 0;
    }

    .action-section,
    .filters-card,
    .back-to-top,
    .btn-table,
    .pagination {
        display: none !important;
    }

    .table-container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .custom-table th {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========================================
   FORCE HIGH CONTRAST TEXT - Override all light colors
   ======================================== */
.records-container,
.records-container * {
    --text-color-override: #1a1a1a;
}

/* Force dark text on all readable elements */
.stat-card h3,
.stat-card p,
.header-section h1,
.header-section h2,
.custom-table td,
.filters-card label,
.form-label,
input,
select,
textarea {
    color: #1a1a1a !important;
}

/* Ensure stat card numbers are black and bold */
.stat-card h3 {
    color: #000000 !important;
    font-weight: 800 !important;
    opacity: 1 !important;
}

/* Ensure stat card labels are dark */
.stat-card p {
    color: #222222 !important;
    font-weight: 700 !important;
    opacity: 1 !important;
}

/* Ensure table data is readable */
.custom-table tbody td {
    color: #1a1a1a !important;
    opacity: 1 !important;
}

/* Override any Bootstrap text-muted or similar classes */
.text-muted {
    color: #555555 !important;
}

/* Ensure record count display is visible */
.records-container > div strong {
    color: #1a1a1a !important;
}
