/* ==========================================================================
   CLAIM MANAGEMENT SYSTEM - PREMIUM DESIGN SYSTEM (VANILLA CSS)
   ========================================================================== */

/* Import Outfit font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - HSL Tailored */
    --primary-hue: 250;
    --primary: hsl(var(--primary-hue), 85%, 60%);
    --primary-hover: hsl(var(--primary-hue), 85%, 52%);
    --primary-light: hsla(var(--primary-hue), 85%, 60%, 0.15);
    
    --success: hsl(142, 70%, 45%);
    --success-light: hsla(142, 70%, 45%, 0.15);
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsla(38, 92%, 50%, 0.15);
    --danger: hsl(350, 80%, 55%);
    --danger-light: hsla(350, 80%, 55%, 0.15);
    --info: hsl(195, 85%, 50%);
    --info-light: hsla(195, 85%, 50%, 0.15);

    /* Fonts */
    --font-heading: 'Outfit', 'Sarabun', sans-serif;
    --font-body: 'Outfit', 'Sarabun', sans-serif;

    /* Global Variables - Theme Overrides */
    --transition-speed: 0.3s;
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
    
    /* Layout */
    --container-max-width: 1400px;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-app: radial-gradient(circle at top left, hsl(210, 40%, 98%), hsl(220, 30%, 95%));
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(240, 244, 248, 0.8);
    --border-color: rgba(200, 214, 229, 0.5);
    --border-color-focus: var(--primary);
    --text-main: hsl(222, 47%, 12%);
    --text-muted: hsl(220, 15%, 45%);
    --glass-blur: 15px;
    --glass-border: rgba(255, 255, 255, 0.6);
    --glow-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --table-header-bg: rgba(241, 245, 249, 0.9);
    --table-row-hover: rgba(241, 245, 249, 0.5);
    --stat-card-overlay: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-app: radial-gradient(circle at top left, hsl(222, 47%, 8%), hsl(224, 47%, 4%));
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-card-hover: rgba(15, 23, 42, 0.85);
    --bg-input: rgba(30, 41, 59, 0.7);
    --border-color: rgba(51, 65, 85, 0.5);
    --border-color-focus: var(--primary);
    --text-main: hsl(210, 40%, 98%);
    --text-muted: hsl(215, 20%, 65%);
    --glass-blur: 20px;
    --glass-border: rgba(255, 255, 255, 0.05);
    --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --scrollbar-track: #0f172a;
    --scrollbar-thumb: #334155;
    --table-header-bg: rgba(30, 41, 59, 0.8);
    --table-row-hover: rgba(30, 41, 59, 0.4);
    --stat-card-overlay: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
}

/* ==========================================================================
   BASE & LAYOUT STYLES
   ========================================================================== */

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

html, body {
    height: 100%;
    font-family: var(--font-body);
    color: var(--text-main);
    background: var(--bg-app);
    background-attachment: fixed;
    overflow-x: hidden;
    scroll-behavior: smooth;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Main App Wrapper */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Glassmorphism utility card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--glow-shadow);
    transition: transform var(--transition-speed) var(--transition-bounce), 
                box-shadow var(--transition-speed) ease,
                background-color var(--transition-speed) ease,
                border-color var(--transition-speed) ease;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-bounce);
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px hsla(var(--primary-hue), 85%, 60%, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(var(--primary-hue), 85%, 60%, 0.4);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 14px hsla(350, 80%, 55%, 0.3);
}
.btn-danger:hover {
    background: hsl(350, 80%, 48%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(350, 80%, 55%, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
    background: var(--border-color);
    transform: rotate(15deg);
}

/* Forms Inputs */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-control:focus {
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}
.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(120, 120, 120, 0.1);
}

/* Select element specific styling */
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* ==========================================================================
   AUTHENTICATION SCREEN (LOGIN)
   ========================================================================== */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--border-radius-lg);
    animation: fadeInUp 0.6s var(--transition-bounce) both;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
    animation: float 4s ease-in-out infinite;
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo p {
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-card form {
    margin-top: 10px;
}

.login-footer-info {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */

.app-header {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand .icon {
    font-size: 1.8rem;
    color: var(--primary);
}

.header-brand h2 {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.user-info .username {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info .role-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-end;
}

.role-badge.admin {
    background: var(--danger-light);
    color: var(--danger);
}

.role-badge.user {
    background: var(--primary-light);
    color: var(--primary);
}

/* ==========================================================================
   DASHBOARD MAIN CONTAINER
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 32px 0 60px;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--stat-card-overlay);
    z-index: 1;
}

.stat-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

.stat-card-header .icon {
    font-size: 1.5rem;
    padding: 8px;
    border-radius: var(--border-radius-sm);
}

.stat-card-header .title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

/* Apply colors dynamically to stat cards */
.stat-card.total .icon { background: var(--primary-light); color: var(--primary); }
.stat-card.pending .icon { background: var(--warning-light); color: var(--warning); }
.stat-card.repairing .icon { background: var(--info-light); color: var(--info); }
.stat-card.completed .icon { background: var(--success-light); color: var(--success); }

/* Control Panel (Actions, Filters) */
.control-panel {
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.action-row .btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    align-items: flex-end;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    padding-left: 42px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

/* ==========================================================================
   CLAIMS DATA TABLE
   ========================================================================== */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
    background: transparent;
}

.data-table th, .data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    user-select: none;
    position: relative;
    cursor: pointer;
}

.data-table th.sortable:hover {
    color: var(--text-main);
}

.data-table th.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.3;
}

.data-table th.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--primary);
}

.data-table th.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--primary);
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--table-row-hover);
}

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

/* Claims table details column styling */
.claim-id-cell {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
}

.product-cell {
    max-width: 250px;
}

.product-cell .prod-name {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-cell .prod-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Custom Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: none;
    letter-spacing: normal;
}

/* 1. Status-รับสินค้า Badges */
.badge-status-waiting {
    background: var(--warning-light);
    color: var(--warning);
}
.badge-status-received {
    background: var(--primary-light);
    color: var(--primary);
}
.badge-status-repairing {
    background: var(--info-light);
    color: var(--info);
}

/* 2. ผลการเคลม Badges */
.badge-claim-new {
    background: var(--success-light);
    color: var(--success);
}
.badge-claim-repair {
    background: var(--primary-light);
    color: var(--primary);
}
.badge-claim-cancel {
    background: var(--danger-light);
    color: var(--danger);
}

/* 3. ซ่อมเสร็จพร้อมส่ง Badges */
.badge-ready-wait {
    background: var(--warning-light);
    color: var(--warning);
}
.badge-ready-booking {
    background: var(--info-light);
    color: var(--info);
}
.badge-ready-booked {
    background: var(--success-light);
    color: var(--success);
}

/* Empty State */
.table-empty-state {
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.table-empty-state .icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    opacity: 0.4;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s var(--transition-bounce);
    overflow: hidden;
}

.modal-backdrop.active .modal-container {
    transform: translateY(0) scale(1);
}

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

.modal-header h3 {
    font-size: 1.35rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Grid Layout inside Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 24px;
}

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

/* Image preview section */
.image-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-preview-box {
    width: 100%;
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: var(--bg-input);
}

.image-preview-box img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.image-preview-box .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
}

.image-preview-box .placeholder .icon {
    font-size: 2.5rem;
}

/* User Management Panel inside Modal */
.user-mgmt-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .user-mgmt-layout {
        grid-template-columns: 1fr;
    }
}

.user-list-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.user-item:last-child {
    border-bottom: none;
}

.user-item-info {
    display: flex;
    flex-direction: column;
}

.user-item-info .username-lbl {
    font-weight: 600;
}

.user-item-info .role-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Bulk Upload Sheet Preview styling */
.import-preview-box {
    margin-top: 16px;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    background: var(--bg-input);
}

.import-preview-box h4 {
    margin-bottom: 10px;
}

.import-preview-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.import-preview-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

/* ==========================================================================
   PRINT PREVIEW STYLES (MODAL / GENERAL)
   ========================================================================== */

.print-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.print-document {
    background: #ffffff;
    color: #1a1a1a;
    padding: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: 'Sarabun', 'Segoe UI', sans-serif;
    line-height: 1.5;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px double #cbd5e1;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.print-logo-info h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
}

.print-logo-info p {
    font-size: 0.85rem;
    color: #475569;
    margin-top: 4px;
}

.print-doc-meta {
    text-align: right;
}

.print-doc-meta h1 {
    font-size: 1.6rem;
    color: hsl(250, 85%, 60%);
    margin-bottom: 6px;
}

.print-doc-meta p {
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.print-section {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
}

.print-section h4 {
    font-size: 0.95rem;
    color: #0f172a;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 6px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.print-row {
    display: flex;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.print-label {
    width: 140px;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
}

.print-value {
    color: #0f172a;
    word-break: break-word;
}

.print-img-section {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
}

.print-img-section h4 {
    font-size: 0.95rem;
    color: #0f172a;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.print-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.print-image-card {
    max-width: 100%;
    max-height: 250px;
    border: 1px solid #e2e8f0;
    padding: 4px;
    border-radius: 4px;
}

.print-image-card img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.print-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #cbd5e1;
    font-size: 0.85rem;
    color: #475569;
}

.print-sign {
    text-align: center;
    width: 200px;
}

.print-sign-line {
    margin-top: 40px;
    border-bottom: 1px solid #94a3b8;
}

.print-sign-title {
    margin-top: 6px;
    font-size: 0.8rem;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */

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

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .user-profile {
        width: 100%;
        justify-content: space-between;
    }
    .action-row {
        flex-direction: column;
        align-items: stretch;
    }
    .action-row .btn-group {
        justify-content: stretch;
    }
    .action-row .btn-group .btn {
        flex: 1;
    }
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PRINT MEDIA STYLE OVERRIDES
   ========================================================================== */

@media print {
    /* Hide everything on the page except the printable block */
    body * {
        visibility: hidden;
    }
    
    .print-document, .print-document * {
        visibility: visible;
    }
    
    .print-document {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    
    .modal-backdrop, .modal-container, .modal-body {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }
    
    /* Ensure colors look correct on paper */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
