:root {
    --primary: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-light: #e0e7ff; /* Indigo 100 */
    --bg-color: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #475569; /* Slate 600 - Darker for sharper contrast */
    --border-color: #e2e8f0; /* Slate 200 */
    --input-bg: #f1f5f9; /* Slate 100 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.025);
    --radius-lg: 12px; /* Sharper */
    --radius-md: 8px;  /* Sharper */
    --radius-sm: 6px;  /* Sharper */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: var(--bg-color);
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
    line-height: 1.6;
    letter-spacing: -0.01em; /* Sharper typography */
}

.app {
    display: flex;
    height: 100vh;
    flex-direction: column;
}

/* --- Navigation (Mobile First) --- */
.sidebar {
    background: var(--card-bg);
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 10;
    border-top: 1px solid var(--border-color);
}

.sidebar-header {
    display: none;
}

.nav-buttons {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    padding: 12px 16px; /* Bigger touch targets */
}

.nav-buttons button {
    background: none;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px; /* Slightly larger */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    outline: none; /* Remove blue ring */
}

.nav-buttons button svg {
    width: 24px; /* Bigger icons */
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.5; /* Sharper icons */
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-buttons button.active, .nav-buttons button:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* --- Main Layout --- */
.main {
    flex: 1;
    padding: 32px 24px 100px; /* Mobile breathing room */
    width: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

/* --- Components --- */
.card {
    background: var(--card-bg);
    padding: 32px; /* Bigger padding */
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 20px; /* Bigger headers */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

input, textarea {
    width: 100%;
    padding: 16px 20px; /* Thicker, less skinny */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    font-size: 16px; /* Bigger font */
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    font-family: inherit;
    color: var(--text-main);
    outline: none; /* Remove blue ring */
}

input::placeholder, textarea::placeholder {
    color: #94a3b8;
}

input:focus, textarea:focus {
    border-color: var(--primary); /* Just a sharp border change, no glow */
}

button {
    padding: 16px 24px; /* Thicker buttons */
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: white;
    font-weight: 500;
    font-size: 16px; /* Bigger font */
    transition: background 0.2s ease, transform 0.1s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none; /* Remove blue ring */
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-secondary:hover {
    background: #c7d2fe;
}

.btn-icon {
    padding: 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
}

.btn-icon:hover {
    background: var(--input-bg);
    color: var(--text-main);
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    background: var(--text-main);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    animation: toast-in 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(-10px); }
}

/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 24px;
    backdrop-filter: blur(8px); /* Calmer background */
}

.modal {
    background: var(--card-bg);
    width: 100%;
    max-width: 480px; /* Slightly wider */
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

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

/* --- Desktop Layout --- */
@media (min-width: 768px) {
    .app {
        flex-direction: row;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 240px;
        height: 100vh;
        border-right: 1px solid var(--border-color);
        border-top: none;
        border-bottom: none;
        padding: 32px 24px;
        box-sizing: border-box;
        box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    }
    .sidebar-header {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 48px;
    }
    .sidebar-logo {
        width: 40px;
        height: 40px;
        background: var(--primary);
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
    }
    .sidebar h1 {
        display: block;
        font-size: 24px;
        margin: 0;
        font-weight: 700;
        color: var(--text-main);
        letter-spacing: -0.03em;
    }
    .nav-buttons {
        flex-direction: column;
        padding: 0;
    }
    .nav-buttons button {
        flex-direction: row;
        width: 100%;
        text-align: left;
        margin-bottom: 8px;
        padding: 14px 20px;
        font-size: 15px;
    }
    .main {
        margin-left: 240px;
        padding: 48px 64px; /* Standard wide padding */
    }
    #toast-container {
        bottom: 40px;
        right: 40px;
    }
}

/* --- Print Styles --- */
@media print {
    body {
        background: white;
        color: black;
    }
    .app, .modal-overlay, #toast-container {
        display: none !important;
    }
    #print-container {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        padding: 0;
        box-sizing: border-box;
    }
    @page {
        margin: 15mm;
    }
}

#print-container {
    display: none;
}