/* --- APP THEME: PREMIUM DESIGN SYSTEM --- */
:root {
    /* Colors */
    --primary: #10b981;
    /* Emerald 500 */
    --primary-dark: #059669;
    /* Emerald 600 */
    --primary-light: #d1fae5;
    /* Emerald 100 */

    --bg-main: #f8fafc;
    /* Slate 50 */
    --surface: #ffffff;

    --text-main: #0f172a;
    /* Slate 900 */
    --text-sec: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */

    --border: #e2e8f0;
    /* Slate 200 */
    --border-light: #f1f5f9;
    /* Slate 100 */

    --danger: #ef4444;
    /* Red 500 */
    --danger-light: #fee2e2;
    /* Red 100 */

    --warning: #f59e0b;
    /* Amber 500 */
    --warning-light: #fef3c7;
    /* Amber 100 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding-bottom: calc(85px + var(--safe-bottom));
    /* Deep bottom padding for glass nav */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- GLASSMORPHISM HEADERS --- */
.header-glass {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    /* Highly transparent */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

.app-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

/* --- CARDS & SURFACES --- */
.card-premium {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-premium:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

/* --- INPUTS --- */
.inp-premium {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-main);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.inp-premium:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* --- BUTTONS & ANIMATIONS --- */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    -webkit-user-select: none;
    user-select: none;
}

.btn-premium:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--text-sec);
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: #fecaca;
}

/* --- FLOATING ACTION BUTTON (FAB) --- */
.fab-premium {
    position: fixed;
    bottom: calc(85px + var(--safe-bottom));
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    border: none;
    font-size: 2rem;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy */
}

.fab-premium:active {
    transform: scale(0.85);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.fab-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.5);
}

/* --- BOTTOM NAVIGATION (GLASS) --- */
.nav-glass {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 calc(12px + var(--safe-bottom));
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-light);
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
    width: 64px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

.nav-icon {
    font-size: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

/* --- MODALS & BOTTOM SHEETS --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    /* Slate dark overlay */
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.bottom-sheet {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.modal-backdrop.active .bottom-sheet {
    transform: translateY(0);
}

@media(min-width: 600px) {
    .modal-backdrop {
        align-items: center;
    }

    .bottom-sheet {
        border-radius: var(--radius-xl);
        width: 450px;
        transform: scale(0.95);
        opacity: 0;
    }

    .modal-backdrop.active .bottom-sheet {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- BADGES --- */
.badge-premium {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-gray {
    background: var(--border);
    color: var(--text-sec);
}

.badge-green {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-red {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-amber {
    background: var(--warning-light);
    color: #b45309;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}