:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent: #a855f7;
    --bg-deep: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

/* Layout */
.client-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.client-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border-left: 1px solid rgba(99,102,241,0.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(99,102,241,0.15);
}

.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 20px; color: #fff;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.brand-text {
    font-size: 20px; font-weight: 800;
    background: linear-gradient(135deg, #c7d2fe, #e9d5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-section {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-label {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    padding: 8px 12px; margin-top: 8px;
}

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 12px;
    color: var(--text-muted); text-decoration: none;
    font-size: 14px; font-weight: 600;
    transition: all 0.2s ease; margin-bottom: 4px;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: right;
}

.nav-link:hover {
    background: rgba(99,102,241,0.1);
    color: #c7d2fe;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.15));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,0.3);
}

.nav-link .icon { width: 20px; height: 20px; opacity: 0.8; }
.nav-link.active .icon { opacity: 1; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(99,102,241,0.15);
}

.user-card {
    background: rgba(99,102,241,0.1);
    border-radius: 12px; padding: 12px;
    display: flex; align-items: center; gap: 12px;
}

.user-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px; color: #fff;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* Main Content */
.client-main {
    flex: 1;
    margin-right: 280px;
    display: flex;
    flex-direction: column;
}

.client-header {
    padding: 16px 32px;
    background: rgba(15,23,42,0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-title { font-size: 18px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.btn-logout {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 10px;
    background: rgba(239,68,68,0.1);
    color: #f87171; border: 1px solid rgba(239,68,68,0.2);
    font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none;
}
.btn-logout:hover { background: rgba(239,68,68,0.2); }

.client-content { flex: 1; padding: 24px 32px; }

/* Utilities */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -10px rgba(99, 102, 241, 0.25), 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; border: none; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(99,102,241,0.2);
}
.btn-primary:hover { transform: translateY(-1.5px); box-shadow: 0 8px 25px rgba(99,102,241,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 12px;
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    text-decoration: none;
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }

.form-input {
    width: 100%; padding: 12px 16px;
    background: rgba(15,23,42,0.5);
    border: 1px solid var(--border);
    border-radius: 12px; color: var(--text);
    font-size: 14px; outline: none;
    transition: all 0.25s ease;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-muted); margin-bottom: 8px;
}

.alert-success {
    background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.3);
    color: #6ee7b7; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.alert-error {
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.alert-warning {
    background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3);
    color: #fcd34d; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.alert-info {
    background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.3);
    color: #93c5fd; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}

/* Modals Overlay System */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    font-size: 18px;
}
.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.modal-body {
    padding: 24px;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Mobile responsive fixes */
.mobile-toggle { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
    .client-sidebar {
        transform: translateX(100%);
        width: 280px;
    }
    .client-sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 35;
    }
    .sidebar-overlay.active { display: block; }
    .client-main { margin-right: 0; }
    .client-content { padding: 16px; }
    .client-header { padding: 12px 16px; }
    .mobile-toggle {
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; border-radius: 10px;
        background: var(--bg-card); border: 1px solid var(--border);
        color: var(--text); cursor: pointer; font-size: 18px;
    }
    .mobile-bottom-nav {
        display: grid !important;
    }
}

.mobile-bottom-nav {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 8px 4px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 50;
}
.mob-nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 6px 4px;
    text-decoration: none; color: var(--text-muted);
    font-size: 10px; font-weight: 600;
    border-radius: 8px; transition: all 0.2s;
    background: transparent;
    border: none;
}
.mob-nav-item.active { color: var(--primary); }
.mob-nav-item svg { width: 22px; height: 22px; }

/* Guest Specific Layout */
.guest-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(99,102,241,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168,85,247,0.12) 0%, transparent 50%);
    padding: 20px;
}
.guest-container {
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.brand-header {
    text-align: center;
    margin-bottom: 32px;
}
.brand-logo {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 28px; color: #fff;
    box-shadow: 0 8px 30px rgba(99,102,241,0.3);
    margin-bottom: 16px;
}
.brand-title {
    font-size: 24px; font-weight: 800;
    background: linear-gradient(135deg, #c7d2fe, #e9d5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-subtitle {
    font-size: 14px; color: var(--text-muted); margin-top: 4px;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
}
.btn-link {
    background: none; border: none; color: var(--primary);
    font-size: 13px; font-weight: 600; cursor: pointer;
    text-decoration: underline;
}
.text-error { color: #fca5a5; font-size: 12px; margin-top: 4px; }
.divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0; color: var(--text-muted); font-size: 12px;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

