:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --bg: #0f172a;
    --card: rgba(30, 41, 59, 0.6);
    --border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --input-bg: rgba(15, 23, 42, 0.9);
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --card: rgba(255, 255, 255, 0.8);
    --border: rgba(0, 0, 0, 0.1);
    --text: #0f172a;
    --text-dim: #64748b;
    --input-bg: #ffffff;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 120px;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

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

.animate-item {
    animation: fadeInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.search-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
}
.search-bar input { background: transparent; border: none; color: inherit; width: 100%; outline: none; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.mini-card {
    background: var(--card);
    padding: 15px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.mini-card.main-stat {
    grid-column: span 2;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.chart-container {
    background: var(--card);
    border-radius: 24px;
    padding: 15px;
    border: 1px solid var(--border);
    margin-bottom: 25px;
}

.glass-card {
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    margin-bottom: 15px;
}

.badge { padding: 4px 8px; border-radius: 8px; font-size: 10px; font-weight: 800; }
.badge-low { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-ok { background: rgba(34, 197, 94, 0.15); color: var(--success); }

.btn-action {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 12px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s;
}
.btn-action:active { transform: scale(0.98); }

.btn-outline {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: inherit;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}

nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--card);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    padding: 12px;
    z-index: 1000;
}
.nav-btn { background: transparent; border: none; color: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; cursor: pointer; flex: 1; }
.nav-btn.active { color: var(--primary); }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.hidden { display: none !important; }

input, select, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    color: var(--text);
    margin-top: 6px;
    outline: none;
    font-size: 16px;
}

/* Calendar Styling */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 15px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.calendar-day-name { text-align: center; font-size: 10px; color: var(--text-dim); font-weight: 800; padding-bottom: 5px; }
.calendar-cell {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--card); border-radius: 12px; border: 1px solid var(--border); font-size: 14px; font-weight: 600; cursor: pointer; position: relative;
}
.calendar-cell.empty { background: transparent; border: none; cursor: default; }
.calendar-cell.today { border: 2px solid var(--primary); }
.calendar-cell.has-payment::after {
    content: ''; position: absolute; bottom: 6px; width: 4px; height: 4px; background: var(--success); border-radius: 50%;
}

#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1;
    transform: translate(-50%, -50%) scale(1.1);
    object-fit: cover;
    filter: blur(10px) brightness(0.5);
}

/* Login Screen */
.login-screen {
    position: fixed;
    inset: 0;
    background: transparent !important;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 350px;
    text-align: center;
    background: rgba(30, 41, 59, 0.7) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 28px;
}

.custom-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: white; padding: 10px 20px; border-radius: 12px;
    z-index: 3000; font-weight: 700; animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { top: -50px; } to { top: 20px; } }

.log-entry {
    font-size: 11px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.log-time { color: var(--text-dim); font-weight: 600; }
.log-msg { color: var(--text); }

/* Multi-column Layout for Customer Info */
.grid-half { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.customer-pic { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.social-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 13px; }
