/* ----------------------------------------------------
   L7 NETWORK SOLUTION WORK ORDER SYSTEM - DESIGN SYSTEM
   ---------------------------------------------------- */

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

    /* Transition defaults */
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Box Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-app: #f4f6fa;
    --bg-sidebar: #0f172a; /* Keep dark sidebar for premium contrast */
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-input-disabled: #f1f5f9;
    --border-color: #e2e8f0;
    --border-color-focus: #3b82f6;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-on-sidebar: #f8fafc;
    --text-on-sidebar-muted: #94a3b8;
    
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --indigo-color: #6366f1;
    --indigo-light: rgba(99, 102, 241, 0.1);

    --card-glow-blue: 0 4px 20px rgba(37, 99, 235, 0.05);
    --card-glow-yellow: 0 4px 20px rgba(245, 158, 11, 0.05);
    --card-glow-green: 0 4px 20px rgba(16, 185, 129, 0.05);
    --card-glow-indigo: 0 4px 20px rgba(99, 102, 241, 0.05);
}

/* Dark Theme Variables (Default) */
[data-theme="dark"] {
    --bg-app: #090d16;
    --bg-sidebar: #05080e;
    --bg-card: #0f172a;
    --bg-input: #1e293b;
    --bg-input-disabled: #0f172a;
    --border-color: #1e293b;
    --border-color-focus: #3b82f6;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-sidebar: #f8fafc;
    --text-on-sidebar-muted: #64748b;
    
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);
    
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning-color: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --indigo-color: #818cf8;
    --indigo-light: rgba(129, 140, 248, 0.15);

    --card-glow-blue: 0 4px 24px rgba(59, 130, 246, 0.1);
    --card-glow-yellow: 0 4px 24px rgba(251, 191, 36, 0.1);
    --card-glow-green: 0 4px 24px rgba(16, 185, 129, 0.1);
    --card-glow-indigo: 0 4px 24px rgba(129, 140, 248, 0.1);
}

/* Global Reset styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    position: relative;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 8px 24px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    max-width: 100%;
    max-height: 50px;
    object-fit: contain;
    display: block;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #3b82f6, #818cf8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.brand-text h2 {
    font-size: 1.15rem;
    color: var(--text-on-sidebar);
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-on-sidebar-muted);
    font-weight: 500;
}

.sidebar-nav {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-on-sidebar-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.nav-item:hover {
    color: var(--text-on-sidebar);
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.nav-item.active {
    color: #ffffff;
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-icon {
    opacity: 0.8;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-on-sidebar);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-normal);
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Icon visibility */
[data-theme="light"] .theme-toggle-btn .sun-icon { display: none; }
[data-theme="light"] .theme-toggle-btn .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle-btn .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle-btn .moon-icon { display: none; }

.system-time {
    font-size: 0.75rem;
    color: var(--text-on-sidebar-muted);
    text-align: center;
    font-family: monospace;
}

/* Main Content Layout */
.main-content {
    margin-left: 260px;
    width: calc(100vw - 260px);
    display: flex;
    flex-direction: column;
}

/* Content Header */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-info h1 {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.header-info p {
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Layout Utilities & Cards */
.content-body {
    padding: 32px;
    flex-grow: 1;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-body {
    padding: 24px;
}

.card-body.p-0 {
    padding: 0;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.01);
}

/* Metrics Dashboard Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-4px);
}

.card-glow-blue:hover { border-color: var(--primary-color); box-shadow: var(--card-glow-blue); }
.card-glow-yellow:hover { border-color: var(--warning-color); box-shadow: var(--card-glow-yellow); }
.card-glow-green:hover { border-color: var(--success-color); box-shadow: var(--card-glow-green); }
.card-glow-indigo:hover { border-color: var(--indigo-color); box-shadow: var(--card-glow-indigo); }

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-blue-light { background-color: var(--primary-light); color: var(--primary-color); }
.bg-yellow-light { background-color: var(--warning-light); color: var(--warning-color); }
.bg-green-light { background-color: var(--success-light); color: var(--success-color); }
.bg-indigo-light { background-color: var(--indigo-light); color: var(--indigo-color); }

.metric-details h3 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.metric-details p {
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Dashboard Panel Structure */
.dashboard-charts-recent {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.flex-1 { flex: 1; min-width: 300px; }
.flex-2 { flex: 2; min-width: 450px; }

/* CSS bar chart for Service distribution */
.bar-chart-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-lbl-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}

.chart-bar-outer {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.chart-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--indigo-color));
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.financial-split-list {
    display: flex;
    flex-direction: column;
}

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

.financial-item:last-child {
    border-bottom: none;
}

.financial-item.total {
    background-color: var(--primary-light);
}

.financial-item.hrs {
    border-top: 2px dashed var(--border-color);
}

.financial-lbl {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.financial-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

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

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

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

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    background-color: var(--bg-input);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: var(--danger-color);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: #dc2626;
}

.btn-text-accent {
    background-color: transparent;
    color: var(--primary-color);
    padding: 4px 8px;
}
.btn-text-accent:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

.btn-icon-only {
    padding: 8px;
    aspect-ratio: 1;
}

/* Forms styling */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-row.col-3 > .form-group {
    flex: 1;
    min-width: 200px;
}

.form-row.col-2 > .form-group {
    flex: 1;
    min-width: 280px;
}

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

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    outline: none;
}

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

.form-control.bg-light-disabled {
    background-color: var(--bg-input-disabled);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.h-80 { min-height: 80px; }
.h-100 { min-height: 100px; }
.h-120 { min-height: 120px; }

/* Custom toggle switch */
.permission-toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 8px;
    background-color: var(--bg-input-disabled);
    height: 100%;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Custom Currency prefix inside input */
.input-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.input-currency .form-control {
    padding-left: 28px;
}

/* Form sections partitioning */
.form-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.title-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.form-section-title h4 {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Interactive Signatures pad */
.signatures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.signature-box {
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    background-color: var(--bg-input-disabled);
}

.sig-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sig-lbl {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.canvas-wrapper {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
    position: relative;
    height: 150px;
}

.canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

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

.data-table th {
    padding: 14px 20px;
    background-color: var(--bg-input-disabled);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Action button items in table */
.row-actions-group {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-draft { background-color: var(--warning-light); color: var(--warning-color); }
.badge-completed { background-color: var(--success-light); color: var(--success-color); }
.badge-cancelled { background-color: var(--danger-light); color: var(--danger-color); }

/* Empty placeholder */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Toolbar cards on history view */
.toolbar-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.toolbar-search-filter {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

.filter-inputs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.date-range-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-group .form-control {
    width: 130px;
    padding: 10px;
}

.date-sep {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modals Backdrop & Container */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(5, 8, 14, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    overflow-y: auto;
}

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

.modal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.print-modal-width {
    width: 900px;
    max-width: 100%;
}

.alert-modal-width {
    width: 420px;
    max-width: 100%;
}

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

.modal-header-actions {
    display: flex;
    gap: 8px;
}

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

.modal-body.p-0 {
    padding: 0;
}

/* Custom Settings styling */
.settings-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.settings-action-block h5 {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.border-separator {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

.text-danger {
    color: var(--danger-color) !important;
}

/* Helper spacing utility classes */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-20 { margin-bottom: 20px; }
.mr-8 { margin-right: 8px; }
.mr-4 { margin-right: 4px; }
.p-24 { padding: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: 700; }
.text-semibold { font-weight: 500; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary-color) !important; }
.w-100 { width: 100%; }
.flex-row { display: flex; flex-direction: row; }
.flex-column { display: flex; flex-direction: column; }
.flex-between { justify-content: space-between; }
.flex-end { justify-content: flex-end; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.leading-relaxed { line-height: 1.625; }

/* ----------------------------------------------------
   PRINT DOCUMENT LAYOUT (A4 PAGE EMULATION)
   ---------------------------------------------------- */
.printable-page {
    background-color: #f1f5f9;
    padding: 32px;
}

[data-theme="dark"] .printable-page {
    background-color: #0b0f17;
}

.print-document {
    background-color: #ffffff;
    color: #1e293b;
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    width: 100%;
    min-height: 297mm; /* Standard A4 Height proportional ratio */
    font-size: 13px;
    line-height: 1.4;
    font-family: var(--font-body);
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.print-brand-info {
    flex-grow: 1;
}

.print-logo {
    max-height: 54px;
    max-width: 320px;
    object-fit: contain;
    display: block;
    margin-bottom: 8px;
}

.print-company-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
}

.print-company-details {
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 4px;
    max-width: 400px;
}

.print-company-contact {
    color: #64748b;
    font-size: 0.7rem;
    margin-top: 2px;
    white-space: nowrap;
}

.print-title-block {
    text-align: right;
    flex-shrink: 0;
    min-width: 220px;
}

.print-doc-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #2563eb;
    white-space: nowrap;
}

.print-wo-number {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 4px;
}

.print-wo-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    background-color: #d1fae5;
    color: #065f46;
    margin-top: 6px;
    text-transform: uppercase;
}

.print-divider {
    height: 2px;
    background-color: #e2e8f0;
    margin: 20px 0;
}

/* Print Section Tables */
.print-section-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 4px;
    margin-top: 24px;
    margin-bottom: 12px;
}

.print-meta-table, 
.print-time-table, 
.print-staff-table, 
.print-finance-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.print-meta-table .label-cell,
.print-staff-table .label-cell,
.print-finance-table .label-cell {
    white-space: nowrap;
}

.print-meta-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.print-meta-table .label-cell {
    color: #64748b;
    font-weight: 600;
}

.print-meta-table .val-cell {
    color: #1e293b;
}

.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }

.print-time-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.print-time-table td {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.print-detail-block {
    background-color: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.block-label {
    font-weight: 700;
    color: #475569;
    font-size: 0.8rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.block-content {
    color: #1e293b;
    white-space: pre-wrap;
}

.print-cols-grid {
    display: flex;
    gap: 24px;
    margin-top: 24px;
}

.col-left { flex: 1.3; }
.col-right { flex: 1; }

.print-staff-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f8fafc;
}

.print-staff-table .label-cell {
    color: #64748b;
    font-weight: 600;
}

.print-finance-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.print-finance-table .label-cell {
    color: #64748b;
    font-weight: 600;
}

.print-finance-table .total-row td {
    border-top: 2px solid #e2e8f0;
    border-bottom: 2px double #e2e8f0;
    background-color: #f8fafc;
    padding: 12px;
}

/* Print Signatures styling */
.print-signatures-row {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 40px;
}

.print-sig-col {
    flex: 1;
    text-align: center;
    min-width: 200px;
}

.print-sig-area {
    border-bottom: 1px solid #94a3b8;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.print-sig-img {
    max-height: 100%;
    max-width: 250px;
    object-fit: contain;
}

.sig-placeholder-line {
    color: #cbd5e1;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.print-sig-desc {
    margin-top: 8px;
}

.print-sig-desc p {
    white-space: nowrap;
}

.print-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
}

.doc-meta-text {
    margin-top: 4px;
    color: #cbd5e1;
}

/* ----------------------------------------------------
   @media CSS Rules for Physical Printing / PDF Generation
   ---------------------------------------------------- */
@media print {
    /* Set page margins */
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body {
        background-color: #ffffff;
        color: #000000;
    }

    /* Hide entire dashboard wrapper */
    .app-container,
    .sidebar,
    .main-content,
    .content-header,
    .content-body,
    .modal-backdrop,
    .hide-print {
        display: none !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        box-shadow: none !important;
    }

    /* Display modal contents directly as top-level */
    body > * {
        display: none !important;
    }

    body > #view-wo-modal {
        display: block !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        background-color: #ffffff !important;
        padding: 0 !important;
        backdrop-filter: none !important;
        pointer-events: auto !important;
        opacity: 1 !important;
    }

    #view-wo-modal .modal-container {
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        width: 100% !important;
        transform: none !important;
    }

    #view-wo-modal .modal-body {
        padding: 0 !important;
        overflow: visible !important;
    }

    .printable-page {
        background-color: #ffffff !important;
        padding: 0 !important;
    }

    .print-document {
        box-shadow: none !important;
        padding: 25px 24px 15px 24px !important; /* Increased side padding to 24px to prevent border clipping */
        border-radius: 0 !important;
        min-height: auto !important;
        color: #000000 !important;
        font-size: 11.5px !important;
        line-height: 1.35 !important;
    }

    .print-company-contact {
        white-space: normal !important; /* Allow wrapping to prevent width stretching */
    }

    .print-title-block {
        min-width: auto !important; /* Allow shrinking to actual text size */
    }

    /* Balanced spacing for A4 single-page stretch fit */
    .print-divider {
        margin: 12px 0 !important;
    }
    .print-section-title {
        margin-top: 14px !important;
        margin-bottom: 6px !important;
        padding-bottom: 3px !important;
    }
    .print-meta-table {
        margin-bottom: 8px !important;
    }
    .print-meta-table td,
    .print-staff-table td,
    .print-finance-table td {
        padding: 4px 8px !important;
    }
    .print-time-table {
        margin-bottom: 8px !important;
    }
    .print-time-table td,
    .print-time-table th {
        padding: 5px 8px !important;
    }
    .print-detail-block {
        margin-bottom: 8px !important;
        padding: 8px 12px !important;
    }
    .print-cols-grid {
        margin-top: 14px !important;
        gap: 16px !important;
    }
    .print-staff-table td,
    .print-finance-table td {
        padding: 4px 8px !important;
    }
    .print-sig-area {
        height: 65px !important;
    }

    /* Print text colors adjustment */
    .print-company-name { color: #000000 !important; }
    .print-doc-title { color: #000000 !important; font-size: 1.2rem !important; }
    .print-time-table th { background-color: #f1f5f9 !important; }
    .print-detail-block { border-left-color: #000000 !important; background-color: #fafafa !important; }
    .print-finance-table .total-row td { background-color: #f1f5f9 !important; }
    .text-primary { color: #000000 !important; }

    .print-time-table td {
        height: 30px !important; /* Provide writeable height for timing metrics */
    }

    #p-work-completed {
        min-height: 40px !important; /* Provide writeable height for completed work */
    }

    #p-comments {
        min-height: 30px !important; /* Provide writeable height for remarks */
    }

    /* Page-break and alignment handling */
    .print-signatures-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 40px !important;
        margin-top: 25px !important;
        page-break-inside: avoid;
    }
    .print-sig-col {
        flex: 1 !important;
        min-width: 180px !important;
    }
    .print-footer {
        margin-top: 20px !important;
        padding-top: 10px !important;
    }
}
