:root {
    color-scheme: light;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background-color: #f6f7fb;
    color: #1e293b;
}

body {
    margin: 0;
    background: #f6f7fb;
}

.admin-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

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

.admin-title h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.admin-title p {
    margin: 0;
    color: #64748b;
}

.admin-actions {
    display: flex;
    gap: 12px;
}

.status-panel {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #e2e8f0;
    color: #334155;
}

.status-panel.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-panel.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.auth-panel,
.admin-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 16px;
}

.auth-panel h2 {
    margin-top: 0;
}

.login-form {
    display: grid;
    gap: 16px;
    max-width: 380px;
}

.login-form label {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
    color: #334155;
}

.login-form input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5f5;
    font-size: 1rem;
}

.auth-help {
    margin-top: 16px;
    color: #94a3b8;
}

.admin-panel.hidden,
.auth-panel.hidden {
    display: none;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
}

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

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================================
   User Management
   ============================================================================ */

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

.card-header h3 {
    margin: 0;
}

.search-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.table-container {
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: #f1f5f9;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .loading,
.data-table .empty,
.data-table .error {
    text-align: center;
    color: #64748b;
    padding: 24px;
}

.data-table .error {
    color: #dc2626;
}

.badge-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
}

.btn-icon.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================================================
   Modals
   ============================================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f1f5f9;
}

.modal-body {
    padding: 24px;
}

.modal-info {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 0.95rem;
}

.modal-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
}

.modal-form input[type="email"],
.modal-form input[type="password"],
.modal-form select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.modal-form input:focus,
.modal-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.checkbox-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.hint {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 400;
}

.warning {
    color: #dc2626;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}
/* ============================================================================
   Upload Form Styles
   ============================================================================ */

.upload-form {
    display: grid;
    gap: 16px;
    max-width: 800px;
}

.upload-form label {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
    color: #334155;
}

.upload-form input,
.upload-form textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5f5;
    font-size: 1rem;
    font-family: inherit;
}

.upload-form input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.upload-form input[type="file"]::file-selector-button {
    padding: 8px 16px;
    background-color: #f1f5f9;
    border: 1px solid #cbd5f5;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.upload-form input[type="file"]::file-selector-button:hover {
    background-color: #e2e8f0;
}

.upload-form label small {
    font-size: 0.8rem;
    color: #94a3b8;
}

.upload-form textarea {
    resize: vertical;
    font-family: "Monaco", "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.upload-form .modal-actions {
    margin-top: 8px;
}

/* ============================================================================
   Table Styling
   ============================================================================ */

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #334155;
}

.data-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table td {
    padding: 12px 16px;
}

.data-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.btn-small.delete-category:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.data-table .loading,
.data-table .empty {
    text-align: center;
    color: #94a3b8;
    padding: 24px !important;
}

/* ============================================================================
   Card Header Styles
   ============================================================================ */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

/* ============================================================================
   Search and Filter Styles
   ============================================================================ */

.search-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    font-size: 0.95rem;
    flex: 1;
    min-width: 150px;
}

.search-input::placeholder {
    color: #94a3b8;
}