@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.5);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #ec4899;
    --accent-hover: #db2777;
    --success: #10b981;
    --danger: #ef4444;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-bg: rgba(255, 255, 255, 0.8);
    --sidebar-hover: rgba(99, 102, 241, 0.05);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0, transparent 50%), 
        radial-gradient(at 50% 0%, rgba(139, 92, 246, 0.05) 0, transparent 50%), 
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.08) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    z-index: 10;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.2));
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Sub-menu Grouping */
.nav-group-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-group-label::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.sub-nav {
    margin-left: 0.5rem;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    padding-left: 0.5rem;
}

.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 5;
}

.content {
    padding: 2rem;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.title-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms & Filters */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.filter-grid .form-group { margin-bottom: 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text-main); }
.btn-outline:hover { background: var(--sidebar-hover); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

th, td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    white-space: nowrap;
}

th {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.4);
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-responsive {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
}

tr:hover td { 
    background: rgba(99, 102, 241, 0.04); 
    color: var(--primary);
}

tr td:first-child {
    border-left: 3px solid transparent;
}

tr:hover td:first-child {
    border-left: 3px solid var(--primary);
}

/* Modern Badge */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-blue { background: rgba(99, 102, 241, 0.1); color: #4f46e5; border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-green { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-gray { background: rgba(100, 116, 139, 0.1); color: #475569; border: 1px solid rgba(100, 116, 139, 0.2); }

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: none;
    font-size: 0.95rem;
    font-weight: 500;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

/* Modals */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
    z-index: 1000; justify-content: center; align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: #fff; width: 100%; max-width: 500px;
    border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
    padding: 1.5rem 2rem; border-bottom: 1px solid var(--card-border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 2rem; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; transition: color 0.2s; }
.close-btn:hover { color: var(--danger); }

/* Layout sections */
.section-view { display: none; }
.section-view.active { display: block; animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

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

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-blue { background: rgba(99, 102, 241, 0.1); color: #1d4ed8; border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-purple { background: rgba(139, 92, 246, 0.1); color: #6d28d9; border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-green { background: rgba(16, 185, 129, 0.1); color: #047857; border: 1px solid rgba(16, 185, 129, 0.2); position: relative; padding-left: 1.5rem; }
.badge-green::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    width: 6px;
    height: 6px;
    background: #047857;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-gray { background: rgba(148, 163, 184, 0.1); color: #475569; border: 1px solid rgba(148, 163, 184, 0.2); }

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Mobile App Specific Styles */
.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
}
.mobile-header {
    background: white;
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.mobile-content {
    padding: 1.5rem;
    padding-bottom: 5rem;
}
.mobile-btn-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-btn-action:active {
    transform: scale(0.96);
}
@media (max-width: 500px) {
    .mobile-container {
        box-shadow: none;
        width: 100%;
    }
}

/* --- PREMIUM LOGIN UI --- */
.login-body {
    background: #0f172a;
    background: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%), 
                radial-gradient(at 50% 0%, rgba(139, 92, 246, 0.1) 0, transparent 50%), 
                radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.15) 0, transparent 50%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
}

.login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-out;
}

.login-logo {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted); /* Darker for light theme */
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.premium-input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.premium-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3rem;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.premium-input:focus {
    outline: none;
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.premium-btn {
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    margin-top: 1rem;
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
}

.premium-btn:active {
    transform: translateY(0);
}

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