/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3c50e0;
    --secondary: #8e92bc;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8f9fa;
    --dark: #1e293b;
    --bodydark1: #aeb7c0;
    --bodydark2: #d1d5db;
    --boxdark: #24303f;
    --boxdark-2: #1a222c;
    --strokedark: #2e3a47;
    --graydark: #2e3a47;
    --meta-4: #313d4a;
    --white: #ffffff;
    --black: #000000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #000000;
    background: #f5f5f5;
    line-height: 1.6;
}

/* Đảm bảo tất cả text mặc định là màu đen */
* {
    color: inherit;
}

h1, h2, h3, h4, h5, h6, p, span, div, td, th, label, input, select, textarea {
    color: #000000;
}

/* Layout */
.main-content {
    margin-left: 256px;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 2.5rem;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 256px;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid #e5e7eb;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s;
}

.sidebar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    z-index: 0;
}

.sidebar-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.logo-img {
    height: 65px;
    width: 65px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.sidebar-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close {
        display: block;
    }
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--black);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(46, 58, 71, 0.8);
    color: var(--white);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 1024px) {
    .sidebar-backdrop {
        display: block;
    }
    .sidebar-backdrop.hidden {
        display: none;
    }
}

/* Topbar */
.topbar {
    background: var(--white);
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
    }
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: none;
}

@media (min-width: 640px) {
    .topbar-title {
        display: block;
    }
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
    display: none;
}

@media (min-width: 640px) {
    .user-info {
        display: block;
    }
}

.user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--bodydark2);
}

.user-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.3s;
}

.user-icon:hover {
    background: #f3f4f6;
}

.logout-btn {
    padding: 0.5rem 1rem;
    color: var(--danger);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s;
}

.logout-btn:hover {
    color: #dc2626;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--black);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 1rem;
    background: var(--white);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: #2d3fb0;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    color: #000000;
}

.table th {
    font-weight: 600;
    background: #f9fafb;
    color: #000000;
}

.table tr:hover {
    background: #f9fafb;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid var(--danger);
    color: #991b1b;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid var(--success);
    color: #065f46;
}

.alert-info {
    background: #dbeafe;
    border: 1px solid var(--info);
    color: #1e40af;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--bodydark2);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.login-card {
    width: 100%;
    max-width: 28rem;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.login-body {
    padding: 2rem;
}

