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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.app-wrapper {
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Compact Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logout-btn {
    padding: 8px 20px;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-1px);
}

main {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

section {
    margin-bottom: 30px;
}

section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

section h3 {
    color: #34495e;
    margin-bottom: 10px;
    font-size: 1.2em;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 4px;
}

.error {
    color: #e74c3c;
    font-weight: bold;
    padding: 15px;
    background: #ffe5e5;
    border-radius: 4px;
}

/* Dashboard Overview */
.overview .stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    color: white;
    font-size: 2.2em;
    font-weight: 800;
}

/* Kids Grid */
.kids-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.kid-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.kid-card:hover {
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
}

.kid-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e8ed;
}

.kid-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.3em;
}

.balance {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.3em;
}

.recent-entry {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin-bottom: 12px;
}

.entry-type {
    font-size: 0.85em;
    color: #7f8c8d;
    text-transform: uppercase;
}

.entry-description {
    color: #2c3e50;
}

.entry-amount {
    color: #27ae60;
    font-weight: bold;
}

.view-ledger-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-ledger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.view-ledger-btn:active {
    transform: translateY(0);
}

/* Recent Activity */
.activity-list {
    list-style: none;
    padding: 0;
}

.activity-item {
    display: grid;
    grid-template-columns: 80px 80px 1fr auto;
    gap: 15px;
    padding: 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 4px;
    align-items: center;
}

.activity-time {
    color: #7f8c8d;
    font-size: 0.9em;
}

.activity-type {
    font-size: 0.85em;
    padding: 3px 8px;
    background: #e1e8ed;
    border-radius: 3px;
    text-align: center;
}

.activity-description {
    color: #2c3e50;
}

.activity-amount {
    color: #27ae60;
    font-weight: bold;
}

/* Ledger View */
.ledger-view {
    width: 100%;
}

.ledger-header {
    margin-bottom: 30px;
}

.back-btn {
    padding: 10px 20px;
    background: rgba(149, 165, 166, 0.2);
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #667eea;
    color: white;
    transform: translateX(-4px);
}

.balance-display {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

.balance-label {
    color: #7f8c8d;
    font-size: 1em;
}

.balance-value {
    color: #27ae60;
    font-size: 2em;
    font-weight: bold;
}

/* Ledger Table */
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ledger-table thead {
    background: #2c3e50;
    color: white;
}

.ledger-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.ledger-table tbody tr {
    border-bottom: 1px solid #e1e8ed;
}

.ledger-table tbody tr:hover {
    background: #f8f9fa;
}

.ledger-table td {
    padding: 12px;
}

.date-cell .date {
    color: #2c3e50;
    font-weight: 500;
}

.date-cell .time {
    color: #7f8c8d;
    font-size: 0.85em;
}

.badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-earned {
    background: #d4edda;
    color: #155724;
}

.badge-adjusted {
    background: #fff3cd;
    color: #856404;
}

.amount-cell {
    font-weight: bold;
}

.amount-cell.positive {
    color: #27ae60;
}

.amount-cell.negative {
    color: #e74c3c;
}

.balance-cell {
    color: #2c3e50;
    font-weight: 600;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.login-box h1 {
    font-size: 3.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 800;
}

.login-box .subtitle {
    color: #718096;
    font-size: 1.1em;
    margin-bottom: 40px;
}

.login-box form {
    text-align: left;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled {
    background: #f7fafc;
    cursor: not-allowed;
    opacity: 0.6;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    margin-top: 8px;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-box .error {
    margin-top: 16px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.95em;
}
