:root {
    --bg: #121214;
    --surface: #1e1e24;
    --surface-glass: rgba(30, 30, 36, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --primary: #ff1493;
    --primary-hover: #ff69b4;
    --text: #f3f4f6;
    --text-dim: #9ca3af;
    --accent: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    padding-bottom: 40px;
    line-height: 1.5;
}

/* Header & Hero */
.hero {
    position: relative;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(18, 18, 20, 0.2), var(--bg));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 20px;
}

.hero-content h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.hero-content p {
    color: var(--text-dim);
    font-size: 14px;
}

/* Tabs */
.tabs {
    position: relative;
    z-index: 3;
    display: flex;
    padding: 0 16px;
    gap: 16px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 4px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main Content */
main {
    padding: 16px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.section-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin: 24px 0 8px 4px;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

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

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #e5e7eb;
}

input[type="date"], select, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    font-family: inherit;
    appearance: none;
    outline: none;
    transition: border-color 0.2s;
}

input[type="date"]:focus, select:focus, textarea:focus {
    border-color: var(--primary);
}

textarea {
    resize: vertical;
}

/* Custom Select styling */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' 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 12px center;
    background-size: 16px;
}

/* Sliders */
.slider-group {
    margin-bottom: 24px;
}

.slider-group:last-child {
    margin-bottom: 0;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.val-display {
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    margin-top: 10px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
    border: 2px solid #fff;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

/* Buttons */
.btn-primary {
    display: block;
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3);
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.98);
    background: var(--primary-hover);
}

/* History Card */
.history-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.history-date {
    font-weight: 600;
    font-size: 16px;
}

.history-score {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}

.history-score.high { color: var(--accent); }
.history-score.low { color: var(--danger); }

.history-detail {
    font-size: 14px;
    color: var(--text-dim);
}

.history-detail span {
    color: var(--text);
    font-weight: 500;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

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

/* Chart Toggles */
.chart-toggle {
    background: rgba(255,255,255,0.1);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-toggle.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-secondary {
    padding: 10px 16px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    display: inline-block;
}

#conflict-modal.modal-hidden { display: none; }
#conflict-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
#conflict-modal .modal-content {
    background: var(--surface, #1a1a20);
    border-radius: 12px;
    padding: 20px;
    max-width: 500px; width: 100%;
    max-height: 80vh; overflow-y: auto;
    color: var(--text);
}
.conflict-row { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.conflict-row .conflict-date { font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.conflict-row label { display: block; margin: 4px 0; font-size: 13px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: flex-end; }
