:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 260px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

.logo img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

.logo .icon,
.logo h1 {
    display: none;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Content Area */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    max-width: calc(100vw - var(--sidebar-width));
}

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

header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

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

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-card .trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

/* Table Styling */
.card-container {
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
}

tr:last-child td {
    border-bottom: none;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Grid Layouts for Content */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-animate {
    animation: fadeIn 0.4s ease forwards;
}

/* Tags */
.tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.tag-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Import Styles */
.import-zone {
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.import-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.preview-table {
    margin-top: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

dialog {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    background: #1e293b;
    padding: 2.5rem;
    outline: none;
    max-width: 90vw;
    margin: auto;
    color: white;
}

dialog[open] {
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-content {
    padding: 2.5rem;
    color: white;
}

/* --- Login Page --- */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-card h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.login-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.login-input-group {
    text-align: left;
}

.login-input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    margin-left: 0.3rem;
    font-weight: 500;
}

.login-input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.login-input-group input:focus {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.login-btn {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.login-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    padding: 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: none;
}