:root {
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.70);
    --primary-color: #bb86fc;
    --secondary-color: #03dac6;
    --text-color: #ffffff;
    --text-muted: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.12);
    --input-bg: rgba(0, 0, 0, 0.3);
    --backdrop-blur: 16px;
    --radius: 12px;
    --spacing: 20px;
}

/* Modern Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Critical for mobile */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #fff;
    text-decoration: none;
}

/* Layout */
.navbar {
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem var(--spacing);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    align-items: center;
}

/* .container is handled by Bootstrap */
/* We only add spacing if needed, but Bootstrap handles padding too. */

/* Components */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    /* Ensure it doesn't exceed parent */
}

h1,
h2,
h3,
h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    /* Comfortable touch target */
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s, background-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    /* width: 100%; REMOVED - Causes buttons to be full width */
    padding: 10px 16px;
    /* Adjusted padding */
    background: var(--primary-color);
    color: #000;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s, opacity 0.2s;
    text-align: center;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.98);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.alert-error {
    background: rgba(207, 102, 121, 0.15);
    color: #ffb4b4;
    border: 1px solid rgba(207, 102, 121, 0.3);
}

.alert-success {
    background: rgba(3, 218, 198, 0.15);
    color: #80ffea;
    border: 1px solid rgba(3, 218, 198, 0.3);
}

/* Lists & Tables */
.debt-list li {
    list-style: none;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
    :root {
        --spacing: 16px;
        /* Smaller spacing on mobile */
    }

    .container {
        padding: var(--spacing);
        max-width: 100%;
        /* Full width */
    }

    .glass-card {
        padding: 20px;
        border-radius: 16px;
        /* Slightly rounder look */
    }

    .navbar {
        padding: 0.8rem var(--spacing);
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }
}