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

/* === CSS Variables === */
:root {
    --bg-secondary: #f9fafb;
    --bg-base: #ffffff;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success-text: #166534;
    --success-bg: #f0fdf4;
    --warning-text: #854d0e;
    --warning-bg: #fefce8;
    --error-text: #991b1b;
    --error-bg: #fef2f2;
}

/* === Base === */
body {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
    color: var(--text-primary);
}

/* === Header === */
.header {
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.header h1 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* === Nav Button === */
.nav-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nav-btn:hover { background: var(--border); }

/* === Toast === */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}
.toast.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
}
.toast.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fecaca;
}
@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* === Modal === */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.visible { display: flex; }
.modal-content {
    background: var(--bg-base);
    border-radius: 8px;
    padding: 24px;
    min-width: 400px;
    max-width: 90%;
}
.modal-title { font-size: 16px; margin-bottom: 16px; }
.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 16px;
}
.modal-input:focus { outline: none; border-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* === Mobile Header === */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
    }
    .header h1 { font-size: 15px; }
    .header-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        width: 100%;
    }
    .nav-btn {
        text-align: center;
        padding: 8px 10px;
        font-size: 13px;
    }
    .modal { padding: 16px; }
    .modal-content { min-width: 0; width: 100%; max-width: 100%; padding: 18px; }
    .modal-actions { flex-direction: column; }
    .toast { left: 16px; right: 16px; bottom: 16px; }
}
