:root {
    --bg-dark: #0f1115;
    --sidebar-bg: #14171c;
    --panel-bg: rgba(25, 28, 36, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f2f5;
    --text-muted: #8b92a5;
    --accent-celeste: #0ea5e9;
    --accent-celeste-hover: #0284c7;
    --accent-violet: #8b5cf6;
    --danger: #ef4444;
    --success: #10b981;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Base Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 30;
    transition: transform 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
}

.logo i {
    color: var(--accent-celeste);
    font-size: 28px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.nav-item.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.15) 0%, transparent 100%);
    color: var(--accent-celeste);
    border-left: 3px solid var(--accent-celeste);
}

.nav-item i {
    font-size: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--panel-border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
}

.active-crumb {
    color: var(--text-primary);
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 16px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent-celeste);
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

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

.btn-secondary {
    background-color: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
}

.btn-text {
    background: transparent;
    color: var(--accent-violet);
    padding: 8px 0;
}

.btn-text:hover {
    color: #a78bfa;
}

.btn-icon-danger {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    border-radius: 4px;
}

.btn-icon-danger:hover {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
}

.btn-icon {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    align-items: center;
    background-color: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-radius: 12px;
}

.btn-icon i {
    font-size: 20px;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.w-full {
    width: 100%;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

/* Glass Panels */
.glass-panel {
    background-color: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 32px;
}

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

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.mt-8 {
    margin-top: 32px;
}

.mt-6 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 16px;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.premium-input {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.premium-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.small-input {
    width: 80px;
    padding: 8px 12px;
    text-align: right;
}

/* Table */
.items-table-container {
    overflow-x: auto;
}

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

.items-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--panel-border);
    font-weight: 600;
}

.items-table td {
    padding: 16px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Summary Card */
.sticky-card {
    position: sticky;
    top: 32px;
}

.summary-card h3 {
    font-size: 16px;
    margin-bottom: 24px;
    font-weight: 600;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.summary-divider {
    height: 1px;
    background-color: var(--panel-border);
    margin: 20px 0;
}

.muted {
    color: var(--text-muted);
}

.total-row {
    font-size: 18px;
    font-weight: 600;
    align-items: center;
}

.currency {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 4px;
}

.highlight-total {
    font-size: 28px;
    color: var(--accent-celeste);
}

/* Animations */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.text-green {
    color: var(--success);
    font-size: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    .topbar {
        gap: 14px;
        flex-wrap: wrap;
    }
    .actions {
        display: flex;
        align-items: center;
    }
    .btn-icon {
        display: inline-flex;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        height: 100vh;
        top: 0;
        left: 0;
        background-color: var(--sidebar-bg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-backdrop {
        display: block;
    }
    .sidebar-backdrop.hidden {
        opacity: 0;
        pointer-events: none;
    }
    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .glass-panel {
        padding: 24px;
    }
    .summary-row,
    .form-group-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .small-input {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .main-content {
        padding: 18px;
    }
    .section-header h2 {
        font-size: 16px;
    }
    .breadcrumb {
        font-size: 13px;
    }
    .premium-input {
        padding: 10px 14px;
        font-size: 13px;
    }
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    .glass-panel {
        padding: 20px;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

/* Login */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.login-box {
    width: 100%;
    max-width: 400px;
}
