:root {
    --primary-color: #3699FF;
    --secondary-color: #1BC5BD;
    --success-color: #1BC5BD;
    --danger-color: #F64E60;
    --warning-color: #FFA800;
    --info-color: #8950FC;
    --dark-color: #181C32;
    --light-color: #F3F6F9;
    --sidebar-width: 265px;
    --header-height: 70px;
    --sidebar-bg: #1E1E2D;
    --sidebar-hover: #1A1A27;
    --text-dark: #181C32;
    --text-muted: #B5B5C3;
    --border-color: #E4E6EF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--light-color);
    font-size: 14px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 1rem;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.user-info {
    flex: 1;
}

.user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
}

.logout-link, .login-link {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.logout-link:hover, .login-link:hover {
    color: var(--primary-color);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Flash Messages */
.flash-messages {
    padding: 1rem 2rem;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.flash-success {
    background-color: #E8FFF3;
    color: var(--success-color);
    border-left: 3px solid var(--success-color);
}

.flash-error {
    background-color: #FFE2E5;
    color: var(--danger-color);
    border-left: 3px solid var(--danger-color);
}

.flash-info {
    background-color: #EEE5FF;
    color: var(--info-color);
    border-left: 3px solid var(--info-color);
}

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.flash-close:hover {
    opacity: 1;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
}

/* Card Styles */
.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-body {
    color: var(--text-dark);
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col {
    flex: 1;
    padding: 0 0.75rem;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #2676d4);
    color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color), #0bb3a8);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color), #e89500);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger-color), #d93a4a);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: #2676d4;
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background-color: #0bb3a8;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #fff;
}

.btn-warning:hover {
    background-color: #e89b00;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(54, 153, 255, 0.1);
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--light-color);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 6px;
    text-align: center;
}

.badge-success {
    background-color: #E8FFF3;
    color: var(--success-color);
}

.badge-info {
    background-color: #EEE5FF;
    color: var(--info-color);
}

.badge-warning {
    background-color: #FFF8DD;
    color: var(--warning-color);
}

.badge-danger {
    background-color: #FFE2E5;
    color: var(--danger-color);
}

/* Button Icon Styles */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.btn-icon:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

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

.btn-secondary {
    background-color: var(--light-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--light-color);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .content {
        padding: 1rem;
    }

    .row {
        flex-direction: column;
    }

    .col-3, .col-4, .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Drag and Drop Styles */
.batch-row {
    transition: all 0.2s ease;
}

.batch-row:hover {
    background-color: #f8f9fa;
}

.batch-row.dragging {
    opacity: 0.4;
}

.batch-row[draggable="true"] {
    cursor: move;
}
