:root {
    --bg: #000000;
    --surface: #111111;
    --border: #222222;
    --accent: #E91E63;
    --accent-hover: #C2185B;
    --accent-muted: #1a0a0f;
    --text: #FFFFFF;
    --text-muted: #888888;
    --error: #f44336;
    --success: #4caf50;
    --sidebar-width: 200px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Login Page */
#login {
    display: none;
    height: 100vh;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a0a0f 0%, #000 70%);
}

#login.active {
    display: flex;
}

.login-box {
    background: var(--surface);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: fadeIn 0.5s ease-out;
}

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

.logo-circle {
    width: 60px;
    height: 60px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 20px rgba(233, 30, 99, 0.4);
}

.logo-circle.small {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    margin: 0;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, select, textarea {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 0.8rem 1rem;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.1);
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-secondary {
    background: #1a1a1a;
    color: white;
    border: 1px solid #333;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #252525;
}

.error-text {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 1rem;
    min-height: 1.2rem;
}

/* Layout */
#main-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

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

.nav-item.active {
    color: var(--text);
    background: var(--accent-muted);
    border-left-color: var(--accent);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    background: transparent;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem;
    transition: var(--transition);
}

.logout-btn:hover {
    opacity: 0.8;
}

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

.page {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.page.active {
    display: block;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: #333;
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.metric-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
}

/* Tables */
.dashboard-tables {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-container h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1e1e1e;
    letter-spacing: 1px;
}

td {
    padding: 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #1e1e1e;
}

tr:hover td {
    background: #1a1a1a;
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-active {
    color: var(--accent);
    border: 1px solid var(--accent);
    background: var(--accent-muted);
}

.badge-inactive {
    color: #666;
    border: 1px solid #333;
    background: #1a1a1a;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-input {
    position: relative;
    flex: 1;
}

.search-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-input input {
    padding-left: 2.75rem;
}

.filters-bar select {
    width: auto;
    min-width: 180px;
}

/* Power Toggle */
.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Actions */
.actions-cell {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text);
}

.btn-icon.edit:hover { color: var(--accent); }
.btn-icon.delete:hover { color: var(--error); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

#page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid #333;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #222;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid transparent;
}

.step.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.step.completed {
    background: var(--accent);
    color: white;
}

.step-line {
    width: 50px;
    height: 2px;
    background: #222;
    margin: 0 0.5rem;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-tables {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .brand-name, .nav-item span {
        display: none;
    }
    .content {
        margin-left: 60px;
    }
    .sidebar-header {
        padding: 1.5rem 0.75rem;
    }
}
