/**
 * SHF Operations Dashboard - Production Stylesheet
 */

:root {
    --shf-primary: #4f46e5;
    --shf-primary-hover: #4338ca;
    --shf-bg: #f8fafc;
    --shf-surface: #ffffff;
    --shf-border: #e2e8f0;
    --shf-text: #0f172a;
    --shf-text-muted: #64748b;
    --shf-success: #10b981;
    --shf-warning: #f59e0b;
    --shf-danger: #ef4444;
    --shf-info: #0284c7;
    --shf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.shf-ops-wrap {
    font-family: var(--shf-font);
    color: var(--shf-text);
    background: var(--shf-bg);
    padding: 24px;
    margin: 0;
    box-sizing: border-box;
}

.shf-ops-wrap * {
    box-sizing: border-box;
}

/* Header */
.shf-ops-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--shf-surface);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--shf-border);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.shf-ops-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.shf-ops-logo-badge {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    font-weight: 900;
    font-size: 18px;
    padding: 8px 14px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.shf-ops-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--shf-text);
}

.shf-ops-subtitle {
    font-size: 12px;
    color: var(--shf-text-muted);
}

.shf-ops-header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.shf-ops-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 30px;
}

.shf-ops-user-avatar {
    width: 30px;
    height: 30px;
    background: var(--shf-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.shf-ops-user-name {
    font-weight: 600;
    font-size: 13px;
}

.shf-ops-role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shf-role-admin { background: #ede9fe; color: #6d28d9; }
.shf-role-coordinator { background: #e0f2fe; color: #0369a1; }
.shf-role-technician { background: #fef3c7; color: #b45309; }

/* Navigation */
.shf-ops-nav {
    display: flex;
    gap: 8px;
    background: var(--shf-surface);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--shf-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.shf-nav-item {
    background: transparent;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--shf-text-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.shf-nav-item:hover {
    background: #f1f5f9;
    color: var(--shf-text);
}

.shf-nav-item.active {
    background: var(--shf-primary);
    color: #ffffff;
}

.shf-nav-counter {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Tab panes */
.shf-tab-pane {
    display: none;
}

.shf-tab-pane.active {
    display: block;
}

/* KPI Grid */
.shf-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.shf-kpi-card {
    background: var(--shf-surface);
    border: 1px solid var(--shf-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.shf-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--shf-text-muted);
    margin-bottom: 8px;
}

.shf-kpi-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--shf-text);
    line-height: 1.2;
}

.shf-kpi-sub {
    font-size: 11px;
    color: var(--shf-text-muted);
    margin-top: 6px;
}

.text-amber { color: #d97706 !important; }
.text-blue { color: #2563eb !important; }
.text-purple { color: #7c3aed !important; }
.text-green { color: #16a34a !important; }
.text-emerald { color: #059669 !important; }

/* Cards */
.shf-card {
    background: var(--shf-surface);
    border: 1px solid var(--shf-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.shf-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--shf-border);
    background: #fafafa;
}

.shf-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.shf-card-sub {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: var(--shf-text-muted);
}

/* Filters Bar */
.shf-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--shf-border);
    align-items: flex-end;
}

.shf-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shf-filter-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--shf-text-muted);
}

.shf-input, .shf-select {
    padding: 8px 12px;
    border: 1px solid var(--shf-border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--shf-text);
    outline: none;
    transition: border-color 0.15s ease;
}

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

.shf-filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* Table */
.shf-table-container {
    width: 100%;
    overflow-x: auto;
}

.shf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.shf-table th {
    background: #f8fafc;
    color: var(--shf-text-muted);
    font-weight: 600;
    font-size: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--shf-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shf-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--shf-border);
    vertical-align: middle;
}

.shf-table tbody tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.shf-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending { background: #fef3c7; color: #b45309; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-assigned { background: #e0f2fe; color: #0369a1; }
.badge-en-route { background: #fef3c7; color: #d97706; }
.badge-arrived { background: #f3e8ff; color: #7e22ce; }
.badge-otp-verified { background: #ede9fe; color: #6d28d9; }
.badge-in-progress { background: #e0e7ff; color: #4338ca; }
.badge-completed { background: #dcfce7; color: #15803d; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }

.badge-pay-captured { background: #d1fae5; color: #065f46; }
.badge-pay-pending { background: #fffbeb; color: #b45309; }
.badge-pay-none { background: #f1f5f9; color: #64748b; }

/* Buttons */
.shf-ops-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}

.shf-ops-btn-primary {
    background: var(--shf-primary);
    color: #fff;
}
.shf-ops-btn-primary:hover {
    background: var(--shf-primary-hover);
    color: #fff;
}

.shf-ops-btn-secondary {
    background: #f1f5f9;
    color: var(--shf-text);
    border-color: var(--shf-border);
}
.shf-ops-btn-secondary:hover {
    background: #e2e8f0;
}

.shf-ops-btn-outline {
    background: transparent;
    border-color: var(--shf-border);
    color: var(--shf-text);
}
.shf-ops-btn-outline:hover {
    background: #f1f5f9;
}

.shf-ops-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.shf-ops-btn-success {
    background: #10b981;
    color: #fff;
}
.shf-ops-btn-success:hover {
    background: #059669;
    color: #fff;
}

/* Modals */
.shf-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.shf-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
}

.shf-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.shf-modal-lg {
    max-width: 800px;
}

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

.shf-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.shf-modal-close {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--shf-text-muted);
}

.shf-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
}

.shf-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--shf-border);
    background: #f8fafc;
}

/* Timeline in Booking Detail */
.shf-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.shf-timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.shf-timeline-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    margin-top: 4px;
    flex-shrink: 0;
}

.shf-timeline-point.active {
    background: var(--shf-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.shf-timeline-point.completed {
    background: #10b981;
}

.shf-timeline-title {
    font-weight: 600;
    font-size: 13px;
}

.shf-timeline-time {
    font-size: 11px;
    color: var(--shf-text-muted);
}

/* Toast */
.shf-toast {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.shf-toast-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.shf-toast-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* Technician Grid */
.shf-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.shf-tech-card {
    border: 1px solid var(--shf-border);
    border-radius: 10px;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.shf-tech-name {
    font-weight: 700;
    font-size: 15px;
}

.shf-tech-detail {
    font-size: 12px;
    color: var(--shf-text-muted);
}

.shf-loading-spinner {
    padding: 30px;
    text-align: center;
    color: var(--shf-text-muted);
    font-style: italic;
}

/* Access Denied Card */
.shf-ops-denied-card {
    max-width: 520px;
    margin: 60px auto;
    background: #fff;
    border: 1px solid var(--shf-border);
    border-radius: 14px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.shf-ops-denied-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.shf-ops-denied-reason {
    color: var(--shf-danger);
    font-weight: 600;
    margin-bottom: 16px;
}

.shf-ops-denied-details {
    background: #f8fafc;
    border: 1px solid var(--shf-border);
    border-radius: 8px;
    padding: 14px;
    text-align: left;
    font-size: 12px;
    margin-bottom: 20px;
}

.shf-ops-denied-hint {
    color: var(--shf-text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Modals Sizing */
.shf-modal-sm { max-width: 420px; }
.shf-modal-md { max-width: 580px; }
.shf-modal-lg { max-width: 840px; }

/* Report Switcher & Tabs */
.shf-report-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--shf-border);
    padding-bottom: 12px;
}
.shf-report-toggle {
    background: #f1f5f9;
    border: 1px solid var(--shf-border);
    color: var(--shf-text);
}
.shf-report-toggle.active {
    background: var(--shf-primary);
    border-color: var(--shf-primary);
    color: #fff;
}

/* Form Grid */
.shf-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.shf-divider {
    border: 0;
    border-top: 1px solid var(--shf-border);
    margin: 24px 0;
}
.shf-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 500;
}
.shf-pincode-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 600;
}
.shf-border-top {
    border-top: 1px solid var(--shf-border);
}
.shf-text-xs { font-size: 11px; }
.text-emerald { color: #059669; }
.shf-badge-emerald { background: #d1fae5; color: #065f46; }

