:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #e5e7eb;
    --sidebar-bg: #f9fafb;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --btn-primary-bg: #000000;
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #333333;
    --btn-secondary-bg: #f3f4f6;
    --btn-secondary-text: #000000;
    --btn-secondary-hover: #e5e7eb;
    --alert-success-bg: #dcfce7;
    --alert-success-text: #166534;
    --alert-error-bg: #fee2e2;
    --alert-error-text: #991b1b;
    --alert-info-bg: #dbeafe;
    --alert-info-text: #1e40af;
    --table-hover: #f9fafb;
    --table-header-bg: #f9fafb;
    --status-active-bg: #dcfce7;
    --status-active-text: #166534;
    --status-inactive-bg: #fee2e2;
    --status-inactive-text: #991b1b;
    --modal-overlay: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #374151;
    --sidebar-bg: #111827;
    --card-bg: #1f2937;
    --input-bg: #374151;
    --input-border: #4b5563;
    --btn-primary-bg: #ffffff;
    --btn-primary-text: #000000;
    --btn-primary-hover: #e5e7eb;
    --btn-secondary-bg: #374151;
    --btn-secondary-text: #ffffff;
    --btn-secondary-hover: #4b5563;
    --alert-success-bg: #064e3b;
    --alert-success-text: #6ee7b7;
    --alert-error-bg: #7f1d1d;
    --alert-error-text: #fca5a5;
    --alert-info-bg: #1e3a8a;
    --alert-info-text: #93c5fd;
    --table-hover: #374151;
    --table-header-bg: #111827;
    --status-active-bg: #064e3b;
    --status-active-text: #6ee7b7;
    --status-inactive-bg: #7f1d1d;
    --status-inactive-text: #fca5a5;
    --modal-overlay: rgba(0, 0, 0, 0.7);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

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

.logo {
    font-size: 24px;
    font-weight: bold;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: var(--btn-secondary-hover);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

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

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

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

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
}

.btn-success:hover {
    background: #15803d;
}

.layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    transition: width 0.3s ease;
    position: relative;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--text-color);
    transition: all 0.3s;
    text-decoration: none;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.sidebar-menu .dropdown {
    position: relative;
}

.sidebar-menu .dropdown > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--text-color);
    transition: all 0.3s;
    text-decoration: none;
}

.sidebar-menu .dropdown > a::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s ease;
    margin-left: 8px;
    display: inline-block;
}

.sidebar-menu .dropdown.expanded > a::after {
    transform: rotate(180deg);
}

.sidebar-menu .dropdown-content {
    display: none;
    background: var(--bg-color);
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.sidebar-menu .dropdown.expanded .dropdown-content {
    display: block;
    max-height: 500px;
    padding-left: 20px;
}

.sidebar-menu .dropdown-content a {
    padding: 10px 20px;
    font-size: 14px;
}

.sidebar-toggle {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 30px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    z-index: 10;
}

.sidebar-toggle:hover {
    background: var(--btn-primary-hover);
}

.sidebar.collapsed .sidebar-toggle {
    right: -15px;
    transform: translateY(-50%) rotate(180deg);
}

.sidebar.collapsed .sidebar-menu a {
    padding: 12px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-menu a span {
    display: none;
}

.sidebar.collapsed .sidebar-menu .dropdown > a::after {
    display: none;
}

.sidebar.collapsed .sidebar-menu .dropdown-content {
    position: fixed;
    left: 60px;
    top: 0;
    width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 5px 5px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: none;
    padding: 10px 0;
}

.sidebar.collapsed .sidebar-menu .dropdown.expanded .dropdown-content {
    display: block;
}

.main-content {
    flex: 1;
    padding: 30px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
}

.form-control select {
    cursor: pointer;
}

.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: var(--alert-success-bg);
    color: var(--alert-success-text);
    border: 1px solid var(--status-active-bg);
}

.alert-error {
    background: var(--alert-error-bg);
    color: var(--alert-error-text);
    border: 1px solid var(--status-inactive-bg);
}

.alert-info {
    background: var(--alert-info-bg);
    color: var(--alert-info-text);
    border: 1px solid var(--alert-info-bg);
}

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

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--table-header-bg);
    font-weight: 600;
}

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

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: var(--status-active-bg);
    color: var(--status-active-text);
}

.status-inactive {
    background: var(--status-inactive-bg);
    color: var(--status-inactive-text);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    color: var(--text-color);
    font-size: 14px;
    opacity: 0.7;
}

.hero {
    background: linear-gradient(135deg, var(--btn-primary-bg) 0%, var(--btn-primary-hover) 100%);
    color: var(--btn-primary-text);
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-btn {
    background: var(--btn-primary-text);
    color: var(--btn-primary-bg);
    padding: 15px 40px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.hero-btn:hover {
    background: var(--btn-secondary-bg);
    transform: translateY(-2px);
}

.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

[data-theme="dark"] .glass-effect {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-footer a {
    color: var(--text-color);
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 20px;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
}

.pagination a:hover {
    background: var(--table-hover);
}

.pagination .active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}

@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-menu .dropdown-content {
        display: block;
        padding-left: 30px;
    }
    
    .sidebar-menu .dropdown-content a {
        padding: 8px 20px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .hero-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .auth-container {
        margin: 50px auto;
        padding: 30px 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .form-control {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card-header {
        font-size: 16px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 13px;
    }
    
    .hero-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 6px 8px;
    }
    
    .status-badge {
        padding: 2px 8px;
        font-size: 11px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .sidebar-menu a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .sidebar-menu .dropdown-content a {
        padding: 8px 15px;
        font-size: 13px;
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--btn-primary-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.confirm-modal.active {
    display: flex;
}

.confirm-content {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.confirm-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.confirm-message {
    color: var(--text-color);
    margin-bottom: 25px;
    opacity: 0.8;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 100px;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.5;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    background: var(--btn-secondary-hover);
    transform: translateY(-1px);
}

.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background: #dc2626;
    border-radius: 50%;
    display: none;
}

.notification-badge.has-notification::after {
    display: block;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown.active {
    display: block;
}

.notification-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}

.notification-item:hover {
    background: var(--table-hover);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.6;
}

.notification-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-color);
    opacity: 0.6;
}

.language-selector {
    display: flex;
    gap: 5px;
}

.language-btn {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.language-btn.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}

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

.language-btn.active:hover {
    background: var(--btn-primary-hover);
}