/* base.css — Reset, variables, typography, layout, buttons, forms */

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

:root {
    --blue: #2563eb;
    --blue-light: #eff6ff;
    --dark: #0a0a0a;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --white: #ffffff;
    --green: #16a34a;
    --green-light: #f0fdf4;
    --amber: #d97706;
    --amber-light: #fefce8;
    --red: #dc2626;
    --red-light: #fef2f2;
    --purple: #9333ea;
    --purple-light: #faf5ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
}

/* MAIN */
.main {
    margin-left: 220px;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: var(--gray-500);
}

/* PANELS */
.panel {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.panel-title {
    font-size: 14px;
    font-weight: 700;
}

.panel-body {
    padding: 20px;
}

/* FIELD GROUPS & INPUTS */
.setup-row {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.setup-row:last-child { margin-bottom: 0; }

.field-group {
    flex: 1;
}

.field-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.field-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: var(--gray-50);
    transition: border-color 0.15s;
}

.field-input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
}

/* BUTTONS */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
    background: var(--gray-100);
    color: var(--dark);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-200); }

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

.btn-green:hover { opacity: 0.9; }

/* KEY SETUP */
.key-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.key-status.connected { background: var(--green-light); color: var(--green); }
.key-status.missing { background: var(--red-light); color: var(--red); }

/* CLAIM TYPE TOGGLE */
.claim-type-toggle {
    display: flex;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.claim-type-btn {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--gray-500);
    white-space: nowrap;
}

.claim-type-btn:first-child { border-right: 1px solid var(--gray-200); }

.claim-type-btn.active[data-type="non-flood"] {
    background: var(--blue);
    color: var(--white);
}

.claim-type-btn.active[data-type="flood"] {
    background: #0369a1;
    color: var(--white);
}

.claim-type-btn:hover:not(.active) {
    background: var(--gray-100);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .status-bar { flex-wrap: wrap; }
    .stat-card { min-width: 120px; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
