/* Guard Scheduling Web Application Stylesheet */

:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Theme Palette - Modern Dark Theme */
    --bg-app: #0b0f19;
    --bg-card: rgba(20, 26, 44, 0.65);
    --bg-sidebar: rgba(13, 17, 30, 0.85);
    --border-glass: rgba(255, 255, 255, 0.06);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Accent Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --secondary: #1e293b;
    --secondary-hover: #334155;
    
    /* Shift Color Palettes (Harmonious tailwind-like colors) */
    --color-cp: #eab308;
    --color-p11: #3b82f6;
    --color-p12: #0284c7;
    --color-p21: #10b981;
    --color-p22: #059669;
    --color-co: #14b8a6;
    --color-cm: #ef4444;
    --color-lp: #06b6d4;
    --color-ev: #6b7280;
    --color-8: #f97316;

    /* Utilities */
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Layout structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Controls */
.sidebar {
    width: 290px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 28px;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition-smooth);
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    margin: 0;
    border-right: none;
    overflow: hidden;
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--border-radius-sm);
}

.btn-close-sidebar:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.btn-toggle-sidebar {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.sidebar.collapsed ~ .main-content .btn-toggle-sidebar {
    display: inline-flex;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-text h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-section h3 i {
    width: 14px;
    height: 14px;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.control-select {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.control-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    width: auto;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Shift Palette */
.palette-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.palette-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
    position: relative;
    user-select: none;
}

.palette-item strong {
    font-size: 12px;
    color: var(--shift-color, var(--text-primary));
}

.palette-item span {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

.palette-item i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.palette-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
}

.palette-item.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.palette-help {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
    margin-top: 4px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.save-indicator.saving {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-icon {
    animation: spin 1s linear infinite;
}

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

.title-area h2 {
    font-size: 28px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.title-area p {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-picker-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.date-picker-cell input {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    padding: 6px 12px;
    outline: none;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px;
}

.grid-card {
    padding: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

/* Interactive Grid/Table Styles */
.table-outer-wrapper {
    overflow: auto;
    flex: 1;
    width: 100%;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    font-size: 13px;
    text-align: center;
}

th, td {
    padding: 10px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    min-width: 44px; /* Larger cell size for better usability */
    height: 44px;
}

th {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Second header row (weekdays) sticky */
#tr-header-weekdays th {
    top: 44px;
    border-bottom: 1px solid var(--border-glass);
}

/* Sticky First 2 columns (Nr, Name) */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 12;
    background: #111827;
}

.col-nr {
    width: 44px;
    min-width: 44px;
    border-right: 1px solid var(--border-glass) !important;
}

.col-name {
    left: 44px;
    width: 190px;
    min-width: 190px;
    text-align: left;
    font-weight: 500;
    border-right: 2px solid var(--border-glass) !important;
}

.col-sig-header {
    min-width: 140px !important;
    width: 140px !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
}

thead .sticky-col {
    z-index: 20;
}

/* Row & Column Crosshair Highlighting */
tbody tr.hover-row td {
    background-color: rgba(255, 255, 255, 0.025) !important;
}

td.hover-col {
    background-color: rgba(255, 255, 255, 0.025) !important;
}

td.hover-active {
    background-color: rgba(255, 255, 255, 0.05) !important;
    outline: 1.5px solid var(--primary) !important;
    outline-offset: -1.5px;
}

/* Day cells weekends styling */
.day-cell.weekend {
    background: rgba(59, 130, 246, 0.04);
}

.day-cell.weekend-sat {
    background: rgba(59, 130, 246, 0.06);
}

.day-cell.weekend-sun {
    background: rgba(59, 130, 246, 0.08);
}

/* Grid input schedule cells */
.day-cell.editable-cell {
    cursor: cell;
    transition: background-color 0.1s;
    user-select: none;
    font-weight: 700;
}

/* Shift Cell Highlight Colors */
.cell-shift-CP { background-color: rgba(234, 179, 8, 0.18) !important; color: var(--color-cp) !important; border: 1px solid rgba(234, 179, 8, 0.3) !important; }
.cell-shift-P1-1 { background-color: rgba(59, 130, 246, 0.18) !important; color: #60a5fa !important; border: 1px solid rgba(59, 130, 246, 0.3) !important; }
.cell-shift-P1-2 { background-color: rgba(2, 132, 199, 0.18) !important; color: #38bdf8 !important; border: 1px solid rgba(2, 132, 199, 0.3) !important; }
.cell-shift-P2-1 { background-color: rgba(16, 185, 129, 0.18) !important; color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.3) !important; }
.cell-shift-P2-2 { background-color: rgba(5, 150, 105, 0.18) !important; color: #059669 !important; border: 1px solid rgba(5, 150, 105, 0.3) !important; }
.cell-shift-CO { background-color: rgba(20, 184, 166, 0.18) !important; color: #2dd4bf !important; border: 1px solid rgba(20, 184, 166, 0.3) !important; }
.cell-shift-CM { background-color: rgba(239, 68, 68, 0.18) !important; color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.3) !important; }
.cell-shift-LP { background-color: rgba(6, 182, 212, 0.18) !important; color: #22d3ee !important; border: 1px solid rgba(6, 182, 212, 0.3) !important; }
.cell-shift-EV { background-color: rgba(107, 114, 128, 0.18) !important; color: #9ca3af !important; border: 1px solid rgba(107, 114, 128, 0.3) !important; }
.cell-shift-8 { background-color: rgba(249, 115, 22, 0.18) !important; color: #fb923c !important; border: 1px solid rgba(249, 115, 22, 0.3) !important; }

/* Summary Calculations Columns */
.calc-col {
    background-color: rgba(13, 17, 30, 0.4);
    font-weight: 500;
}

.col-total-hours {
    font-weight: 700;
    color: var(--primary);
}

.col-norm {
    color: var(--text-secondary);
}

.col-overtime {
    font-weight: 700;
    color: #fbbf24;
}

.col-overtime.negative {
    color: #f87171;
}

.col-signature {
    font-weight: 600;
    color: #34d399;
    border-right: 2px solid var(--border-glass) !important;
}

/* Total row footer styles */
.total-row td {
    font-weight: 700;
    background: rgba(15, 23, 42, 0.95);
    border-top: 2px solid var(--border-glass);
    border-bottom: 2px solid var(--border-glass);
}

.total-row .sticky-col {
    background: #0f172a !important;
}

/* Delete user action */
.btn-delete-user {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-delete-user:hover {
    color: var(--color-cm);
}

/* Footer & Dashboard Statistics */
.dashboard-footer {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    width: 20px;
    height: 20px;
}

.card-data {
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.card-value {
    font-size: 18px;
    font-weight: 800;
    color: white;
}

/* Legend Styles */
.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.legend-header:hover h4 {
    color: var(--primary) !important;
}

.legend-header:hover .legend-chevron {
    color: var(--primary) !important;
}

.legend-chevron {
    transition: var(--transition-smooth);
    color: var(--text-muted);
}

.legend-card.collapsed .legend-chevron {
    transform: rotate(-90deg);
}

.legend-card.collapsed .legend-collapsible-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.legend-collapsible-content {
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
}

.legend-card h4 {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.legend-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.legend-group h5 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.legend-group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-group li {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    min-width: 36px;
    text-align: center;
}

.legend-note {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-note i {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

/* Interactive cell editing modal / popover */
.cell-popover {
    position: absolute;
    z-index: 1000;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 6px;
}

.popover-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    padding: 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
}

.popover-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-container {
    animation: fadeIn 0.4s ease-out;
}

/* -------------------------------------------------------------
   PRINT STYLESHEET
   ------------------------------------------------------------- */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }
    
    body {
        background: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .sidebar, 
    .workspace-header .header-actions, 
    .btn-delete-user, 
    .palette-help,
    .btn-group-vertical,
    #btn-add-guard,
    .app-container {
        display: none !important;
    }
    
    .print-only-layout {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        color: black !important;
    }
}

/* Print Only Layout Styles (Used by html2pdf) */
.print-only-layout {
    display: none;
    box-sizing: border-box;
    width: 297mm !important; /* A4 Landscape dimensions */
    height: 210mm !important;
    background: white !important;
    color: black !important;
    font-family: 'Inter', sans-serif !important;
    padding: 6mm 10mm !important; /* Slightly smaller top/bottom margin */
}

.print-only-layout * {
    color: black !important;
    box-sizing: border-box;
}

/* Top Header */
.print-only-layout .print-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 4mm !important; /* Smaller margin */
    width: 100% !important;
}

.print-only-layout .header-left,
.print-only-layout .header-right {
    width: 33% !important;
    font-size: 9.5pt !important;
    line-height: 1.3 !important;
}

.print-only-layout .header-left .company-name {
    font-weight: 700 !important;
}
.print-only-layout .header-left .dept-name,
.print-only-layout .header-left .obj-name {
    font-weight: 600 !important;
}
.print-only-layout .header-left .doc-number {
    margin-top: 4px !important;
    font-style: italic !important;
}

.print-only-layout .header-center {
    width: 34% !important;
    text-align: center !important;
}
.print-only-layout .header-center .doc-title {
    font-weight: 700 !important;
    font-size: 14pt !important;
    letter-spacing: 1px !important;
}
.print-only-layout .header-center .doc-subtitle {
    font-weight: 600 !important;
    font-size: 10pt !important;
}
.print-only-layout .header-center .doc-month-year {
    font-weight: 700 !important;
    font-size: 12pt !important;
    margin-top: 1px !important;
}
.print-only-layout .header-center .doc-norma {
    font-size: 9.5pt !important;
    font-weight: 600 !important;
    margin-top: 1px !important;
}

.print-only-layout .header-right {
    text-align: center !important;
}
.print-only-layout .header-right .aprobat-title,
.print-only-layout .header-right .director-title {
    font-weight: 700 !important;
}
.print-only-layout .header-right .director-name {
    margin-top: 8mm !important; /* More compact */
    font-weight: 700 !important;
    text-decoration: underline !important;
}

/* Grid Table */
.print-only-layout table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    empty-cells: show !important;
    margin-bottom: 4mm !important; /* Smaller margin */
}

.print-only-layout th,
.print-only-layout td {
    border: 1px solid #000000 !important;
    padding: 2px 0px !important; /* Zero horizontal padding prevents text wrapping */
    height: 4.8mm !important; /* Fits all 22 rows vertically on single page */
    font-size: 7.5pt !important; /* Compact but highly legible */
    text-align: center !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    word-wrap: normal !important;
    white-space: nowrap !important; /* Ensures no shift text wraps onto two lines */
    background: transparent !important;
    color: black !important;
}

.print-only-layout th {
    font-weight: 700 !important;
    background: #e2e8f0 !important;
}

/* Fixed column widths */
.print-only-layout .col-nr {
    width: 5mm !important; /* Narrowed */
}
.print-only-layout .col-name {
    width: 35mm !important; /* Narrowed to give days more horizontal room */
    text-align: left !important;
    padding-left: 3px !important;
    font-weight: 600 !important;
    font-size: 8pt !important; /* Slightly smaller for name fit */
}
.print-only-layout .col-sig-header,
.print-only-layout td.col-signature {
    width: 30mm !important; /* Narrowed */
    text-align: left !important;
    padding-left: 3px !important;
}

/* Total row footer */
.print-only-layout .total-row td,
.print-only-layout .total-row .sticky-col {
    background: #f1f5f9 !important;
    font-weight: 700 !important;
    border-top: 1.5px solid #000000 !important;
    border-bottom: 2px double #000000 !important;
}

/* Make sure all inputs inside print-only table are clean text */
.print-only-layout input {
    border: none !important;
    color: black !important;
    background: transparent !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-align: center !important;
    width: 100% !important;
}

/* Transparent shift cell classes for clean ink-saving PDF */
.print-only-layout .cell-shift-CP,
.print-only-layout .cell-shift-P1-1,
.print-only-layout .cell-shift-P1-2,
.print-only-layout .cell-shift-P2-1,
.print-only-layout .cell-shift-P2-2,
.print-only-layout .cell-shift-CO,
.print-only-layout .cell-shift-CM,
.print-only-layout .cell-shift-LP,
.print-only-layout .cell-shift-EV,
.print-only-layout .cell-shift-8 {
    background: transparent !important;
    color: black !important;
    font-weight: 700 !important;
}

/* Hide administrative columns and action buttons in PDF output */
.print-only-layout .print-hide,
.print-only-layout th.print-hide,
.print-only-layout td.print-hide {
    display: none !important;
}

/* PDF Footer / Signatures */
.print-only-layout .print-footer {
    width: 100% !important;
    font-size: 10pt !important;
}

.print-only-layout .footer-date {
    font-weight: 600 !important;
    margin-bottom: 3mm !important; /* More compact */
}

.print-only-layout .footer-signatures {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
}

.print-only-layout .signature-block-left,
.print-only-layout .signature-block-right {
    width: 45% !important;
}

.print-only-layout .signature-block-left {
    text-align: left !important;
    padding-left: 10mm !important;
}

.print-only-layout .signature-block-right {
    text-align: right !important;
    padding-right: 10mm !important;
}

.print-only-layout .sig-title {
    font-weight: 700 !important;
}
.print-only-layout .sig-sub {
    font-weight: 500 !important;
}
.print-only-layout .sig-name {
    font-weight: 700 !important;
    margin-top: 2px !important;
}
.print-only-layout .sig-space {
    height: 6mm !important; /* Compact signature height */
}

/* Hide card view on desktop */
.mobile-cards-view {
    display: none;
}

/* Mobile Responsive Media Queries */
@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 1000 !important;
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
    }
    
    .sidebar.collapsed {
        width: 0 !important;
        padding: 0 !important;
        border-right: none !important;
    }
    
    .workspace-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .title-area h2 {
        font-size: 20px !important;
    }
    
    .main-content {
        padding: 16px !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: visible !important;
    }
    
    .dashboard-footer {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Mobile Cards View styling */
    .table-outer-wrapper {
        display: none !important;
    }
    
    .mobile-cards-view {
        display: flex !important;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        margin-top: 8px;
    }
    
    .guard-card {
        background: rgba(30, 41, 59, 0.45);
        border: 1px solid var(--border-glass);
        border-radius: var(--border-radius-md);
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        transition: var(--transition-smooth);
    }
    
    .guard-card:hover {
        border-color: rgba(20, 184, 166, 0.3);
        background: rgba(30, 41, 59, 0.6);
    }
    
    .guard-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 8px;
    }
    
    .guard-card-title {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .guard-card-nr {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-secondary);
        font-size: 11px;
        font-weight: 700;
        width: 20px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
    
    .guard-card-name {
        font-size: 14px;
        font-weight: 700;
        color: white;
    }
    
    .guard-card-stats {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .stat-badge {
        font-size: 11px;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-secondary);
    }
    
    .stat-badge.total-hours {
        background: rgba(6, 182, 212, 0.15);
        color: #22d3ee;
        border: 1px solid rgba(6, 182, 212, 0.25);
    }
    
    .stat-badge.overtime {
        background: rgba(20, 184, 166, 0.15);
        color: #2dd4bf;
        border: 1px solid rgba(20, 184, 166, 0.25);
    }
    
    .stat-badge.overtime.negative {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.25);
    }
    
    .guard-card-del {
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        padding: 4px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition-smooth);
    }
    
    .guard-card-del:hover {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.1);
    }
    
    .guard-card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
        gap: 6px;
    }
    
    .day-badge {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 6px 4px;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: var(--border-radius-sm);
        background: rgba(255, 255, 255, 0.02);
        cursor: pointer;
        transition: var(--transition-smooth);
    }
    
    .day-badge:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .day-badge.weekend {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .day-num {
        font-size: 8px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-bottom: 2px;
    }
    
    .day-val {
        font-size: 11px;
        font-weight: 700;
        color: white;
    }

    /* Stack Legend Columns on Mobile */
    .legend-content {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Collapsible card adjustments */
    .guard-card.collapsed .guard-card-grid {
        display: none !important;
    }
}

/* Scroll To Top Button */
.btn-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.btn-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.btn-scroll-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}
