/* ============================================
   SQLCloud Space - Custom Admin Panel CSS
   ============================================ */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;

    /* Sidebar Colors */
    --sidebar-bg: #1e293b;
    --sidebar-bg-dark: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(37, 99, 235, 0.2);
    --sidebar-border: #334155;

    /* Content Colors */
    --content-bg: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Status Colors */
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;

    /* Dimensions */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 60px;
    --header-height: 48px;

    /* Transitions */
    --transition-speed: 0.2s;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--content-bg);
}

/* ============================================
   Layout Structure
   ============================================ */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Preload - Prevent transitions on page load
   ============================================ */

.preload,
.preload * {
    transition: none !important;
    animation: none !important;
}

/* ============================================
   Sidebar
   ============================================ */

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-dark) 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease;
    z-index: 1000;
    overflow: hidden;
}

.admin-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: var(--header-height);
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    color: #ffffff;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    margin-left: 12px;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-speed) ease;
}

.admin-sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 2px;
}

/* Nav Items */
.nav-item {
    margin: 2px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text-hover);
}

.nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-text-hover);
}

.nav-link .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

.nav-link .nav-text {
    margin-left: 12px;
    overflow: hidden;
    transition: opacity var(--transition-speed) ease;
}

.admin-sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
}

.nav-link .nav-arrow {
    margin-left: auto;
    width: 16px;
    height: 16px;
    transition: transform var(--transition-speed) ease;
}

.admin-sidebar.collapsed .nav-arrow {
    display: none;
}

.nav-item.open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

/* Dropdown Menu */
.nav-dropdown {
    display: none;
    padding-left: 20px;
    overflow: hidden;
}

.nav-item.open > .nav-dropdown {
    display: block;
}

.admin-sidebar.collapsed .nav-dropdown {
    display: none;
}

.nav-dropdown .nav-link {
    padding: 8px 12px;
    font-size: 0.8125rem;
}

.nav-dropdown .nav-link::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sidebar-text);
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-dropdown .nav-link:hover::before,
.nav-dropdown .nav-link.active::before {
    background: var(--primary);
}

/* Nav Separator */
.nav-separator {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 16px;
}

.nav-label {
    padding: 12px 16px 6px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.admin-sidebar.collapsed .nav-label {
    opacity: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 8px;
    flex-shrink: 0;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text-hover);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-speed) ease;
}

.admin-sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* ============================================
   Main Content Area
   ============================================ */

.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease;
}

.admin-sidebar.collapsed ~ .admin-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* ============================================
   Header
   ============================================ */

.admin-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-toggle {
    display: none;
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
}

.mobile-toggle:hover {
    background-color: var(--content-bg);
}

.mobile-toggle svg {
    width: 20px;
    height: 20px;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.user-menu-btn:hover {
    background-color: var(--content-bg);
    border-color: var(--text-muted);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-avatar.role-superadmin {
    background: #8b5cf6;
}

.user-avatar.role-admin {
    background: var(--primary);
}

.user-avatar.role-user {
    background: var(--success);
}

.user-info {
    text-align: left;
    line-height: 1.2;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.user-menu-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1050;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--content-bg);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-speed) ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: var(--content-bg);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger svg {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--card-border);
    margin: 4px 0;
}

/* ============================================
   Page Content
   ============================================ */

.page-content {
    flex: 1;
    padding: 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.page-header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin-right: 8px;
    color: var(--text-muted);
}

.page-header .breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.page-header .breadcrumb a:hover {
    color: var(--primary);
}

/* Page Actions */
.page-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ============================================
   Cards
   ============================================ */

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

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--content-bg);
}

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

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

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--card-border);
    background: var(--content-bg);
}

/* Stat Cards */
.stat-card {
    padding: 16px;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-card .stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card .stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-card .stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-detail {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.stat-detail .trend-up {
    color: var(--success);
}

.stat-detail .trend-down {
    color: var(--danger);
}

/* ============================================
   Tables
   ============================================ */

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--content-bg);
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    overflow-x: auto;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 4px;
}

.table-actions .btn {
    padding: 4px 8px;
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

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

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

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

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

.badge-secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
}

/* Solid badges */
.badge-solid-primary {
    background: var(--primary);
    color: #ffffff;
}

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

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

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

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

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

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

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

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

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

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

.btn-danger {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

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

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border-color: var(--card-border);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: var(--text-muted);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

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

/* ============================================
   Forms
   ============================================ */

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

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--content-bg);
    cursor: not-allowed;
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 0.8125rem;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
}

.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

/* Input Group */
.input-group {
    display: flex;
}

.input-group .form-control {
    flex: 1;
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.input-group .form-control:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.input-group .btn {
    border-radius: 0;
}

.input-group .btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--content-bg);
    border: 1px solid var(--card-border);
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-success {
    background: var(--success-light);
    color: #166534;
    border: 1px solid #86efac;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: var(--info-light);
    color: #075985;
    border: 1px solid #7dd3fc;
}

/* ============================================
   Modal
   ============================================ */

/* ============================================
   Bootstrap 5 Modal Support
   ============================================ */

/* Bootstrap modals - hidden by default */
.modal.fade {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    outline: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    visibility: hidden;
}

/* Bootstrap modals - shown state */
.modal.fade.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    visibility: visible;
    z-index: 1055;
}

/* Bootstrap modal backdrop - must not block modal content */
/* Using body > selector and !important to override Bootstrap */
body > .modal-backdrop {
    z-index: 1040 !important;
    pointer-events: none !important;
}

/* Modal content must be above backdrop and clickable */
.modal.fade.show .modal-dialog {
    z-index: 1060 !important;
    pointer-events: auto !important;
}

.modal.fade.show .modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 1 !important;
}

/* Bootstrap modal dialog */
.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem;
    pointer-events: none;
    max-width: 500px;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-lg {
    max-width: 800px;
}

/* Bootstrap modal content */
.modal-dialog .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    outline: 0;
}

/* Bootstrap modal blur effect */
.modal-blur {
    backdrop-filter: blur(4px);
}

/* ============================================
   Custom Modal Notification System
   ============================================ */

/* Custom notification backdrop (without .fade class) */
.modal-backdrop:not(.fade) {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-backdrop:not(.fade).show {
    display: flex;
}

/* Custom notification modal (not Bootstrap) */
.modal:not(.fade) {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    padding: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--content-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================
   Footer
   ============================================ */

.admin-footer {
    padding: 16px 20px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    background: var(--card-bg);
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.bg-primary { background-color: var(--primary-light) !important; }
.bg-success { background-color: var(--success-light) !important; }
.bg-warning { background-color: var(--warning-light) !important; }
.bg-danger { background-color: var(--danger-light) !important; }

.fw-bold { font-weight: 600; }
.fw-normal { font-weight: 400; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

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

.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }

.w-100 { width: 100%; }

.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 12px; }

/* ============================================
   Grid System (Simple)
   ============================================ */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.row > * {
    padding: 10px;
}

.g-3 {
    margin: -12px;
}

.g-3 > * {
    padding: 12px;
}

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Large devices (992px and up) */
@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }

    .d-lg-block { display: block !important; }
    .d-lg-none { display: none !important; }
}

/* Medium devices (768px and up) */
@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }

    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-none { display: none !important; }
}

/* Small devices (576px and up) */
@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Mobile (below 768px) */
@media (max-width: 767.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }

    .admin-sidebar.collapsed {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .admin-sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }

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

    .admin-sidebar.collapsed ~ .admin-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .mobile-overlay.show {
        display: block;
    }

    .page-content {
        padding: 12px;
    }

    .user-info {
        display: none;
    }

    .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu.show {
    animation: slideDown 0.15s ease-out;
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--content-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .admin-sidebar,
    .admin-header,
    .admin-footer,
    .mobile-overlay {
        display: none !important;
    }

    .admin-content {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   Modal Notification System
   ============================================ */

/* Modal Backdrop - covers entire screen (custom notification system only) */
.modal-backdrop:not(.fade).show {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1055;
    animation: fadeIn 0.15s ease-out;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Container */
.modal.modal-notification {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    margin: 0;
    animation: scaleIn 0.2s ease-out;
}

.modal.modal-notification .modal-body {
    padding: 32px 24px 16px;
    text-align: center;
}

.modal-notification-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-notification-icon svg {
    width: 32px;
    height: 32px;
}

.modal-icon-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.modal-icon-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.modal-icon-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.modal-icon-info {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.modal-icon-question {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.modal-notification-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-notification-message {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.modal.modal-notification .modal-footer {
    border-top: none;
    padding: 16px 24px 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.modal.modal-notification .modal-footer .btn {
    min-width: 100px;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

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

.modal.modal-notification .modal-footer .btn-primary:hover {
    background: #1d4ed8;
}

.modal.modal-notification .modal-footer .btn-danger {
    background: #ef4444;
    color: #fff;
}

.modal.modal-notification .modal-footer .btn-danger:hover {
    background: #dc2626;
}

.modal.modal-notification .modal-footer .btn-secondary {
    background: #e2e8f0;
    color: var(--text-primary);
}

.modal.modal-notification .modal-footer .btn-secondary:hover {
    background: #cbd5e1;
}

.modal.modal-notification .modal-footer .btn-success {
    background: #22c55e;
    color: #fff;
}

.modal.modal-notification .modal-footer .btn-success:hover {
    background: #16a34a;
}

/* Prompt Modal Input */
.modal-input-wrapper {
    margin-top: 16px;
}

.modal-input-wrapper input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: var(--text-primary);
}

.modal-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-input-wrapper input::placeholder {
    color: #9ca3af;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

.toast-notification.toast-success {
    border-left-color: #22c55e;
}

.toast-notification.toast-danger {
    border-left-color: #ef4444;
}

.toast-notification.toast-warning {
    border-left-color: #f59e0b;
}

.toast-notification.toast-info {
    border-left-color: #2563eb;
}

.toast-notification .toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-notification.toast-success .toast-icon {
    color: #22c55e;
}

.toast-notification.toast-danger .toast-icon {
    color: #ef4444;
}

.toast-notification.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-notification.toast-info .toast-icon {
    color: #2563eb;
}

.toast-notification .toast-message {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.toast-notification .toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.toast-notification .toast-close:hover {
    color: var(--text-primary);
}

.toast-notification .toast-close svg {
    width: 16px;
    height: 16px;
}

.toast-notification.toast-hiding {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile Toast Adjustments */
@media (max-width: 767.98px) {
    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast-notification {
        min-width: auto;
        max-width: none;
    }
}
