/* Wallet System - Main Stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #FFC107;
    --primary-dark: #E6AC00;
    --secondary: #C0C0C0;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #FFD700;
    --bg: #0A0A0B;
    --surface: #1A1A1D;
    --surface-hover: #252528;
    --text: #E5E5E5;
    --text-muted: #A0A0A5;
    --border: #333338;
    --gold-glow: rgba(255, 193, 7, 0.25);
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.45);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', sans-serif;
    --sidebar-width: 260px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0A0A0B 0%, #1A1A1D 50%, #0A0A0B 100%);
    position: relative;
    overflow: hidden;
}

.login-bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.login-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}
.shape-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; right: -100px; }
.shape-2 { width: 300px; height: 300px; background: var(--secondary); bottom: -50px; left: -50px; animation-delay: -3s; }
.shape-3 { width: 200px; height: 200px; background: var(--success); top: 50%; left: 50%; animation-delay: -5s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.login-container { position: relative; z-index: 10; width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    position: relative;
    z-index: 10;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 50%; object-fit: cover; border: 3px solid #FFC107; box-shadow: 0 0 30px var(--gold-glow); }
.login-icon {
    width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #FFD700, #FFC107);
    font-size: 32px; color: #1A1A1D;
    box-shadow: 0 0 30px var(--gold-glow);
}
.login-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-header p { color: var(--text-muted); font-size: 14px; }
.login-error { color: var(--danger); text-align: center; margin-top: 12px; font-size: 14px; min-height: 20px; }

.login-form input {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}
.login-form .btn { position: relative; z-index: 1; pointer-events: auto; }

/* ===== APP LAYOUT ===== */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.site-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; border: 3px solid var(--primary); box-shadow: 0 0 20px var(--gold-glow); }
.logo-placeholder {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFC107);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px; font-size: 24px; color: #1A1A1D;
    border: 2px solid #C0C0C0; box-shadow: 0 0 20px var(--gold-glow);
}
.site-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.user-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 193, 7, 0.15); color: var(--primary);
    padding: 4px 12px; border-radius: 20px; font-size: 13px;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: var(--radius);
    color: var(--text-muted); text-decoration: none;
    transition: all var(--transition); margin-bottom: 4px; font-weight: 500;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active {
    background: linear-gradient(135deg, #FFD700, #FFC107);
    color: #1A1A1D; box-shadow: 0 4px 15px var(--gold-glow);
    font-weight: 700;
}
.nav-item i { width: 20px; text-align: center; font-size: 16px; }

.logout-btn {
    margin: 16px; padding: 12px; border: 1px solid var(--danger);
    background: transparent; color: var(--danger); border-radius: var(--radius);
    cursor: pointer; font-family: inherit; font-size: 14px;
    transition: all var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.logout-btn:hover { background: var(--danger); color: white; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}

.menu-toggle {
    display: none; background: none; border: none;
    color: var(--text); font-size: 20px; cursor: pointer; padding: 8px;
}

.datetime-display { text-align: center; flex: 1; }
.day-name { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.date-time { font-size: 14px; color: var(--text-muted); }
.time-sep { margin: 0 8px; opacity: 0.5; }
#currentTime { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.role-tag {
    padding: 4px 12px; border-radius: 20px; font-size: 12px;
    background: rgba(148, 163, 184, 0.2); color: var(--text-muted);
}
.role-tag.admin { background: rgba(255, 193, 7, 0.2); color: var(--primary); border: 1px solid rgba(255, 193, 7, 0.4); }

.page-content { padding: 24px; flex: 1; }

.page-title {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title h1 { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.username-tag {
    background: var(--surface); padding: 6px 14px; border-radius: 20px;
    font-size: 13px; color: var(--text-muted); border: 1px solid var(--border);
}

/* ===== CARDS & COMPONENTS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px; font-weight: 600; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex; align-items: center; gap: 16px;
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeIn 0.5s ease backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.stat-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.stat-card.pending .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-card.paid .stat-icon { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-card.trips .stat-icon { background: rgba(255, 193, 7, 0.15); color: var(--primary); }

.stat-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 800; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
    animation: fadeIn 0.6s ease backwards;
}
.chart-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px var(--gold-glow);
    border-color: var(--primary);
}

.chart-card h3 {
    font-size: 16px; font-weight: 700; margin-bottom: 16px;
    color: var(--primary);
}

.chart-wrapper {
    position: relative;
    width: 180px; height: 180px;
    margin: 0 auto 16px;
}

.chart-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}
.chart-stat { padding: 8px; background: rgba(0,0,0,0.2); border-radius: 8px; }
.chart-stat .label { color: var(--text-muted); display: block; font-size: 11px; }
.chart-stat .val { font-weight: 700; font-size: 15px; }

/* Wallet Page */
.wallet-top-bar {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
    margin-bottom: 24px;
}

.pending-total-card, .balance-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    flex: 1; min-width: 180px;
}
.pending-total-card { border-color: var(--danger); background: rgba(239,68,68,0.08); }
.balance-card { border-color: var(--primary); background: rgba(255, 193, 7, 0.08); }

.pending-total-card .label, .balance-card .label {
    display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px;
}
.pending-total-card .amount { font-size: 32px; font-weight: 800; color: var(--danger); }
.balance-card .amount { font-size: 32px; font-weight: 800; color: var(--primary); }

.wallet-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-tabs {
    display: flex; gap: 8px; margin-bottom: 20px;
    background: var(--surface); padding: 6px; border-radius: var(--radius);
    width: fit-content;
}
.filter-tabs .tab {
    padding: 10px 20px; border: none; background: transparent;
    color: var(--text-muted); border-radius: 8px; cursor: pointer;
    font-family: inherit; font-size: 14px; transition: all var(--transition);
    display: flex; align-items: center; gap: 6px;
}
.filter-tabs .tab.active { background: linear-gradient(135deg, #FFD700, #FFC107); color: #1A1A1D; font-weight: 700; }
.filter-tabs .tab:hover:not(.active) { background: var(--surface-hover); }

.badge {
    padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700;
}
.badge.pending { background: var(--danger); color: white; }

/* Location Cards */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.location-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    animation: fadeIn 0.4s ease backwards;
}
.location-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.location-card.pending { border-top: 3px solid var(--danger); }
.location-card.paid { border-top: 3px solid var(--success); opacity: 0.85; }

.location-img {
    width: 100%; height: 160px; object-fit: cover;
    background: var(--bg);
}
.location-img-placeholder {
    width: 100%; height: 160px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; color: rgba(255,255,255,0.5);
}

.location-body { padding: 16px; }
.location-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.location-name { font-size: 18px; font-weight: 700; }
.status-badge {
    padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700;
}
.status-badge.pending { background: rgba(239,68,68,0.2); color: var(--danger); }
.status-badge.paid { background: rgba(34,197,94,0.2); color: var(--success); }

.location-detail {
    font-size: 13px; color: var(--text-muted); margin-bottom: 4px;
    display: flex; align-items: center; gap: 6px;
}
.location-price {
    font-size: 24px; font-weight: 800; color: var(--primary);
    margin: 12px 0;
}
.location-date { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.location-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    border-top: 1px solid var(--border); padding-top: 12px;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border: none; border-radius: var(--radius);
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, #FFD700, #FFC107); color: #1A1A1D; font-weight: 700; }
.btn-primary:hover { background: linear-gradient(135deg, #FFC107, #E6AC00); transform: translateY(-1px); box-shadow: 0 4px 15px var(--gold-glow); }
.btn-secondary { background: var(--surface-hover); color: var(--text); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-whatsapp {
    background: #25D366; color: white;
    padding: 8px 16px; justify-content: center;
    border-radius: var(--radius); gap: 8px;
    font-weight: 600;
}
.btn-whatsapp i { font-size: 18px; }
.btn-whatsapp:hover { background: #128C7E; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text);
    font-family: inherit; font-size: 14px;
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.checkbox-group { margin: 16px 0; }
.checkbox-label {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-size: 14px;
}
.checkbox-label input[type="checkbox"] {
    width: 20px; height: 20px; accent-color: var(--primary);
}

/* Report Page */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.filter-actions { display: flex; gap: 8px; }

.report-summary {
    display: flex; gap: 24px; flex-wrap: wrap;
}
.summary-item { flex: 1; min-width: 150px; }
.summary-item .label { display: block; font-size: 13px; color: var(--text-muted); }
.summary-item .value { font-size: 28px; font-weight: 800; }
.summary-item.total .value { color: var(--success); }

.report-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--border); font-size: 14px;
}
.data-table th { background: var(--bg); font-weight: 600; color: var(--text-muted); }
.data-table tr:hover td { background: rgba(255, 193, 7, 0.05); }
.table-img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }

/* Settings */
.settings-tabs {
    display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap;
}
.settings-tab {
    padding: 12px 20px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted);
    border-radius: var(--radius); cursor: pointer;
    font-family: inherit; font-size: 14px;
    transition: all var(--transition);
    display: flex; align-items: center; gap: 8px;
}
.settings-tab.active { background: linear-gradient(135deg, #FFD700, #FFC107); color: #1A1A1D; border-color: var(--primary); font-weight: 700; }

.settings-panel { display: none; animation: fadeIn 0.3s ease; }
.settings-panel.active { display: block; }

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px; margin-bottom: 20px;
}
.colors-grid input[type="color"] {
    width: 100%; height: 44px; border: none; border-radius: 8px; cursor: pointer;
    background: transparent;
}

.logo-preview {
    width: 100px; height: 100px; border-radius: 50%;
    background: var(--bg); border: 2px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; margin-bottom: 12px;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-preview i { font-size: 32px; color: var(--text-muted); }

.card-header-flex {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}

.users-list { display: flex; flex-direction: column; gap: 12px; }
.user-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; background: var(--bg); border-radius: var(--radius);
    border: 1px solid var(--border); flex-wrap: wrap; gap: 12px;
}
.user-info h4 { font-size: 16px; margin-bottom: 4px; }
.user-info .perms { font-size: 12px; color: var(--text-muted); }
.user-actions { display: flex; gap: 8px; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); z-index: 200;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 24px; cursor: pointer; line-height: 1;
}
.modal-body { padding: 24px; }

/* Toast */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 300;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 20px; border-radius: var(--radius);
    color: white; font-size: 14px; font-weight: 500;
    animation: slideIn 0.3s ease; box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: linear-gradient(135deg, #FFD700, #FFC107); color: #1A1A1D; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .page-content { padding: 16px; }
    .wallet-top-bar { flex-direction: column; align-items: stretch; }
    .wallet-actions { justify-content: center; }
    .datetime-display { font-size: 12px; }
    .day-name { font-size: 14px; }
    .stat-value { font-size: 22px; }
    .charts-grid { grid-template-columns: 1fr; }
    .locations-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .filter-tabs { width: 100%; }
    .filter-tabs .tab { flex: 1; justify-content: center; padding: 8px; font-size: 12px; }
    .pending-total-card .amount, .balance-card .amount { font-size: 24px; }
}

/* Image preview in form */
.img-preview {
    width: 100%; max-height: 150px; object-fit: cover;
    border-radius: var(--radius); margin-top: 8px;
}

.permissions-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin: 12px 0;
}

.overlay-sidebar {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 99; display: none;
}
.overlay-sidebar.active { display: block; }
