/* Vijayadurga Harvesters - Staff Booking Desk Styling */
:root {
    --brand-dark: #1b3820;
    --brand-primary: #1e5128;
    --brand-primary-hover: #163e1e;
    --sidebar-bg: #142417;
    --bg-main: #f3f5f2;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --border-color: #d1d5db;
    --radius: 6px;
    --status-paid: #15803d;
    --status-awaiting: #b45309;
    --status-cancelled: #b91c1c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.4;
    font-size: 0.9rem;
}

/* Auth Overlay / Login View */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
    background-color: #e8ede6;
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.35rem;
    color: var(--brand-primary);
    font-weight: 700;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* App Header & Layout */
.app-header {
    background: var(--brand-dark);
    color: #ffffff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f1c11;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-brand h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.app-brand span {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
}

.staff-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Dashboard Metrics Grid */
.metrics-row {
    max-width: 1300px;
    margin: 20px auto 0;
    padding: 0 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.metric-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.metric-val.paid { color: var(--status-paid); }
.metric-val.awaiting { color: var(--status-awaiting); }

/* Operations Container */
.desk-container {
    max-width: 1300px;
    margin: 20px auto 40px;
    padding: 0 16px;
}

/* Filter Controls Toolbar */
.toolbar-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input {
    height: 36px;
    padding: 4px 10px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #ffffff;
}

.btn-csv {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-csv:hover {
    background: #1d4ed8;
}

/* Bookings Table */
.table-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-x: auto;
}

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

.desk-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.desk-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.desk-table tr:hover {
    background: #f8faf8;
}

/* Status Badges */
.badge-pay {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
}
.badge-pay.paid { background: #dcfce7; color: #15803d; }
.badge-pay.awaiting { background: #fef3c7; color: #b45309; }
.badge-pay.failed { background: #fee2e2; color: #991b1b; }

.badge-wf {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
}
.badge-wf.scheduled { background: #dbeafe; color: #1e40af; }
.badge-wf.inspected { background: #fef08a; color: #854d0e; }
.badge-wf.completed { background: #f0fdf4; color: #166534; }

.btn-open-detail {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-primary);
    cursor: pointer;
}

.btn-open-detail:hover {
    background: #f0fdf4;
    border-color: var(--brand-primary);
}

/* Modal Drawer for Dispatch & Scheduling */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

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

.modal-card {
    background: #ffffff;
    border-radius: var(--radius);
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.modal-title-row h3 {
    font-size: 1.25rem;
    color: var(--brand-primary);
}

.btn-close-x {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.drawer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.detail-section {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
}

.detail-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.field-pair {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.field-pair .label {
    color: #64748b;
}

.field-pair .val {
    font-weight: 600;
}

.whatsapp-box {
    background: #eefbee;
    border: 1px solid #c7ebc8;
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 14px;
}

.whatsapp-box h5 {
    color: #166534;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.whatsapp-pre {
    background: #ffffff;
    border: 1px solid #c7ebc8;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 140px;
    overflow-y: auto;
    color: #1f2937;
    margin-bottom: 10px;
}

.btn-wa {
    background: #15803d;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
}

.btn-wa:hover {
    background: #166534;
}

.btn-save-dispatch {
    background: var(--brand-primary);
    color: #ffffff;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 14px;
    width: 100%;
}

.btn-save-dispatch:hover {
    background: var(--brand-primary-hover);
}

.audit-list {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.775rem;
}

.audit-item {
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
