/* TiviLocal Application (Admin & Client)
   Dark Mode / Glassmorphism Redesign
*/

/* --- Global Overrides for Portal --- */
body {
    background-color: var(--slate-900);
    color: var(--slate-50);
}

/* --- Login Screens --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    background-image: radial-gradient(circle at top right, #1e293b 0%, transparent 40%);
    padding: 1.5rem;
}
.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.auth-header { text-align: center; margin-bottom: 2.5rem; }
.auth-logo { height: 48px; margin-bottom: 1.5rem; }
.auth-title { font-size: 1.75rem; margin-bottom: 0.5rem; color: white; }
.auth-subtitle { color: var(--slate-400); }

/* Form Styles (Added to fix Login) */
.form-group { margin-bottom: 1.25rem; }
.form-label { 
    display: block; 
    font-size: 0.875rem; 
    font-weight: 600; 
    color: var(--slate-300); 
    margin-bottom: 0.5rem; 
}
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--brand-500);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.badge { padding: 0.5rem; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500; }
.badge-danger { background: rgba(220, 38, 38, 0.2); color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.3); }

/* --- Dashboard Layout --- */
.app-shell { 
    display: flex; 
    min-height: 100vh; 
    background-color: #0f172a; /* slate-900 */
    background-image: 
        radial-gradient(at 100% 0%, rgba(220, 38, 38, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 0%, rgba(30, 41, 59, 1) 0px, transparent 50%);
    color: white;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 50;
}

.sidebar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3rem;
    padding-left: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.nav-menu { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--slate-400);
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item:hover { 
    color: white; 
    background-color: rgba(255,255,255,0.05); 
}

.nav-item.active { 
    background-color: rgba(220, 38, 38, 0.1); /* Red tint */
    color: var(--brand-500); 
    border-color: rgba(220, 38, 38, 0.2);
}

.user-profile {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: auto;
}

/* Main Area */
.app-main {
    flex: 1;
    margin-left: 260px;
    padding: 3rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}
.page-title { 
    font-size: 2.25rem; 
    font-weight: 800; 
    color: white;
    letter-spacing: -0.02em;
}

/* --- Data Display --- */

/* Cards/Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    transition: transform 0.2s;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-label { 
    font-size: 0.75rem; 
    color: var(--slate-400); 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem; 
}
.stat-value { font-size: 2.5rem; font-weight: 700; color: white; line-height: 1; }

/* Tables */
.table-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--slate-400);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table td {
    padding: 1.25rem 1.5rem;
    font-size: 0.9375rem;
    color: var(--slate-200);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background-color: rgba(255, 255, 255, 0.02); }

/* Statement Cards (Injected via JS) */
.statement-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.statement-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--brand-600);
}

/* --- Modals --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal-card {
    background: #1e293b;
    width: 100%; max-width: 500px;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { color: white; font-size: 1.25rem; }

.modal-body { padding: 2rem; color: var(--slate-300); }

.modal-close { background: none; border: none; font-size: 1.75rem; color: var(--slate-400); cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: white; }

/* Payment Specifics inside Modal */
.modal-amount { font-size: 2.5rem; font-weight: 800; color: white; display: block; margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .app-sidebar { display: none; }
    .app-main { margin-left: 0; padding: 1.5rem; padding-top: 5rem; }
    .statement-card { flex-direction: column; gap: 1rem; text-align: center; }
    .statement-card .text-right { text-align: center; justify-content: center; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}