:root {
    --primary-color: #003366; /* Deep Blue */
    --secondary-color: #f8f9fa; /* Light Gray */
    --accent-color: #d4af37; /* Gold */
    --text-color: #333;
    --white: #ffffff;
    --success-color: #28a745;
    --error-color: #dc3545;
    --admin-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
}

header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--accent-color);
}

.brand {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand i {
    color: var(--accent-color);
    font-size: 1.4rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links li:hover, .nav-links li.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--white);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--white);
    color: var(--primary-color);
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background-color 0.2s;
}

button.primary-btn:hover {
    background-color: #002244;
}

/* Balance Display */
.balance-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.balance-hidden {
    filter: blur(8px);
}

/* History Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

/* --- Modern Authentication Styles --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #001a33 100%);
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    overflow: hidden;
    position: relative;
}

.auth-header {
    background: var(--primary-color);
    color: white;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    clip-path: ellipse(150% 100% at 50% 0%);
}

.auth-header .logo-area {
    margin-bottom: 10px;
}

.auth-header i {
    color: var(--accent-color);
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.auth-header h2 {
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: 0.5px;
}

.subtitle {
    opacity: 0.9;
    font-size: 0.9rem;
    margin: 8px 0 0;
    font-weight: 300;
}

.auth-tabs {
    display: flex;
    background: #f1f3f5;
    padding: 5px;
    margin: 25px;
    border-radius: 50px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Specific style for Admin Tab active state */
.tab-btn.active[onclick*="admin"] {
    color: var(--admin-color);
}

.auth-panel {
    padding: 0 30px 25px;
    animation: fadeIn 0.4s ease;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    transition: color 0.3s;
    font-size: 1.1rem;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s;
    font-size: 1rem;
    background-color: #fcfcfc;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
}

.input-group input:focus + i {
    color: var(--primary-color);
}

/* Admin Input variations */
.admin-group input:focus {
    border-color: var(--admin-color);
    box-shadow: 0 0 0 4px rgba(52, 58, 64, 0.1);
}
.admin-group input:focus + i {
    color: var(--admin-color);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, var(--primary-color), #004080);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 51, 102, 0.3);
}

.admin-btn {
    background: linear-gradient(to right, #343a40, #212529);
}

.admin-btn:hover {
    box-shadow: 0 5px 15px rgba(33, 37, 41, 0.3);
}

.auth-footer {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.75rem;
    color: #888;
}

.demo-text {
    text-align: center; 
    margin-top: 15px; 
    font-size: 0.8rem; 
    color: #888;
    font-style: italic;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Admin Specific */
.user-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: var(--white);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 5px solid var(--primary-color);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
    min-width: 250px;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast i {
    margin-right: 10px;
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
