/* ==========================================================================
   Regenera Luxury Awards — Admin Panel Design System
   Brand-aligned, accessible, responsive, dark-mode ready
   ========================================================================== */

/* ---------- 1. CSS Custom Properties ---------- */
:root {
    /* Brand Palette */
    --admin-emerald: #0f2a24;
    --admin-emerald-light: #184036;
    --admin-emerald-mid: #215145;
    --admin-gold: #c5a37d;
    --admin-gold-light: #d4b896;
    --admin-gold-muted: rgba(197, 163, 125, .15);
    --admin-cream: #f9f7f2;
    --admin-dark: #0a1a17;
    --admin-text: #17342f;
    --admin-text-muted: rgba(23, 52, 47, .62);
    --admin-text-secondary: rgba(23, 52, 47, .78);
    --admin-border: rgba(15, 42, 36, .10);
    --admin-border-strong: rgba(15, 42, 36, .20);

    /* Layout */
    --sidebar-w: 272px;
    --sidebar-w-mini: 76px;
    --topbar-h: 64px;

    /* Surfaces */
    --surface-primary: #ffffff;
    --surface-secondary: #f9f7f2;
    --surface-elevated: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 42, 36, .06);
    --shadow-md: 0 4px 16px rgba(15, 42, 36, .08);
    --shadow-lg: 0 12px 40px rgba(15, 42, 36, .10);
    --shadow-xl: 0 20px 60px rgba(15, 42, 36, .12);

    /* Radius */
    --radius-sm: .5rem;
    --radius-md: .75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-pill: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(.2, 0, 0, 1);
    --duration-fast: .15s;
    --duration-normal: .25s;
    --duration-slow: .4s;
}

/* ---------- 2. Dark Mode ---------- */
.admin-dark {
    --admin-emerald: #0d231e;
    --admin-cream: #111b18;
    --admin-text: #e2e8e6;
    --admin-text-muted: rgba(226, 232, 230, .55);
    --admin-border: rgba(197, 163, 125, .12);
    --admin-border-strong: rgba(197, 163, 125, .22);
    --surface-primary: #162420;
    --surface-secondary: #111b18;
    --surface-elevated: #1a2e28;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .40);
}

/* ---------- 3. Base Admin Body ---------- */
.admin-body {
    background: var(--surface-secondary);
    color: var(--admin-text);
    overflow-x: hidden;
}

/* ---------- 4. Admin Layout Grid ---------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--duration-slow) var(--ease-out);
}

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

/* ---------- 5. Sidebar ---------- */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0f2a24 0%, #0a1f1a 100%);
    border-right: 1px solid rgba(197, 163, 125, .12);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
    overflow: hidden;
}

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

/* Sidebar Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(197, 163, 125, .1);
    min-height: 64px;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--admin-gold-muted);
    border: 1px solid rgba(197, 163, 125, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-gold);
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: calc(var(--radius-md) - 2px);
}

.sidebar-logo-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar-collapsed .sidebar-logo-text {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .75rem .625rem;
}

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

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(197, 163, 125, .2);
    border-radius: 10px;
}

.sidebar-section-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .35);
    padding: 1rem .75rem .5rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar-collapsed .sidebar-section-label {
    opacity: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem .75rem;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
    text-decoration: none;
    transition: all var(--duration-fast) ease;
    white-space: nowrap;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(197, 163, 125, .2), rgba(197, 163, 125, .1));
    color: var(--admin-gold-light);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--admin-gold);
    border-radius: 0 3px 3px 0;
}

.sidebar-link-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    opacity: .85;
}

.sidebar-link.active .sidebar-link-icon {
    opacity: 1;
    color: var(--admin-gold);
}

.sidebar-link-label {
    opacity: 1;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar-collapsed .sidebar-link-label {
    opacity: 0;
    pointer-events: none;
}

.sidebar-link-badge {
    margin-left: auto;
    background: var(--admin-gold);
    color: var(--admin-emerald);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar-collapsed .sidebar-link-badge {
    opacity: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: .75rem .625rem;
    border-top: 1px solid rgba(197, 163, 125, .1);
}

/* Sidebar Collapse Button */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    width: 100%;
    padding: .5rem;
    border-radius: var(--radius-md);
    border: none;
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .5);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .8);
}

.sidebar-collapse-btn .collapse-text {
    font-size: 11px;
    font-weight: 500;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar-collapsed .sidebar-collapse-btn .collapse-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-collapse-btn i {
    transition: transform var(--duration-slow) var(--ease-out);
}

.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* Sidebar Tooltip (collapsed mode) */
.sidebar-collapsed .sidebar-link {
    position: relative;
}

.sidebar-collapsed .sidebar-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) scale(.9);
    background: var(--admin-emerald);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--duration-fast) ease;
    z-index: 200;
    border: 1px solid rgba(197, 163, 125, .2);
}

.sidebar-collapsed .sidebar-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* ---------- 6. Topbar ---------- */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: var(--topbar-h);
    background: var(--surface-primary);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.admin-dark .admin-topbar {
    background: var(--surface-elevated);
}

.topbar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--admin-text);
    font-size: 18px;
    cursor: pointer;
    transition: background var(--duration-fast) ease;
}

.topbar-hamburger:hover {
    background: var(--admin-gold-muted);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: 13px;
    color: var(--admin-text-muted);
}

.topbar-breadcrumb a {
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

.topbar-breadcrumb a:hover {
    color: var(--admin-gold);
}

.topbar-breadcrumb .separator {
    font-size: 10px;
    opacity: .5;
}

.topbar-breadcrumb .current {
    color: var(--admin-text);
    font-weight: 600;
}

.topbar-spacer {
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--admin-border);
    background: transparent;
    color: var(--admin-text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    position: relative;
}

.topbar-btn:hover {
    background: var(--admin-gold-muted);
    color: var(--admin-gold);
    border-color: rgba(197, 163, 125, .3);
}

.topbar-btn .badge-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--surface-primary);
}

/* Profile Dropdown */
.topbar-profile {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .375rem .625rem .375rem .375rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--admin-border);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    position: relative;
    background: transparent;
    color: var(--admin-text);
    font-size: 13px;
}

.topbar-profile:hover {
    background: var(--admin-gold-muted);
    border-color: rgba(197, 163, 125, .25);
}

.topbar-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--admin-emerald), var(--admin-emerald-mid));
    color: var(--admin-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.topbar-profile-name {
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-profile-role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--admin-text-muted);
    font-weight: 600;
}

/* Dropdown menus */
.topbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--surface-primary);
    border: 1px solid var(--admin-border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: .375rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(.97);
    transition: all var(--duration-normal) var(--ease-out);
    z-index: 200;
}

.topbar-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--admin-text);
    font-size: 13px;
    text-decoration: none;
    transition: background var(--duration-fast) ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.topbar-dropdown-item:hover {
    background: var(--admin-gold-muted);
}

.topbar-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--admin-text-muted);
}

.topbar-dropdown-divider {
    height: 1px;
    background: var(--admin-border);
    margin: .25rem 0;
}

/* ---------- 7. Content Area ---------- */
.admin-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 100%;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--admin-text);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 13px;
    color: var(--admin-text-muted);
    margin-top: .25rem;
}

/* ---------- 8. Cards ---------- */
.admin-card {
    background: var(--surface-primary);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) ease;
}

.admin-card:hover {
    box-shadow: var(--shadow-md);
}

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

.admin-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--admin-text);
    letter-spacing: -.01em;
}

.admin-card-body {
    padding: 1.5rem;
}

.admin-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

/* Stat Cards */
.stat-card {
    background: var(--surface-primary);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(197, 163, 125, .25);
    transform: translateY(-2px);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--admin-gold), var(--admin-gold-light));
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--admin-gold-muted);
    color: var(--admin-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: .75rem;
}

.stat-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--admin-text-muted);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1.15;
    margin-top: .25rem;
}

.stat-card-detail {
    font-size: 12px;
    color: var(--admin-text-muted);
    margin-top: .375rem;
}

/* ---------- 9. Tables ---------- */
.admin-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--admin-border);
    background: var(--surface-primary);
}

.admin-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--admin-emerald);
}

.admin-table thead th {
    padding: .875rem 1rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(248, 234, 216, .9);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: none;
}

.admin-dark .admin-table thead {
    background: #07120f;
}

.admin-table thead th:first-child {
    border-radius: var(--radius-xl) 0 0 0;
}

.admin-table thead th:last-child {
    border-radius: 0 var(--radius-xl) 0 0;
}

.admin-table tbody tr {
    border-bottom: 1px solid var(--admin-border);
    transition: background var(--duration-fast) ease;
}

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

.admin-table tbody tr:hover {
    background: rgba(197, 163, 125, .04);
}

.admin-table tbody td {
    padding: .75rem 1rem;
    font-size: 13px;
    color: var(--admin-text);
    vertical-align: middle;
}

.admin-table .cell-muted {
    color: var(--admin-text-muted);
    font-size: 12px;
}

.admin-table .cell-bold {
    font-weight: 600;
}

/* Sortable columns */
.admin-table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.admin-table th[data-sort]:hover {
    color: var(--admin-gold);
}

.admin-table th[data-sort]::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 6px;
    font-size: 9px;
    opacity: .4;
}

.admin-table th[data-sort].sort-asc::after {
    content: '\f0de';
    opacity: .9;
}

.admin-table th[data-sort].sort-desc::after {
    content: '\f0dd';
    opacity: .9;
}

/* ---------- 10. Status Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .625rem;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-approved {
    background: #d1fae5;
    color: #065f46;
}

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

.badge-succeeded {
    background: #d1fae5;
    color: #065f46;
}

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

/* ---------- 11. Invoice Detail Styles ---------- */
.invoice-detail-card {
    max-width: 100%;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}

.invoice-logo-block {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.invoice-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.invoice-header .text-muted {
    color: var(--admin-text-muted);
    margin-top: .35rem;
}

.invoice-status-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
}

.invoice-source-label {
    color: var(--admin-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.invoice-card-block {
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    background: var(--surface-secondary);
}

.invoice-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--admin-text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

.invoice-card-value {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.invoice-large-value {
    font-size: 1.65rem;
    color: var(--admin-emerald);
}

.invoice-highlights {
    background: linear-gradient(180deg, rgba(197, 163, 125, .08), transparent);
}

.invoice-card-note {
    font-size: 13px;
    color: var(--admin-text-muted);
    line-height: 1.6;
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.invoice-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--admin-text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

.invoice-token {
    word-break: break-all;
    background: var(--surface-primary);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
    padding: .85rem 1rem;
}

.invoice-notes {
    border-top: 1px solid var(--admin-border);
    padding-top: 1.25rem;
}

.invoice-notes p {
    margin: 0;
    color: var(--admin-text-secondary);
    line-height: 1.75;
}

.badge-cancelled {
    background: #fef3c7;
    color: #92400e;
}

.badge-started {
    background: #dbeafe;
    color: #1e40af;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-shortlisted {
    background: #d1fae5;
    color: #065f46;
}

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

.badge-winner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border: 1px solid rgba(252, 211, 77, .4);
}

.badge-reserve {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gold {
    background: var(--admin-gold-muted);
    color: #92400e;
}

.badge-draft {
    background: #f1f5f9;
    color: #475569;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Badge with dot */
.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ---------- 11. Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    padding: .625rem 1.25rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--duration-normal) var(--ease-out);
    font-family: inherit;
    line-height: 1.2;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--admin-emerald);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 42, 36, .25);
}

.btn-primary:hover {
    background: var(--admin-emerald-light);
    box-shadow: 0 6px 20px rgba(15, 42, 36, .3);
}

.btn-gold {
    background: var(--admin-gold);
    color: var(--admin-emerald);
    box-shadow: 0 4px 14px rgba(197, 163, 125, .3);
}

.btn-gold:hover {
    background: var(--admin-gold-light);
}

.btn-outline {
    background: transparent;
    color: var(--admin-text);
    border: 1px solid var(--admin-border-strong);
}

.btn-outline:hover {
    background: var(--admin-gold-muted);
    border-color: rgba(197, 163, 125, .3);
    color: var(--admin-gold);
}

.btn-danger {
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, .3);
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: rgba(220, 38, 38, .5);
}

.btn-sm {
    padding: .375rem .875rem;
    font-size: 10px;
    letter-spacing: .1em;
}

.btn-xs {
    padding: .25rem .625rem;
    font-size: 9px;
    letter-spacing: .08em;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ---------- 12. Forms ---------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}

.form-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--admin-text);
}

.form-control {
    width: 100%;
    padding: .625rem .875rem;
    border: 1px solid var(--admin-border-strong);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    color: var(--admin-text);
    background: var(--surface-primary);
    transition: all var(--duration-fast) ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--admin-gold);
    box-shadow: 0 0 0 3px rgba(197, 163, 125, .15);
}

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

.form-hint {
    font-size: 11px;
    color: var(--admin-text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    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='%2317342f' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right .75rem center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 2.5rem;
}

.form-section {
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.form-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--admin-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.form-section-title i {
    color: var(--admin-gold);
    font-size: 14px;
}

/* Checkbox custom */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: 13px;
    color: var(--admin-text);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--admin-border-strong);
    border-radius: .3rem;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    position: relative;
}

.form-check input[type="checkbox"]:checked {
    background: var(--admin-gold);
    border-color: var(--admin-gold);
}

.form-check input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: var(--admin-emerald);
}

.form-check input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(197, 163, 125, .2);
}

/* ---------- 13. Alerts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: alertSlideIn .3s var(--ease-out);
    position: relative;
}

.alert-icon {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    opacity: .5;
    transition: opacity var(--duration-fast) ease;
    color: inherit;
}

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

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 14. Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .875rem 0;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 12px;
    color: var(--admin-text-muted);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: .375rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .375rem .75rem;
    border: 1px solid var(--admin-border-strong);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text);
    background: var(--surface-primary);
    text-decoration: none;
    transition: all var(--duration-fast) ease;
}

.pagination-btn:hover {
    background: var(--admin-gold-muted);
    border-color: rgba(197, 163, 125, .3);
    color: var(--admin-gold);
}

.pagination-btn.active {
    background: var(--admin-gold);
    color: var(--admin-emerald);
    border-color: var(--admin-gold);
}

/* ---------- 15. Filter Bar ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
    padding: 1rem 1.5rem;
    background: var(--surface-primary);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-xl);
    margin-bottom: 1rem;
}

.filter-bar .form-group {
    flex: 1;
    min-width: 140px;
}

.filter-bar .form-control {
    font-size: 12px;
    padding: .5rem .75rem;
}

/* ---------- 16. Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--admin-text-muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    color: var(--admin-border-strong);
    margin-bottom: .75rem;
}

.empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--admin-text);
    margin-bottom: .25rem;
}

.empty-state-text {
    font-size: 13px;
}

/* ---------- 17. Admin Footer ---------- */
.admin-footer {
    margin-top: auto;
    border-top: 1px solid var(--admin-border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--admin-text-muted);
    background: var(--surface-primary);
}

/* ---------- 18. Mobile Overlay ---------- */
.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 26, 23, .6);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.admin-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ---------- 19. Quick-Action Grid ---------- */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text);
    background: var(--surface-primary);
    border: 1px solid var(--admin-border-strong);
    text-decoration: none;
    transition: all var(--duration-fast) ease;
}

.quick-action-btn:hover {
    background: var(--admin-gold-muted);
    border-color: rgba(197, 163, 125, .3);
    color: var(--admin-gold);
    transform: translateY(-1px);
}

.quick-action-btn i {
    font-size: 13px;
}

/* ---------- 20. Dashboard Hero ---------- */
.dashboard-hero {
    background: linear-gradient(135deg, var(--admin-emerald) 0%, var(--admin-emerald-light) 50%, var(--admin-emerald-mid) 100%);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(197, 163, 125, .15);
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(197, 163, 125, .12) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--admin-gold);
    margin-bottom: .75rem;
}

.dashboard-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: .5rem;
    position: relative;
}

.dashboard-hero-text {
    color: rgba(255, 255, 255, .75);
    font-size: 14px;
    position: relative;
}

/* ---------- 21. Login Page ---------- */
.login-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 500px at 20% 10%, rgba(197, 163, 125, .1), transparent 50%),
        radial-gradient(800px 400px at 80% 90%, rgba(15, 42, 36, .08), transparent 50%),
        var(--admin-cream);
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--admin-border);
}

.login-brand {
    background: linear-gradient(135deg, var(--admin-emerald) 0%, var(--admin-emerald-light) 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -40%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(197, 163, 125, .1) 0%, transparent 70%);
}

.login-form-side {
    background: var(--surface-primary);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ---------- 22. Responsive ---------- */
.admin-grid-responsive {
    display: grid;
}

@media (max-width: 1024px) {
    .admin-grid-responsive {
        grid-template-columns: 1fr !important;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 110;
    }

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

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

    .topbar-hamburger {
        display: flex;
    }

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

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .dashboard-hero {
        padding: 1.5rem;
    }

    .dashboard-hero-title {
        font-size: 1.75rem;
    }

    .topbar-profile-name,
    .topbar-profile-role {
        display: none;
    }

    .filter-bar {
        padding: .75rem 1rem;
    }
}

@media (max-width: 640px) {
    .login-card {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .login-brand {
        display: none;
    }

    .admin-content {
        padding: .75rem;
    }

    .admin-card-body {
        padding: 1rem;
    }
}

/* ---------- 23. Print Styles ---------- */
@media print {

    .admin-sidebar,
    .admin-topbar,
    .admin-footer,
    .admin-overlay,
    .sidebar-collapse-btn,
    .topbar-hamburger,
    .btn,
    form {
        display: none !important;
    }

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

    .admin-content {
        padding: 0 !important;
    }

    .admin-table thead {
        background: #f3f4f6 !important;
        color: #111 !important;
    }
}

/* ---------- 24. Animations & Micro-interactions ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-in {
    animation: fadeInUp .4s var(--ease-out) both;
}

.animate-delay-1 {
    animation-delay: .05s;
}

.animate-delay-2 {
    animation-delay: .1s;
}

.animate-delay-3 {
    animation-delay: .15s;
}

.animate-delay-4 {
    animation-delay: .2s;
}

.skeleton {
    background: linear-gradient(90deg, var(--admin-border) 25%, rgba(197, 163, 125, .08) 50%, var(--admin-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Row action fade on hover */
.admin-table tbody tr .row-actions {
    opacity: .5;
    transition: opacity var(--duration-fast) ease;
}

.admin-table tbody tr:hover .row-actions {
    opacity: 1;
}

/* Focus-visible ring for keyboard nav */
*:focus-visible {
    outline: 2px solid var(--admin-gold);
    outline-offset: 2px;
}

/* Scrollbar styling for content area */
.admin-content::-webkit-scrollbar {
    width: 6px;
}

.admin-content::-webkit-scrollbar-track {
    background: transparent;
}

.admin-content::-webkit-scrollbar-thumb {
    background: var(--admin-border-strong);
    border-radius: 10px;
}

/* ---------- 25. Utility Helpers ---------- */
.text-gold {
    color: var(--admin-gold) !important;
}

.text-muted {
    color: var(--admin-text-muted) !important;
}

.bg-gold-muted {
    background: var(--admin-gold-muted) !important;
}

.border-gold {
    border-color: rgba(197, 163, 125, .3) !important;
}

/* Grid helpers */
.admin-grid {
    display: grid;
    gap: 1rem;
}

.admin-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.admin-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.admin-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .admin-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .admin-grid-4,
    .admin-grid-3,
    .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* --- Invoice Print Styles (A4, B/W, Professional) --- */
@media print {

    body,
    html {
        background: #fff !important;
        color: #111 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-family: 'Inter', Arial, sans-serif !important;
    }

    .admin-card,
    .invoice-detail-card,
    .admin-card-body {
        background: #fff !important;
        box-shadow: none !important;
        border: none !important;
    }

    .page-header,
    .page-header-top,
    .btn,
    .admin-card-header,
    .pagination,
    .admin-card-footer,
    .sidebar-logo,
    .sidebar,
    .sidebar-nav,
    .sidebar-footer,
    .admin-topbar,
    .sidebar-link,
    .sidebar-link-label,
    .sidebar-link-icon,
    .sidebar-link-badge,
    .sidebar-section-label,
    .sidebar-collapse-btn,
    .topbar-breadcrumb,
    .topbar-btn,
    .topbar-profile,
    .topbar-dropdown {
        display: none !important;
    }

    .invoice-detail-card {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        page-break-after: always;
    }

    .invoice-header {
        margin-top: 2.5cm !important;
        margin-bottom: 1.5cm !important;
        border-bottom: 2px solid #111 !important;
        padding-bottom: 1.2cm !important;
        align-items: flex-end !important;
    }

    .invoice-logo-block {
        width: 80px !important;
        height: 80px !important;
        margin-right: 2.5cm !important;
        background: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .invoice-logo {
        width: 80px !important;
        height: 80px !important;
        object-fit: contain !important;
        filter: none !important;
    }

    .invoice-header h2 {
        font-size: 2.2rem !important;
        font-weight: 700 !important;
        color: #111 !important;
        margin: 0 0 0.2cm 0 !important;
    }

    .invoice-header .text-muted {
        color: #444 !important;
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    .invoice-status-block {
        align-items: flex-end !important;
        gap: 0.5rem !important;
    }

    .invoice-status-label {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #111 !important;
        background: none !important;
        border: 2px solid #111 !important;
        border-radius: 6px !important;
        padding: 0.2cm 0.7cm !important;
        display: inline-block !important;
        margin-bottom: 0.2cm !important;
    }

    .invoice-source-label {
        color: #444 !important;
        font-size: 1rem !important;
        text-transform: uppercase !important;
        letter-spacing: .08em !important;
    }

    .invoice-meta-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 1.2cm !important;
        margin: 2cm 0 1.2cm 0 !important;
    }

    .invoice-card-block {
        border: none !important;
        background: none !important;
        padding: 0 !important;
    }

    .invoice-card-title {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #111 !important;
        margin-bottom: 0.2cm !important;
        text-transform: uppercase !important;
        letter-spacing: .08em !important;
    }

    .invoice-card-value {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        color: #111 !important;
        margin-bottom: 0.2cm !important;
    }

    .invoice-large-value {
        font-size: 2.1rem !important;
        color: #111 !important;
        font-weight: 900 !important;
        margin-bottom: 0.2cm !important;
    }

    .invoice-card-note {
        font-size: 1rem !important;
        color: #444 !important;
        margin-bottom: 0.15cm !important;
    }

    .invoice-details-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1.2cm !important;
        margin-bottom: 1.2cm !important;
    }

    .invoice-section-title {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #111 !important;
        margin-bottom: 0.2cm !important;
        text-transform: uppercase !important;
        letter-spacing: .08em !important;
    }

    .invoice-token {
        word-break: break-all !important;
        background: none !important;
        border: 1px solid #111 !important;
        border-radius: 6px !important;
        padding: 0.7cm 1cm !important;
        color: #111 !important;
        font-size: 1.1rem !important;
    }

    .invoice-notes {
        border-top: 1px solid #111 !important;
        padding-top: 1.2cm !important;
        margin-top: 1.2cm !important;
    }

    .invoice-notes p {
        color: #222 !important;
        font-size: 1.1rem !important;
        line-height: 1.7 !important;
    }
}