﻿/* ─── Safari Recoveries — base styles ─── */
:root {
    --safari-orange: #d97706;
    --deep-amber:    #b65c04;
    --sunset-gold:   #f59e0b;
    --golden-yellow: #fbbf24;
    --warm-brown:    #78350f;
    --alert-red:     #dc2626;
    --forest-green:  #166534;
    --bright-green:  #22c55e;
    --mint-fresh:    #86efac;
    --sky-blue:      #0ea5e9;
    --cream:         #faf9f6;
    --charcoal:      #1a1a1a;
    --slate-gray:    #64748b;
    --bg:            #f8f6f1;
    --card-bg:       #ffffff;
    --border:        #e5e0d5;
    --text:          #1a1a1a;
    --text-muted:    #6b7280;
    --radius:        12px;
    --shadow:        0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg:     0 4px 6px rgba(0,0,0,0.05), 0 10px 24px rgba(0,0,0,0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ─── Layout ─── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

.container-narrow {
    max-width: 440px;
    margin: 0 auto;
    padding: 60px 16px;
}

/* ─── Header ─── */
.app-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}
.brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--warm-brown);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.brand-icon { font-size: 24px; }

/* ─── Cards ─── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

/* ─── Typography ─── */
h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; color: var(--warm-brown); }
h2 { font-size: 20px; font-weight: 600; margin-bottom: 16px; color: var(--charcoal); }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.muted { color: var(--text-muted); font-size: 14px; }
.subtitle { color: var(--text-muted); margin-bottom: 32px; font-size: 15px; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--charcoal);
}
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--cream);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--safari-orange);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
    background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.2;
}
.btn-primary {
    background: var(--safari-orange);
    color: white;
}
.btn-primary:hover { background: var(--deep-amber); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
    background: var(--card-bg);
    color: var(--charcoal);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--cream); }
.btn-danger {
    background: var(--alert-red);
    color: white;
}
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─── Status pills ─── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}
.pill-valid     { background: #dcfce7; color: var(--forest-green); }
.pill-expiring  { background: #fef3c7; color: var(--warm-brown); }
.pill-expired   { background: #fee2e2; color: var(--alert-red); }
.pill-lost      { background: #e0e7ff; color: #3730a3; }
.pill-no-expiry { background: #f3f4f6; color: #6b7280; }

/* ─── Dashboard counters ─── */
.counters {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.counter {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow);
}
.counter-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}
.counter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.counter-total .counter-value { color: var(--charcoal); }
.counter-valid .counter-value { color: var(--bright-green); }
.counter-expiring .counter-value { color: var(--sunset-gold); }
.counter-expired .counter-value { color: var(--alert-red); }
.counter-no-expiry .counter-value { color: var(--slate-gray); }

/* ─── Document list ─── */
.doc-list { list-style: none; }
.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: transform 0.1s, box-shadow 0.1s;
    text-decoration: none;
    color: inherit;
}
.doc-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.doc-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    border-radius: 10px;
    flex-shrink: 0;
}
.doc-info { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.doc-meta { font-size: 13px; color: var(--text-muted); }
.doc-status { flex-shrink: 0; }

/* ─── Empty state ─── */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ─── Topbar actions ─── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}
.topbar h1 { margin: 0; }

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--charcoal);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 1000;
    max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--alert-red); }
.toast-success { background: var(--forest-green); }

/* ─── Error / alert ─── */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-error { background: #fee2e2; color: var(--alert-red); border: 1px solid #fca5a5; }
.alert-info  { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warn  { background: #fef3c7; color: var(--warm-brown); border: 1px solid var(--golden-yellow); }

/* ─── Loading ─── */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .counters { grid-template-columns: repeat(2, 1fr); }
    .input-row { grid-template-columns: 1fr; }
    h1 { font-size: 24px; }
    .container { padding: 16px 12px; }
}
