/* ===========================================================================
   site.css — Allowance Tracker styles
   =========================================================================== */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #16a34a;
    --danger: #dc2626;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-text: #f1f5f9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.user-greeting {
    font-size: 0.875rem;
    color: #94a3b8;
}

.nav-links {
    list-style: none;
    margin-top: 1rem;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s;
}

.nav-links li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--sidebar-text);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-content {
    margin-left: 240px;
    padding: 2rem;
    flex: 1;
    max-width: 900px;
}

.main-content-full {
    padding: 2rem;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.login-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Forms */
.form-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Balance card */
.balance-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    text-align: center;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

/* Tables */
.tx-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tx-table th {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

.tx-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

/* Kid selector */
.kid-selector {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kid-selector select {
    max-width: 200px;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}
