/* ============================================
   Joseph's Dream Worker App - Styles
   Brand: Dark Green + Gold
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #083B2C;
    --primary-light: #354E2D;
    --primary-dark: #1B2A24;
    --gold: #B08D3A;
    --gold-light: #BD8531;
    --gold-pale: #E0D2AA;
    --olive: #63602F;
    --sage: #B1D3BB;
    --sage-mid: #7FA88B;
    --forest: #407C51;
    --white: #FFFFFF;
    --off-white: #F5F2EB;
    --text-dark: #1B2A24;
    --text-light: #FFFFFF;
    --text-muted: #6B7C74;
    --border: #D4D8D6;
    --danger: #C0392B;
    --danger-light: #E74C3C;
    --success: #27AE60;
    --warning: #F39C12;
    --shadow: 0 2px 8px rgba(8, 59, 44, 0.15);
    --shadow-lg: 0 4px 16px rgba(8, 59, 44, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Utility ---- */
.hidden {
    display: none !important;
}

/* ---- App Shell ---- */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    background: var(--white);
}

/* ---- Header ---- */
.header {
    background: var(--primary);
    color: var(--text-light);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo svg {
    width: 36px;
    height: 36px;
}

.header-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.header-subtitle {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: 400;
}

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

.header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}

.header-btn:hover,
.header-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

/* ---- Status Bar (clock in/out strip) ---- */
.status-bar {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.status-bar.clocked-in {
    background: var(--forest);
}

.status-bar.on-break {
    background: var(--warning);
    color: var(--text-dark);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: none;
}

.status-dot.active {
    background: var(--success);
    animation: pulse 2s infinite;
}

.status-dot.break {
    background: var(--warning);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-timer {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---- Navigation (Bottom Tab Bar) ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item span {
    font-weight: 500;
}

/* ---- Page Content ---- */
.page {
    display: none;
    padding: 16px 20px;
    padding-bottom: 80px;
    animation: fadeIn 0.2s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Login Screen ---- */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 40px 24px;
}

.login-logo {
    margin-bottom: 8px;
}

.login-logo svg {
    width: 80px;
    height: 80px;
}

.login-logo-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
}

.login-company {
    color: var(--gold);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
}

.login-tagline {
    color: var(--sage);
    font-size: 0.8rem;
    margin-bottom: 40px;
    text-align: center;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--primary);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gold);
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.worker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    max-height: 260px;
    overflow-y: auto;
}

.worker-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--white);
}

.worker-option:hover,
.worker-option.selected {
    border-color: var(--gold);
    background: rgba(176, 141, 58, 0.06);
}

.worker-option.selected {
    border-color: var(--primary);
    background: rgba(8, 59, 44, 0.06);
}

.worker-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sage);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.worker-name {
    font-weight: 600;
    font-size: 0.95rem;
}

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

/* ---- PIN Input ---- */
.pin-section {
    display: none;
    text-align: center;
}

.pin-section.visible {
    display: block;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 240px;
    margin: 0 auto;
}

.pin-key {
    height: 52px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.pin-key:hover,
.pin-key:active {
    background: var(--off-white);
    border-color: var(--primary);
}

.pin-key.backspace {
    font-size: 1rem;
}

.pin-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 20px;
}

/* ---- Cards ---- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
}

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

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.card-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.card-badge.active {
    background: rgba(39, 174, 96, 0.12);
    color: var(--success);
}

.card-badge.inactive {
    background: rgba(192, 57, 43, 0.12);
    color: var(--danger);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover,
.btn-primary:active {
    background: var(--primary-light);
}

.btn-gold {
    background: var(--gold);
    color: var(--white);
}

.btn-gold:hover,
.btn-gold:active {
    background: var(--gold-light);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover,
.btn-danger:active {
    background: var(--danger-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover,
.btn-outline:active {
    background: rgba(8, 59, 44, 0.06);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1.1rem;
    border-radius: var(--radius);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Clock In/Out Button ---- */
.clock-btn-container {
    text-align: center;
    margin: 20px 0;
}

.clock-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    background: var(--primary);
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

.clock-btn svg {
    width: 32px;
    height: 32px;
}

.clock-btn:hover,
.clock-btn:active {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(8, 59, 44, 0.3);
}

.clock-btn.clocked-in {
    background: var(--danger);
    border-color: var(--danger-light);
}

/* Loading / spinner state — !important to override clocked-in styles */
.clock-btn.loading,
.clock-btn.loading.clocked-in {
    background: var(--primary-dark) !important;
    border-color: transparent !important;
    pointer-events: none !important;
    position: relative;
    opacity: 0.85;
    transform: none !important;
    cursor: wait;
}

.clock-btn.loading::after,
.clock-btn.loading.clocked-in::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 4px solid rgba(176, 141, 58, 0.2);
    border-top-color: var(--gold);
    animation: clockSpin 0.8s linear infinite;
}

@keyframes clockSpin {
    to { transform: rotate(360deg); }
}

/* ---- Quick Action Grid ---- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.quick-action:hover,
.quick-action:active {
    border-color: var(--gold);
    box-shadow: var(--shadow);
}

.quick-action svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.quick-action span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select,
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color var(--transition);
    font-family: inherit;
    -webkit-appearance: none;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7C74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ---- Activity Chips (Office Staff) ---- */
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 2px solid var(--border);
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.chip:hover {
    border-color: var(--sage-mid);
}

.chip.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.chip.client {
    border-style: dashed;
}

.chip.client.active {
    background: var(--gold);
    border-color: var(--gold);
    border-style: solid;
    color: var(--white);
}

/* ---- Current Activity Display ---- */
.current-activity {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius);
    padding: 18px;
    color: var(--white);
    margin-bottom: 16px;
}

.current-activity-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.current-activity-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.current-activity-client {
    font-size: 0.85rem;
    color: var(--gold-pale);
}

.current-activity-time {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 8px;
}

/* ---- Timeline / History ---- */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 16px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-dot.break {
    background: var(--warning);
    box-shadow: 0 0 0 2px var(--warning);
}

.timeline-dot.task {
    background: var(--forest);
    box-shadow: 0 0 0 2px var(--forest);
}

.timeline-dot.office {
    background: var(--gold);
    box-shadow: 0 0 0 2px var(--gold);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-content {
    font-size: 0.9rem;
    margin-top: 2px;
}

.timeline-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Admin Table ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    padding: 10px 8px;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.admin-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(8, 59, 44, 0.03);
}

/* ---- Summary Stats ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ---- Date Picker Row ---- */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 8px 0;
}

.date-nav button {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 0.85rem;
}

.date-nav .current-date {
    font-weight: 700;
    font-size: 0.95rem;
}

/* ---- Section Titles ---- */
.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    margin-top: 20px;
}

.section-title:first-child {
    margin-top: 0;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ---- Toast Notifications ---- */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: var(--success);
}

.toast.warning {
    background: #e67e22;
}

/* ---- Purchases (Compras) ---- */
.form-row {
    display: flex;
    gap: 12px;
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

.input-with-prefix .form-input {
    padding-left: 28px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.toggle-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--danger);
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.purchase-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid var(--gold);
}

.purchase-card.urgent {
    border-left-color: var(--danger);
}

.purchase-card.history {
    border-left-color: var(--text-muted);
    opacity: 0.85;
}

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

.purchase-item {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.purchase-cost {
    font-weight: 700;
    color: var(--gold);
    font-size: 0.95rem;
}

.purchase-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.purchase-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.purchase-photo {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 8px;
    object-fit: cover;
}

.purchase-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-urgent {
    background: var(--danger);
    color: #fff;
}

.badge-approved {
    background: var(--success);
    color: #fff;
}

.badge-rejected {
    background: var(--danger);
    color: #fff;
}

.badge-purchased {
    background: var(--gold);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm.btn-gold {
    background: var(--gold);
    color: #fff;
}

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

.export-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.export-totals {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--gold);
}

/* ---- Incident Cards ---- */
.incident-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid var(--text-muted);
}

.incident-card.severity-low { border-left-color: var(--forest); }
.incident-card.severity-medium { border-left-color: #e67e22; }
.incident-card.severity-high { border-left-color: var(--danger); }

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

.incident-category {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.incident-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.incident-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.incident-photo {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: calc(var(--radius) - 4px);
    margin-top: 8px;
}

.incident-resolution {
    font-size: 0.82rem;
    color: var(--forest);
    background: rgba(45,90,45,0.08);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 8px;
}

.gps-link {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.78rem;
}

/* ---- Modal / Overlay ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.modal h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 16px;
}

/* ---- Photo Capture ---- */
.photo-capture {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.photo-capture:hover {
    border-color: var(--gold);
    background: rgba(176, 141, 58, 0.04);
}

.photo-capture svg {