:root {
    --primary: #6610f2;
    --primary-dark: #3a0ca3;
    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    --header-height: 60px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: #f0f2f5;
    margin: 0;
}

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

.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

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

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-logo,
.site-brand-logo {
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    padding: 12px 16px 8px;
    font-weight: 600;
}

.admin-sidebar.collapsed .nav-section,
.admin-sidebar.collapsed .sidebar-brand span,
.admin-sidebar.collapsed .nav-link span,
.admin-sidebar.collapsed .btn-logout span { display: none; }

.admin-sidebar.collapsed .btn-logout {
    padding: 10px;
    justify-content: center;
}

.admin-sidebar.collapsed .sidebar-footer {
    padding: 16px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link i { font-size: 1.1rem; width: 22px; text-align: center; }

.nav-link:hover {
    background: rgba(102, 16, 242, 0.25);
    color: #fff;
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 16, 242, 0.4);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-logout {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-logout i {
    font-size: 1.1rem;
    line-height: 1;
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: #dc3545;
    color: #fff;
}

.nav-submenu .nav-link-parent {
    cursor: pointer;
}

.nav-submenu .submenu-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
    opacity: 0.7;
}

.nav-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.nav-submenu-items {
    display: none;
    padding-left: 12px;
    margin-bottom: 4px;
}

.nav-submenu.open .nav-submenu-items {
    display: block;
}

.nav-link-sub {
    padding: 9px 16px 9px 44px !important;
    font-size: 0.85rem !important;
}

.nav-link-sub i {
    font-size: 0.95rem !important;
}

.admin-sidebar.collapsed .nav-submenu-items,
.admin-sidebar.collapsed .submenu-arrow {
    display: none !important;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left 0.3s ease;
}

.admin-main.expanded { margin-left: var(--sidebar-collapsed); }

.admin-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

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

.header-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.page-heading-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #212529;
    line-height: 1.3;
}

.page-heading-subtitle {
    font-size: 0.875rem;
    margin-top: 4px;
}

.page-heading-actions .btn.btn-primary-admin {
    white-space: nowrap;
}

/* Data table card */
.data-table-card {
    overflow: hidden;
}

.data-table-toolbar {
    padding: 14px 20px;
    background: #f8f9fb;
    border-bottom: 1px solid #e9ecef;
}

.data-table-toolbar form.data-table-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.data-table-toolbar .filter-field {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 300px;
}

.data-table-toolbar .filter-field-sm {
    flex: 0 1 180px;
    max-width: 200px;
}

.data-table-toolbar .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
}

.data-table-toolbar .form-control,
.data-table-toolbar .form-select {
    border-radius: 8px;
    border-color: #dee2e6;
    font-size: 0.8125rem;
    padding: 7px 12px;
    height: 36px;
    background: #fff;
}

.data-table-toolbar .form-control:focus,
.data-table-toolbar .form-select:focus {
    border-color: #b8a4e8;
    box-shadow: 0 0 0 3px rgba(102, 16, 242, 0.08);
}

.data-table-toolbar .btn-filter {
    height: 36px;
    padding: 0 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.data-table-toolbar .btn-filter i {
    font-size: 0.85rem;
    opacity: 0.75;
}

.data-table-toolbar .btn-filter:hover {
    background: #faf8ff;
    border-color: #c9b8f0;
    color: var(--primary);
}

.data-table-toolbar .btn-filter:hover i {
    opacity: 1;
}

.data-table-toolbar .btn-filter:active {
    background: #f3effc;
}

.data-table-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.data-table-info strong {
    color: #212529;
    font-weight: 600;
}

.data-table-empty {
    text-align: center;
    padding: 48px 24px !important;
    color: #6c757d;
}

.data-table-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.4;
}

.table-admin {
    margin-bottom: 0;
}

.table-admin thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #495057;
    font-weight: 600;
    background: #f8f9fb;
    border-bottom: 2px solid #e9ecef;
    padding: 14px 16px;
    white-space: nowrap;
}

.table-admin tbody td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: #212529;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

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

.table-admin tbody tr:hover td {
    background: #f8f6ff;
}

.table-admin .btn-group-table {
    display: flex;
    gap: 4px;
}

.btn-table-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
}

.pagination-admin .pagination {
    gap: 2px;
}

.pagination-admin .page-link {
    color: #495057;
    border: 1px solid #e9ecef;
    margin: 0;
    border-radius: 8px !important;
    font-weight: 500;
    font-size: 0.8rem;
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    line-height: 1;
}

.pagination-admin .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 16, 242, 0.35);
}

.pagination-admin .page-link:hover {
    background: #f4efff;
    border-color: #d4c4f7;
    color: var(--primary);
}

.pagination-admin .page-item.disabled .page-link {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
}

.card-admin .card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 24px;
    font-weight: 600;
}

.card-admin .card-body { padding: 24px; }

.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-paid { background: #cce5ff; color: #004085; }
.badge-processing { background: #d4edda; color: #155724; }
.badge-completed { background: #d1e7dd; color: #0f5132; }
.badge-failed { background: #f8d7da; color: #842029; }
.badge-cancelled { background: #e2e3e5; color: #41464b; }

.btn-sidebar-toggle {
    background: #f8f9fa;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #495057;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #212529;
}

/* legacy - removed from header */

.avatar-badge {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.admin-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height));
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.card-admin {
    background: #fff;
    border-radius: 16px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.btn.btn-primary-admin {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    padding: 8px 20px;
    text-decoration: none;
}

.btn.btn-sm.btn-primary-admin {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 6px;
    font-weight: 600;
}

.btn.btn-primary-admin:hover,
.btn.btn-primary-admin:focus,
.btn.btn-primary-admin:active,
.btn.btn-primary-admin:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 16, 242, 0.35);
}

.btn.btn-primary-admin i {
    color: inherit;
}

.form-admin .form-control,
.form-admin .form-select {
    border-radius: 10px;
    padding: 10px 14px;
    border-color: #dee2e6;
}

.form-admin .form-control:focus,
.form-admin .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 16, 242, 0.15);
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #3a0ca3 0%, #f72585 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand h2 {
    font-weight: 700;
    color: var(--primary);
    margin-top: 12px;
}

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

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

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