/**
 * Enterprise Portal Modern Design System
 * Clean, High-Contrast, Responsive Portal Stylesheet
 */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    
    --sidebar-bg: #0f172a;
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: #1e293b;
    --sidebar-active-text: #ffffff;
    
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-focus: #a5b4fc;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    
    --font-sans: "Century Gothic", CenturyGothic, AppleGothic, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100%;
}

/* Custom Modern Global Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Portal App Shell & Layout
   ========================================================================== */
.portal-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

/* Sidebar Styles */
.portal-sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 72px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    overflow: hidden;
    transition: var(--transition);
}

.brand-badge:hover .brand-icon {
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-icon svg {
    width: 20px;
    height: 20px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 0.85rem 0.65rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

/* Custom Sleek Dark Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 9999px;
    transition: background 0.2s ease;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.65);
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #94a3b8;
    padding: 0.75rem 0.8rem 0.35rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-section-title:not(:first-child) {
    margin-top: 0.6rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active a {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 19px;
    height: 19px;
}

.sidebar-footer {
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(15, 23, 42, 0.7);
    flex-shrink: 0;
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.user-avatar.admin {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-admin {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-user {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Main Content Area */
.portal-main {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.portal-topbar {
    height: 72px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    color: var(--text-main);
    cursor: pointer;
}

.breadcrumbs {
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .current {
    color: var(--text-main);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.live-indicator.offline {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.live-indicator.pending {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.live-indicator.syncing {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.dot-offline {
    background: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.status-dot.dot-pending, .status-dot.dot-syncing {
    background: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    animation: pulseSync 1.5s infinite;
}

@keyframes pulseSync {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    padding: 6px 12px;
    color: #64748b;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

/* Page Content Body */
.portal-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Cards & Grids
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.card-body {
    padding: 1.5rem;
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-info .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrap.indigo {
    background: #eef2ff;
    color: #4f46e5;
}

.stat-icon-wrap.emerald {
    background: #ecfdf5;
    color: #10b981;
}

.stat-icon-wrap.amber {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-icon-wrap.purple {
    background: #f5f3ff;
    color: #7c3aed;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.form-label .required {
    color: var(--danger);
}

.form-control, .form-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
}

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

.form-control.is-invalid {
    border-color: var(--danger);
}

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

.input-password-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-group .form-control {
    padding-right: 2.75rem;
}

.toggle-password-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password-btn:hover {
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   Modern Enterprise Data Tables
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    background: #ffffff;
}

.data-table,
.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
    white-space: nowrap;
    box-sizing: border-box;
}

.data-table th,
.data-table td,
.table th,
.table td {
    box-sizing: border-box;
}

.data-table th,
.table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 9px;
    border-bottom: 1.5px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    vertical-align: middle;
    white-space: nowrap;
}

.data-table th:last-child,
.table th:last-child {
    border-right: none;
}

.data-table td,
.table td {
    padding: 6px 9px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    color: var(--text-main);
    vertical-align: middle;
    white-space: nowrap;
    height: 40px;
    background: #ffffff;
}

.data-table td:last-child,
.table td:last-child {
    border-right: none;
}

.data-table tbody tr:hover td,
.table tbody tr:hover td {
    background: #f8fafc !important;
}

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

/* Status Quick Select Pill Dropdown */
.status-select-pill {
    border-radius: 9999px !important;
    padding: 4px 24px 4px 10px !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23334155' d='M0 0l4 4 4-4z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    transition: all 0.15s ease !important;
    outline: none !important;
    line-height: 1.3 !important;
    display: inline-block !important;
}
.status-pill-paid, .status-pill-approved, .status-pill-completed { background-color: #ecfdf5 !important; color: #047857 !important; border: 1px solid #a7f3d0 !important; }
.status-pill-sent, .status-pill-scheduled { background-color: #eff6ff !important; color: #1d4ed8 !important; border: 1px solid #bfdbfe !important; }
.status-pill-partially_paid, .status-pill-invoiced, .status-pill-in_progress { background-color: #fffbeb !important; color: #b45309 !important; border: 1px solid #fde68a !important; }
.status-pill-half_done { background-color: #fff7ed !important; color: #c2410c !important; border: 1px solid #fdba74 !important; }
.status-pill-overdue, .status-pill-rejected, .status-pill-unassigned { background-color: #fef2f2 !important; color: #dc2626 !important; border: 1px solid #fecaca !important; }
.status-pill-draft { background-color: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1 !important; }
.status-pill-delayed { background-color: #fffbeb !important; color: #b45309 !important; border: 1px solid #fde68a !important; }
.status-pill-ready_to_invoice { background-color: #fdf4ff !important; color: #a21caf !important; border: 1px solid #f0abfc !important; font-weight: 700 !important; }
.status-pill-cancelled { background-color: #f8fafc !important; color: #64748b !important; border: 1px solid #e2e8f0 !important; }

/* Mini Action Button Standard */
.action-btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.action-btn-mini:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Status Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.status-pill.active {
    background: #ecfdf5;
    color: #065f46;
}

.status-pill.inactive {
    background: #fef2f2;
    color: #991b1b;
}

.status-pill.dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Role Pills */
.role-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.role-pill.admin {
    background: #e0e7ff;
    color: #3730a3;
}

.role-pill.user {
    background: #f1f5f9;
    color: #334155;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.flash-container {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: currentColor;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* ==========================================================================
   Placeholder / Empty State (For User Panel)
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-state-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 1.5rem;
    font-size: 0.95rem;
}

/* ==========================================================================
   Login Page Specific
   ========================================================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    padding: 1.5rem;
}

.login-card-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.25), 0 8px 10px -6px rgb(0 0 0 / 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.demo-credentials-box {
    margin-top: 1.75rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.82rem;
}

.demo-credentials-title {
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.credential-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    color: #64748b;
}

.credential-row code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0f172a;
    font-family: monospace;
}

/* ==========================================================================
   Responsive Breakpoints & Drawer Behavior
   ========================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 950;
}

@media (max-width: 992px) {
    .portal-sidebar {
        transform: translateX(-100%);
    }

    .portal-sidebar.open {
        transform: translateX(0);
    }

    .portal-main {
        margin-left: 0;
    }

    .sidebar-toggle-btn {
        display: inline-flex;
    }

    .sidebar-close-btn {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .portal-topbar {
        padding: 0 1.25rem;
    }

    .portal-content {
        padding: 1.25rem;
    }

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

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

    .login-card {
        padding: 2rem 1.5rem;
    }
}

/* ==========================================================================
   Select2 Modern Theme & Overrides (Century Gothic)
   ========================================================================== */
.select2-container {
    font-family: var(--font-sans) !important;
    box-sizing: border-box;
}

/* Ensure inline form control Select2 widgets fill their container column */
.select2.select2-container {
    width: 100% !important;
    max-width: 100%;
}

/* Prevent floating dropdown container appended to body from causing viewport overflow */
.select2-container--open {
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

body > .select2-container--open {
    max-width: calc(100vw - 20px) !important;
}

.select2-container--default .select2-selection--single {
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    position: relative;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main);
    line-height: 42px;
    padding-left: 0.9rem;
    padding-right: 58px;
    font-size: 0.92rem;
    font-weight: 500;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
    position: absolute;
    top: 1px;
    right: 8px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Clear button (×) - Positioned on the right next to arrow with modern circular badge */
.select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute !important;
    right: 34px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    border: none !important;
    outline: none !important;
    color: #64748b !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: var(--transition) !important;
    z-index: 2;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

.select2-container--default .select2-selection--multiple {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    padding: 4px 8px;
    padding-right: 36px;
    box-sizing: border-box;
    position: relative;
    transition: var(--transition);
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    border: none !important;
    outline: none !important;
    color: #64748b !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: var(--transition) !important;
    z-index: 2;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-sans);
    z-index: 10050;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100vw;
}

.select2-search--dropdown {
    padding: 8px;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary);
}

.select2-results__option {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary);
    color: #ffffff;
}

/* Compact Select2 (for filter bars, table cells, and compact forms) */
.select2-compact + .select2-container .select2-selection--single,
.filter-form-select + .select2-container .select2-selection--single,
.table .select2-container .select2-selection--single {
    height: 38px !important;
}
.select2-compact + .select2-container .select2-selection--single .select2-selection__rendered,
.filter-form-select + .select2-container .select2-selection--single .select2-selection__rendered,
.table .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    font-size: 0.88rem !important;
    padding-right: 50px !important;
}
.select2-compact + .select2-container .select2-selection--single .select2-selection__arrow,
.filter-form-select + .select2-container .select2-selection--single .select2-selection__arrow,
.table .select2-container .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

/* ==========================================================================
   Modal Dialogs (Quick Add Customer)
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==========================================================================
   Customer Info Card (Quotation Step 1)
   ========================================================================== */
.customer-selected-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.customer-info-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.customer-info-list strong {
    color: var(--text-main);
}

/* ==========================================================================
   Quotation Builder Section & BOQ Items Matrix
   ========================================================================== */
.quotation-section-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.section-header-bar {
    background: #f1f5f9;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-badge-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
}

.section-title-input {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.section-title-input:focus {
    outline: none;
    border-color: var(--primary);
}

.section-items-table {
    width: 100%;
    border-collapse: collapse;
}

.section-items-table th {
    background: #f8fafc;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: #475569;
    font-weight: 700;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.section-items-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.item-desc-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    min-height: 48px;
}

.item-desc-input:focus {
    outline: none;
    border-color: var(--primary);
}

.item-qty-input, .item-price-input, .item-unit-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 0.88rem;
    font-family: inherit;
}

.item-amount-display {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.92rem;
    padding-top: 6px;
    display: block;
    text-align: right;
}

.section-subtotal-bar {
    background: #f8fafc;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    border-top: 1px solid var(--border);
}

.section-subtotal-value {
    color: #dc2626;
    font-size: 1.05rem;
}

/* Grand Total Bar (Exact H&H Peach Highlight) */
.grand-total-banner {
    background: #ffcca8;
    color: #7c2d12;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-top: 1rem;
}

.amount-words-banner {
    background: #fff7ed;
    color: #9a3412;
    padding: 0.75rem 1.25rem;
    border: 1px dashed #fdba74;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    margin-top: 0.75rem;
    font-style: italic;
}

/* ==========================================================================
   Quotation Authentic Document View & Print Styling
   Matches Hassan & Hussain Enterprises Letterhead Exactly
   ========================================================================== */
.hnh-doc-wrapper {
    background: #ffffff;
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 3rem;
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    color: #000000;
    line-height: 1.4;
}

.hnh-doc-header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.hnh-doc-logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.25rem;
}

.hnh-doc-logo-img {
    height: 64px;
    width: auto;
}

.hnh-doc-company-name {
    font-size: 2.2rem;
    font-weight: 700;
    color: #dc2626; /* Crimson Red */
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.hnh-doc-subheading {
    font-size: 1.1rem;
    font-style: italic;
    color: #e11d48;
    font-family: 'Brush Script MT', cursive, "Century Gothic", sans-serif;
    margin-top: 2px;
}

.hnh-doc-motto {
    font-size: 0.95rem;
    font-weight: 700;
    color: #000000;
    margin-top: 4px;
}

.hnh-doc-red-line {
    height: 3px;
    background: #dc2626;
    margin: 0.85rem 0 1.25rem;
    border-radius: 2px;
}

.hnh-doc-meta-box {
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

.hnh-doc-meta-client {
    font-weight: 700;
    text-decoration: underline;
    margin-bottom: 0.4rem;
}

.hnh-doc-meta-subject-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    text-decoration: underline;
    margin-bottom: 0.75rem;
}

.hnh-doc-intro {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #000000;
}

/* BOQ Table in Document */
.hnh-boq-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.86rem;
}

.hnh-boq-table th, .hnh-boq-table td {
    border: 1px solid #000000;
    padding: 6px 8px;
    vertical-align: middle;
}

.hnh-boq-table th {
    background: #ffffff;
    font-weight: 700;
    text-align: center;
}

.hnh-boq-section-header {
    font-weight: 700;
    background: #ffffff;
    text-align: left !important;
}

.hnh-boq-subtotal-row {
    font-weight: 700;
    text-align: right;
}

.hnh-boq-subtotal-row td {
    font-weight: 700;
    text-align: right;
}

.hnh-doc-grand-total {
    background: #ffcca8; /* Peach */
    font-weight: 700;
    font-size: 1.05rem;
}

.hnh-doc-terms {
    margin-top: 1.5rem;
    font-size: 0.88rem;
}

.hnh-doc-terms-row {
    display: flex;
    margin-bottom: 0.35rem;
}

.hnh-doc-terms-label {
    width: 280px;
    min-width: 250px;
    font-weight: 700;
    flex-shrink: 0;
}

.btn-term-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 0.73rem;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.btn-term-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.hnh-doc-signature-block {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.hnh-doc-signature-img {
    height: 75px;
    width: auto;
}

.hnh-doc-footer {
    border-top: 1px solid #000000;
    margin-top: 2.5rem;
    padding-top: 0.75rem;
    text-align: center;
    font-size: 0.78rem;
    color: #000000;
    line-height: 1.5;
}

/* Print Rules */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .portal-sidebar, .portal-topbar, .btn, .no-print, .sidebar-overlay {
        display: none !important;
    }
    .portal-wrapper, .portal-main {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        flex: none !important;
    }
    .portal-content {
        padding: 0 !important;
        max-width: 100% !important;
    }
    .hnh-doc-wrapper {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Specimen Templates & Section Actions UI
   ========================================================================== */
.btn-compact {
    font-size: 0.78rem !important;
    padding: 4px 8px !important;
    height: 30px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    border-radius: var(--radius-sm) !important;
}

.specimen-select-compact {
    font-size: 0.8rem;
    height: 30px;
    padding: 2px 8px;
    width: auto;
    max-width: 230px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.specimen-select-compact:hover {
    border-color: var(--primary);
}

.specimen-select-compact:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.specimen-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.specimen-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.specimen-card-header {
    margin-bottom: 0.5rem;
}

.specimen-category-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    margin-bottom: 0.4rem;
}

.specimen-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.specimen-card-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.specimen-items-preview {
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid #f1f5f9;
}

.specimen-items-preview ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.45;
}

.specimen-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.75rem;
    margin-top: auto;
}

.specimen-count-tag {
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================================
   H&H JOB SYSTEM & REGISTER ENHANCEMENTS
   ======================================================== */
.badge-pill-job {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.badge-job-q {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}
.badge-job-p {
    background: #f3e8ff;
    color: #6b21a8;
    border-color: #e9d5ff;
}
.badge-job-m {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.dot-q { background: #4f46e5; }
.dot-p { background: #9333ea; }
.dot-m { background: #d97706; }
.dot-amber { background: #f59e0b; }
.dot-blue { background: #3b82f6; }
.dot-purple { background: #a855f7; }
.dot-green { background: #10b981; }
.dot-gray { background: #94a3b8; }

.status-pill.status-unassigned {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    font-weight: 700;
}
.status-pill.status-scheduled {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-weight: 600;
}
.status-pill.status-in-progress {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
    font-weight: 600;
}
.status-pill.status-completed {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-weight: 600;
}

/* Job Type Selection Radio Cards */
.job-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin-bottom: 0.5rem;
}
.job-type-card {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    user-select: none;
}
.job-type-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.job-type-card.active {
    border-color: var(--primary);
    background: #f5f3ff;
    box-shadow: 0 0 0 1px var(--primary);
}
.job-type-card input[type="radio"] {
    margin-top: 0.2rem;
}
.job-type-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
    margin-bottom: 0.15rem;
}
.job-type-card-desc {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.35;
}

/* Customer Quick Preview Box */
.customer-preview-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-top: 0.6rem;
    display: none;
}
.customer-preview-box.visible {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Date Navigator Toolbar */
.date-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.date-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   Streamlined Single-Line Data Tables & Badges
   ========================================================================== */
.reg-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.83rem !important;
    white-space: nowrap !important;
    border: 1px solid #cbd5e1 !important;
}
.reg-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
    font-size: 0.73rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}
.reg-table td {
    padding: 8px 12px !important;
    border: 1px solid #cbd5e1 !important;
    vertical-align: middle !important;
    background: #ffffff !important;
    white-space: nowrap !important;
    height: 44px !important;
}
.reg-table tr:hover td {
    background: #f8fafc !important;
}
.reg-table a, .reg-table span, .reg-table div {
    white-space: nowrap;
}

/* Obvious, Colorful Badges for Job Types (P, Q, M) */
.badge-mini-p {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: #7e22ce;
    color: #ffffff;
    border: 1px solid #6b21a8;
    border-radius: 4px;
    font-weight: 900;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.5px;
}
.badge-mini-q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: #1d4ed8;
    color: #ffffff;
    border: 1px solid #1e40af;
    border-radius: 4px;
    font-weight: 900;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.5px;
}
.badge-mini-m {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: #b45309;
    color: #ffffff;
    border: 1px solid #92400e;
    border-radius: 4px;
    font-weight: 900;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.5px;
}
.badge-mini-i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: #0d9488;
    color: #ffffff;
    border: 1px solid #0f766e;
    border-radius: 4px;
    font-weight: 900;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.5px;
}

.quote-badge-tag {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
}

/* Staff Real-time Schedule Conflict & Hint Styling */
.staff-schedule-hint {
    font-size: 0.75rem;
    line-height: 1.35;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    box-sizing: border-box;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.staff-hint-conflict { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; }
.staff-hint-sameday  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.staff-hint-free     { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.staff-hint-custom   { background: #f8fafc; border: 1px solid #e2e8f0; color: #64748b; }

/* Global Print-Only Inline helper (ensures badges are never duplicated on screen) */
.print-only-inline {
    display: none !important;
}
@media print {
    .print-only-inline {
        display: inline-flex !important;
    }
}

/* Visual Status Navigator Cards (Easy Navigation) */
.status-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}
@media (max-width: 580px) {
    .status-nav-grid {
        grid-template-columns: 1fr;
    }
}
.status-nav-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
    text-align: left;
}
.status-nav-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}
.status-nav-card.active {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18) !important;
}
.status-nav-card .snc-icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f1f5f9;
    flex-shrink: 0;
}
.status-nav-card.active .snc-icon {
    background: #dbeafe;
}
.status-nav-card .snc-info {
    flex: 1;
    min-width: 0;
}
.status-nav-card .snc-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}
.status-nav-card.active .snc-title {
    color: #1e40af;
}
.status-nav-card .snc-desc {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.3;
}
.status-nav-card .snc-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.65rem;
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 2px;
}
.status-nav-card.active .snc-check {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* ==========================================================================
   Quick Access & Command Hub Styling (Index Page)
   ========================================================================== */
.quick-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}
.quick-action-btn.btn-action-primary {
    background: #dc2626;
    color: #ffffff;
}
.quick-action-btn.btn-action-primary:hover {
    background: #b91c1c;
    color: #ffffff;
}
.quick-action-btn.btn-action-indigo {
    background: #4f46e5;
    color: #ffffff;
}
.quick-action-btn.btn-action-indigo:hover {
    background: #4338ca;
    color: #ffffff;
}
.quick-action-btn.btn-action-emerald {
    background: #059669;
    color: #ffffff;
}
.quick-action-btn.btn-action-emerald:hover {
    background: #047857;
    color: #ffffff;
}
.quick-action-btn.btn-action-slate {
    background: #0f172a;
    color: #ffffff;
}
.quick-action-btn.btn-action-slate:hover {
    background: #1e293b;
    color: #ffffff;
}
.quick-action-btn.btn-action-outline {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}
.quick-action-btn.btn-action-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Quick Navigation Clusters */
.quick-nav-cluster {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.quick-nav-cluster-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.quick-nav-cluster-title {
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}
.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}
.quick-nav-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
    position: relative;
}
.quick-nav-tile:hover {
    border-color: #3b82f6;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
    text-decoration: none;
}
.quick-nav-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    background: #f1f5f9;
    transition: all 0.15s ease;
}
.quick-nav-tile:hover .quick-nav-tile-icon {
    transform: scale(1.08);
}
.quick-nav-tile-body {
    flex: 1;
    min-width: 0;
}
.quick-nav-tile-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 6px;
}
.quick-nav-tile:hover .quick-nav-tile-title {
    color: #2563eb;
}
.quick-nav-tile-desc {
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.3;
}
.quick-nav-tile-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.quick-nav-tile-arrow {
    color: #94a3b8;
    font-size: 1.1rem;
    transition: transform 0.15s ease, color 0.15s ease;
}
.quick-nav-tile:hover .quick-nav-tile-arrow {
    transform: translateX(3px);
    color: #2563eb;
}




