@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --accent: #1e293b;
    --success: #059669;
    --danger: #dc2626;
    --bg-body: #f8f9fa;
    --text-main: #18181b;
    --text-muted: #71717a;
    --border-soft: #f0f0f0;
    --sidebar-width: 280px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding-top: 60px;
}
body.sidebar-open { overflow: hidden; }

/* ====== Layout ====== */
.container { max-width: 1000px; }

.main-content {
    min-height: calc(100vh - 60px - 60px);
    padding: 1.5rem 1rem;
}

.glass-panel, .card-minimal {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
}

.stat-card { border: none; background: #fafafa; }

/* ====== Top Bar ====== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    z-index: 1030;
    padding: 0;
}
.topbar-brand {
    font-weight: 700;
    letter-spacing: -0.025em;
    font-size: 1.15rem;
    color: #ffffff;
}
.topbar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}
.topbar-link {
    display: block;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.topbar-link:hover { color: #ffffff; background: rgba(255,255,255,0.08); }
.topbar-link.active {
    color: #ffffff;
    background: rgba(255,255,255,0.12);
}
.topbar-user-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.topbar-user-btn:hover { background: rgba(255,255,255,0.1); }
.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #334155;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}
.sidebar-toggler {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.35rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.sidebar-toggler:hover { background: rgba(255,255,255,0.1); }

/* ====== Sidebar Overlay ====== */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.sidebar-overlay.show { opacity: 1; visibility: visible; }

/* ====== Sidebar ====== */
.sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--sidebar-width);
    max-width: 85vw;
    background: #0f172a;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid #1e293b;
}
.sidebar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.5rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1;
}
.sidebar-close:hover { color: #ffffff; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}
.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}
.sidebar-link:hover { color: #ffffff; background: rgba(255,255,255,0.08); }
.sidebar-link.active { color: #ffffff; background: rgba(255,255,255,0.12); }
.sidebar-link.text-danger { color: #ef4444 !important; }
.sidebar-link.text-danger:hover { background: rgba(239,68,68,0.15); }

.sidebar-footer {
    padding: 0.5rem;
    border-top: 1px solid #1e293b;
}

/* ====== Footer ====== */
.footer {
    background: #0f172a;
    padding: 1.25rem 0;
    border-top: 1px solid #1e293b;
}
.footer p { margin: 0; }

/* ====== Tables ====== */
.table thead th {
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-soft);
}
.table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.95rem;
}

/* ====== Forms ====== */
.form-control-glass, .form-select-glass {
    border: 1px solid var(--border-soft);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #fcfcfc;
}
.form-control-glass:focus {
    border-color: #d4d4d8;
    background-color: #fff;
    box-shadow: none;
}

/* ====== Buttons ====== */
.btn-primary-glass, .btn-success-glass, .btn-danger-glass, .btn-dark-glass, .btn-primary-custom,
.btn-primary, .btn-success, .btn-danger, .btn-dark, .btn-secondary, .btn-warning, .btn-info {
    border-radius: 8px !important;
    padding: 0.75rem 1.5rem;
    font-weight: 500 !important;
    border: none !important;
    transition: all 0.2s ease-in-out !important;
}
.btn-primary-glass, .btn-primary { background-color: var(--accent) !important; color: white !important; }
.btn-success-glass, .btn-success { background-color: var(--success) !important; color: white !important; }
.btn-danger-glass, .btn-danger { background-color: var(--danger) !important; color: white !important; }
.btn-dark-glass, .btn-dark { background-color: #000000 !important; color: white !important; }
.btn:hover, 
.btn-primary:hover, .btn-primary-glass:hover,
.btn-success:hover, .btn-success-glass:hover,
.btn-danger:hover, .btn-danger-glass:hover,
.btn-dark:hover, .btn-dark-glass:hover,
.btn-primary-custom:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)) !important;
    filter: brightness(0.9) !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* ====== Typography ====== */
h1, h2, h3, h4 { letter-spacing: -0.02em; margin-bottom: 1.5rem; }
.text-muted { color: var(--text-muted) !important; }

/* ====== Printing ====== */
@media print {
    body { background: white; padding-top: 0; }
    .topbar, .sidebar, .sidebar-overlay, .footer, .btn-back, .btn-print { display: none !important; }
    .main-content { padding: 0 !important; }
}
