/* ============================================
   JJ TRUCK REPAIRS & AUTO BODY BUILDERS
   Job List Tool — Industrial Blue Theme
   Colors: #2F5FA7 / #5E5E5E / #D9D9D9
   Font: Segoe UI
   ============================================ */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ── */
.top-bar {
    background-color: #1c1c1c;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 24px;
    text-align: right;
    border-bottom: 3px solid #2F5FA7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar p { margin: 0; }
.top-bar-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 9.5px;
    transition: color 0.2s;
}
.top-bar-link:hover { color: #ffffff; }

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 100%);
    border-bottom: 3px solid #2F5FA7;
}
.header .logo img {
    height: 60px;
    width: auto;
}

/* ── View Tabs ── */
.view-tabs {
    display: flex;
    gap: 0;
    background: #f7f8fa;
    border-bottom: 2px solid #D9D9D9;
    padding: 0 24px;
}
.view-tab {
    padding: 14px 24px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5E5E5E;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
}
.view-tab:hover {
    color: #2F5FA7;
    background: rgba(47, 95, 167, 0.05);
}
.view-tab.active {
    color: #2F5FA7;
    border-bottom-color: #2F5FA7;
    background: #ffffff;
}

/* ── Toolbar ── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid #D9D9D9;
}
.toolbar-left { display: flex; align-items: center; gap: 16px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

.print-counter {
    font-size: 14px;
    font-weight: 700;
    color: #2F5FA7;
}
.print-counter.counter-warning {
    color: #e67e22;
}

/* ── Buttons ── */
.btn {
    padding: 9px 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Segoe UI', Arial, sans-serif;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-sm {
    padding: 5px 12px;
    font-size: 10px;
}
.btn-primary {
    background: linear-gradient(135deg, #2F5FA7, #1c3d6e);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(47, 95, 167, 0.3);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1c3d6e, #142d52);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(47, 95, 167, 0.3);
}
.btn-secondary {
    background: #217346;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-secondary:hover:not(:disabled) {
    background: #1a5c37;
    transform: translateY(-1px);
}
.btn-outline {
    background: #ffffff;
    color: #5E5E5E;
    border: 1.5px solid #D9D9D9;
}
.btn-outline:hover:not(:disabled) {
    border-color: #2F5FA7;
    color: #2F5FA7;
}

/* ── Table Container ── */
.table-container {
    padding: 0 24px;
    flex: 1;
    margin-bottom: 80px; /* space for sticky export bar */
}

/* ── Loading State ── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #5E5E5E;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #D9D9D9;
    border-top-color: #2F5FA7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading p, .error-state p, .empty-state p {
    font-size: 14px;
    color: #5E5E5E;
}
.error-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}
.error-state p { color: #c0392b; }

/* ── Data Table ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 13px;
}
.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}
.data-table th {
    background: #2F5FA7;
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 10px;
    text-align: center;
    border-bottom: 2px solid #1c3d6e;
}
.data-table td {
    padding: 10px 10px;
    text-align: center;
    border-bottom: 1px solid #D9D9D9;
    color: #333333;
    vertical-align: middle;
}
.data-table tbody tr {
    transition: all 0.2s;
}
.data-table tbody tr:nth-child(even) {
    background: #f7f8fa;
}
.data-table tbody tr:hover:not(.excluded) {
    background: #eef3fb;
}

/* Excluded rows */
.data-table tbody tr.excluded {
    background: #fef5f5 !important;
    opacity: 0.5;
}
.data-table tbody tr.excluded td {
    text-decoration: line-through;
    color: #999;
}
.data-table tbody tr.excluded td.col-exclude {
    text-decoration: none;
}

/* Checkbox column */
.col-exclude {
    width: 60px;
    text-align: center !important;
}
.col-exclude input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #c0392b;
}

/* Notes column */
.col-notes {
    text-align: left !important;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Job number column */
.col-jobnumber {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Export Bar (sticky bottom) ── */
.export-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 3px solid #2F5FA7;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    padding: 14px 24px;
    z-index: 100;
}
.export-actions {
    display: flex;
    gap: 10px;
}

/* ── Footer ── */
.footer {
    background-color: #1c1c1c;
    color: #5E5E5E;
    padding: 24px 20px;
    text-align: center;
    font-size: 9.5px;
    font-weight: 400;
    border-top: 3px solid #2F5FA7;
    letter-spacing: 0.3px;
    margin-bottom: 70px; /* above export bar */
}

/* ── Login Page ── */
.login-body {
    background: linear-gradient(135deg, #1c2a3a 0%, #2F5FA7 50%, #1c2a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}
.login-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 36px 32px;
    border: 2px solid #D9D9D9;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    text-align: center;
}
.login-logo {
    margin-bottom: 24px;
}
.login-logo img {
    height: 70px;
    width: auto;
}
.login-title {
    font-size: 20px;
    font-weight: 700;
    color: #1c1c1c;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.login-subtitle {
    font-size: 13px;
    color: #5E5E5E;
    margin-bottom: 24px;
}
.login-error {
    background: #fef5f5;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
}
.login-field {
    margin-bottom: 18px;
}
.login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #D9D9D9;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333333;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-field input:focus {
    outline: none;
    border-color: #2F5FA7;
    box-shadow: 0 0 0 3px rgba(47, 95, 167, 0.12);
}
.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #2F5FA7, #1c3d6e);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(47, 95, 167, 0.3);
}
.login-btn:hover {
    background: linear-gradient(135deg, #1c3d6e, #142d52);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(47, 95, 167, 0.3);
}
.login-footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255,255,255,0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .view-tabs {
        flex-wrap: wrap;
        padding: 0 12px;
    }
    .view-tab {
        padding: 12px 16px;
        font-size: 11px;
        flex: 1;
        text-align: center;
    }
    .toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .export-bar-inner {
        flex-direction: column;
        gap: 12px;
    }
    .export-heading-label {
        text-align: center;
    }
    .export-actions {
        width: 100%;
    }
    .export-actions .btn {
        flex: 1;
    }
    .table-container {
        padding: 0 12px;
        overflow-x: auto;
    }
    .data-table {
        font-size: 11px;
        min-width: 600px;
    }
}
