/* ======================================
   PlaybookNew — Dark Admin Theme
   Bootstrap 5 + Custom Dark Design
   Inspired by Sentinel/Cybersecurity aesthetic
   ====================================== */

/* ── Fonts ── */
@import url('https://fonts.bunny.net/css?family=inter:300,400,500,600,700|jetbrains-mono:400,500,600&display=swap');

:root {
    --pb-bg: #0c0c0c;
    --pb-bg-sidebar: #0a0a0a;
    --pb-bg-main: #101012;
    --pb-bg-card: rgba(255, 255, 255, 0.025);
    --pb-bg-hover: rgba(255, 255, 255, 0.04);
    --pb-bg-input: rgba(255, 255, 255, 0.03);
    --pb-text: #ffffff;
    --pb-text-muted: rgba(255, 255, 255, 0.6);
    --pb-text-dim: rgba(255, 255, 255, 0.4);
    --pb-text-faint: rgba(255, 255, 255, 0.3);
    --pb-border: rgba(255, 255, 255, 0.06);
    --pb-border-hover: rgba(255, 255, 255, 0.12);
    --pb-accent: #67e8f9;
    --pb-accent-dim: rgba(103, 232, 249, 0.08);
    --pb-accent-border: rgba(103, 232, 249, 0.12);
    --pb-success: #34d399;
    --pb-danger: #f87171;
    --pb-warning: #fbbf24;
    --pb-info: #67e8f9;
    --pb-sidebar-width: 260px;
    --pb-sidebar-collapsed: 70px;
    --pb-header-height: 56px;
    --pb-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --pb-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
    font-family: var(--pb-font-sans);
}

.font-mono {
    font-family: var(--pb-font-mono) !important;
}

/* ── Body ── */
body {
    background-color: var(--pb-bg) !important;
    color: var(--pb-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dot grid background */
.sentinel-grid {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--pb-sidebar-width);
    background-color: var(--pb-bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

/* ── Sidebar Logo ── */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    height: var(--pb-header-height);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-logo:hover .logo-icon {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    transform: scale(1.05);
}

.sidebar-logo .logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.sidebar-logo .logo-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.3s ease;
}

/* ── Collapse Toggle Button ── */
.sidebar-collapse-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

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

.sidebar-collapse-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

/* ── Expand Button (collapsed footer) ── */
.sidebar-expand-btn {
    display: none;
    width: 100%;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.sidebar-expand-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: white;
}

.sidebar-expand-btn i {
    font-size: 1rem;
}

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

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pb-text-dim);
    padding: 16px 12px 6px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2px;
    position: relative;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link .link-text {
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, width 0.3s ease;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--pb-text);
    transform: translateX(2px);
    border-color: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--pb-text);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px rgba(103, 232, 249, 0.05);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, var(--pb-accent), #818cf8);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(103, 232, 249, 0.3);
}

.sidebar-link svg,
.sidebar-link i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.sidebar-link:hover svg,
.sidebar-link:hover i {
    opacity: 0.8;
}

.sidebar-link.active svg,
.sidebar-link.active i {
    opacity: 1;
    color: var(--pb-accent);
}

/* ── Sidebar Footer ── */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.01);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6rem;
    color: var(--pb-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--pb-font-mono);
    white-space: nowrap;
}

/* ══════════════════════════════════════
   COLLAPSED SIDEBAR STATE
   ══════════════════════════════════════ */
.sidebar.collapsed {
    width: var(--pb-sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .link-text,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-collapse-btn {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

.sidebar.collapsed .sidebar-logo {
    padding: 16px 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-nav {
    padding: 8px 8px;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.sidebar.collapsed .sidebar-link:hover {
    transform: none;
}

.sidebar.collapsed .sidebar-link.active::before {
    left: -8px;
}

.sidebar.collapsed .sidebar-section-title {
    height: 0;
    padding: 0;
    margin: 8px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.sidebar.collapsed .sidebar-expand-btn {
    display: flex;
}

.sidebar.collapsed .sidebar-user-link {
    justify-content: center;
    padding: 8px;
}

/* ── Hover-to-expand (collapsed) ── */
.sidebar.collapsed.hovered {
    width: var(--pb-sidebar-width);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
}

.sidebar.collapsed.hovered .logo-text,
.sidebar.collapsed.hovered .link-text,
.sidebar.collapsed.hovered .sidebar-section-title,
.sidebar.collapsed.hovered .sidebar-collapse-btn {
    opacity: 1;
    width: auto;
    pointer-events: auto;
}

.sidebar.collapsed.hovered .sidebar-logo {
    padding: 16px 20px;
    justify-content: flex-start;
}

.sidebar.collapsed.hovered .sidebar-nav {
    padding: 8px 12px;
}

.sidebar.collapsed.hovered .sidebar-link {
    justify-content: flex-start;
    padding: 9px 12px;
    gap: 10px;
}

.sidebar.collapsed.hovered .sidebar-link:hover {
    transform: translateX(2px);
}

.sidebar.collapsed.hovered .sidebar-link.active::before {
    left: -12px;
}

.sidebar.collapsed.hovered .sidebar-section-title {
    height: auto;
    padding: 16px 12px 6px;
    margin: 0;
    border-bottom: none;
}

.sidebar.collapsed.hovered .sidebar-footer {
    padding: 12px;
}

.sidebar.collapsed.hovered .sidebar-expand-btn {
    display: none;
}

.sidebar.collapsed.hovered .sidebar-user-link {
    justify-content: flex-start;
    padding: 9px 12px;
}

/* ── Main Content ── */
.main-content {
    margin-left: var(--pb-sidebar-width);
    min-height: 100vh;
    background-color: var(--pb-bg-main);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--pb-sidebar-collapsed);
}

/* ── Top Header ── */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--pb-header-height);
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.2);
    overflow: visible;
}

.top-header .user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(103, 232, 249, 0.15), rgba(129, 140, 248, 0.15));
    border: 1px solid rgba(103, 232, 249, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--pb-font-mono);
    color: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.user-avatar:hover {
    border-color: rgba(103, 232, 249, 0.2);
    box-shadow: 0 0 8px rgba(103, 232, 249, 0.1);
}

.user-info {
    text-align: left;
}

.user-info .user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    line-height: 1.2;
}

.user-info .user-role {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--pb-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--pb-font-mono);
}

/* ── Page Content ── */
.page-content {
    padding: 24px;
}

/* ── Cards ── */
.card-dark {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.card-dark:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.card-dark .card-header {
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--pb-text);
}

.card-dark .card-body {
    padding: 20px;
}

/* ── Stat Cards ── */
.stat-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.08);
}

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

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.05);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--pb-font-mono);
    color: white;
    line-height: 1;
    margin-top: 12px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--pb-text-dim);
    margin-top: 4px;
}

/* ── Tables ── */
.table-dark-custom {
    width: 100%;
    color: var(--pb-text-muted);
    border-collapse: separate;
    border-spacing: 0;
}

.table-dark-custom thead th {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--pb-border);
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pb-text-dim);
    white-space: nowrap;
}

.table-dark-custom tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.875rem;
    vertical-align: middle;
    transition: background-color 0.15s ease;
}

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

.table-dark-custom tbody tr:hover td {
    color: var(--pb-text);
}

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

.table-dark-custom tbody tr.history-detail-row,
.table-dark-custom tbody tr.history-detail-row:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-dark-custom tbody tr.history-detail-row:hover > td {
    color: rgba(255, 255, 255, 0.75);
}

.salary-breakdown-table {
    width: 100%;
    color: rgba(255, 255, 255, 0.75);
    border-collapse: collapse;
}

.salary-breakdown-table td {
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.75);
    background: transparent !important;
    border: none;
    vertical-align: middle;
}

.salary-breakdown-table tr:hover td {
    color: rgba(255, 255, 255, 0.75);
    background: transparent !important;
}

.salary-breakdown-table tr.summary-row td {
    color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

.salary-breakdown-table tr.summary-row:hover td {
    color: rgba(255, 255, 255, 0.9);
}

.salary-breakdown-table .text-danger {
    color: var(--pb-danger) !important;
}

/* ── Forms ── */
.form-control-dark {
    background-color: var(--pb-bg-input) !important;
    border: 1px solid var(--pb-border) !important;
    border-radius: 8px !important;
    color: white !important;
    font-size: 0.875rem;
    padding: 10px 14px;
    transition: border-color 0.15s ease;
}

.form-control-dark::placeholder {
    color: var(--pb-text-faint);
}

.form-control-dark:focus {
    border-color: rgba(103, 232, 249, 0.2) !important;
    box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.06) !important;
    outline: none;
}

/* ── Native Select (hidden fallback) ── */
.form-select-dark {
    background-color: var(--pb-bg-input) !important;
    border: 1px solid var(--pb-border) !important;
    border-radius: 8px !important;
    color: white !important;
    font-size: 0.875rem;
    padding: 10px 14px;
}

.form-select-dark:focus {
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
}

.form-select-dark option {
    background-color: #1a1a1a;
    color: white;
}

/* ── Custom Searchable Dropdown ── */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    min-height: 42px;
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.custom-select.open .custom-select-trigger {
    border-color: rgba(103, 232, 249, 0.2);
    box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.06);
}

.custom-select-trigger .cs-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.custom-select-trigger .cs-placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.custom-select-trigger .cs-chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger .cs-chevron {
    transform: rotate(180deg);
}

/* Dropdown Panel — uses fixed positioning to escape overflow/stacking contexts */
.custom-select-dropdown {
    display: none;
    position: fixed;
    background-color: rgba(15, 15, 15, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    padding: 4px;
    max-height: 260px;
    overflow: hidden;
}

/* When dropdown is open, it's appended to body and shown via JS */

/* Search inside dropdown */
.custom-select-search {
    padding: 6px 8px;
    margin-bottom: 2px;
}

.custom-select-search input {
    width: 100%;
    padding: 7px 10px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.custom-select-search input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.custom-select-search input:focus {
    border-color: rgba(103, 232, 249, 0.2);
}

/* Options list */
.custom-select-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.custom-select-options::-webkit-scrollbar {
    width: 4px;
}
.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.custom-select-option {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-select-option:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: white;
}

.custom-select-option.selected {
    background-color: rgba(103, 232, 249, 0.08);
    color: var(--pb-accent);
}

.custom-select-option.selected::after {
    content: '\F272';
    font-family: 'bootstrap-icons';
    font-size: 0.75rem;
    color: var(--pb-accent);
}

.custom-select-option.hidden {
    display: none;
}

.custom-select-empty {
    padding: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.8rem;
    display: none;
}

.custom-select-empty.visible {
    display: block;
}

/* Alpine-teleported dropdown: baseline is block so x-show can toggle it correctly */
.custom-select-dropdown.cs-body-drop {
    display: block;
}


.form-label-dark {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.form-check-input-dark {
    background-color: var(--pb-bg-input);
    border-color: var(--pb-border);
}

.form-check-input-dark:checked {
    background-color: var(--pb-accent);
    border-color: var(--pb-accent);
}

/* ── Buttons ── */
.btn-primary-dark {
    background-color: white;
    color: #0a0a0a;
    border: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.08);
}

.btn-primary-dark:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #0a0a0a;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.btn-secondary-dark {
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--pb-border);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary-dark:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--pb-border-hover);
    transform: translateY(-1px);
}

.btn-danger-dark {
    background-color: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.btn-danger-dark:hover {
    background-color: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
}

.btn-success-dark {
    background-color: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
}

.btn-success-dark:hover {
    background-color: rgba(52, 211, 153, 0.2);
    color: #6ee7b7;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ── Badges ── */
.badge-dark {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.badge-success {
    background-color: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-danger {
    background-color: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-warning {
    background-color: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-info {
    background-color: rgba(103, 232, 249, 0.1);
    color: #67e8f9;
    border: 1px solid rgba(103, 232, 249, 0.2);
}

.badge-primary {
    background-color: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ── Modal ── */
.modal-dark .modal-content {
    background-color: rgba(17, 17, 17, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: white;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-dark .modal-header {
    border-bottom: 1px solid var(--pb-border);
    padding: 16px 24px;
}

.modal-dark .modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-dark .modal-body {
    padding: 24px;
}

.modal-dark .modal-footer {
    border-top: 1px solid var(--pb-border);
    padding: 16px 24px;
}

.modal-dark .btn-close {
    filter: invert(1);
    opacity: 0.5;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px);
}

/* ── Pagination ── */
.pagination-dark .page-item .page-link {
    background-color: transparent;
    border: 1px solid var(--pb-border);
    color: var(--pb-text-muted);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.15s ease;
}

.pagination-dark .page-item .page-link:hover {
    background-color: var(--pb-bg-hover);
    color: white;
    border-color: var(--pb-border-hover);
}

.pagination-dark .page-item.active .page-link {
    background-color: white;
    color: #0a0a0a;
    border-color: white;
}

.pagination-dark .page-item.disabled .page-link {
    background-color: transparent;
    color: var(--pb-text-faint);
    border-color: rgba(255, 255, 255, 0.03);
}

/* ── Alerts ── */
.alert-dark-success {
    background-color: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.15);
    color: #34d399;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.875rem;
}

.alert-dark-danger {
    background-color: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.15);
    color: #f87171;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.875rem;
}

.alert-dark-warning {
    background-color: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.875rem;
}

.alert-dark-info {
    background-color: rgba(103, 232, 249, 0.08);
    border: 1px solid rgba(103, 232, 249, 0.15);
    color: #67e8f9;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.875rem;
}

/* ── Search Input ── */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--pb-text-dim);
}

.search-input-wrapper .form-control-dark {
    padding-left: 36px;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.4s ease-out both;
}

@keyframes pageEnter {
    from {
        opacity: 0.6;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--pb-sidebar-width) !important;
        z-index: 1050;
    }
    .sidebar.collapsed {
        width: var(--pb-sidebar-width) !important;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
    .sidebar-collapse-btn,
    .sidebar-expand-btn {
        display: none !important;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1045;
        display: none;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    /* Always show text on mobile */
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .link-text,
    .sidebar.collapsed .sidebar-section-title {
        opacity: 1;
        width: auto;
        pointer-events: auto;
    }
    .sidebar.collapsed .sidebar-logo {
        padding: 16px 20px;
        justify-content: flex-start;
    }
    .sidebar.collapsed .sidebar-nav {
        padding: 8px 12px;
    }
    .sidebar.collapsed .sidebar-link {
        justify-content: flex-start;
        padding: 9px 12px;
        gap: 10px;
    }
    .sidebar.collapsed .sidebar-section-title {
        height: auto;
        padding: 16px 12px 6px;
        margin: 0;
        border-bottom: none;
    }
    .sidebar.collapsed .sidebar-footer {
        padding: 12px;
    }
    .sidebar.collapsed .sidebar-user-link {
        justify-content: flex-start;
        padding: 9px 12px;
    }
}

/* ── Auth Pages ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    flex-direction: column;
    gap: 0;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-card .form-control-dark {
    padding: 12px 16px;
    font-size: 0.9rem;
}

.auth-card .btn-primary-dark {
    padding: 12px 20px;
    font-size: 0.95rem;
}

/* ── Dropdown Override ── */
.dropdown-menu-dark-custom {
    background-color: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1060;
}

.dropdown-menu-dark-custom .dropdown-item {
    color: var(--pb-text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.1s ease;
}

.dropdown-menu-dark-custom .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: white;
}

.dropdown-menu-dark-custom .dropdown-divider {
    border-color: var(--pb-border);
    margin: 4px 0;
}

/* ── Header Custom Dropdown ── */
.header-dropdown {
    position: relative;
    z-index: 1060;
}

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    list-style: none;
    padding-left: 0;
    margin: 0;
    z-index: 1060;
}

.header-dropdown-menu.show {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

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

/* ── Toast Notifications ── */
.toast-container-custom {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
}

.toast-dark {
    background-color: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--pb-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: white;
    font-size: 0.875rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 8px;
    min-width: 280px;
}

/* ── Livewire Loading ── */
[wire\:loading] {
    opacity: 0.6;
}

.wire-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

/* ── Override Bootstrap defaults for dark theme ── */
.text-muted {
    color: var(--pb-text-dim) !important;
}

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

a:hover {
    color: #a5f3fc;
}

hr {
    border-color: var(--pb-border);
    opacity: 1;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--pb-text-faint);
}

.breadcrumb-item a {
    color: var(--pb-text-muted);
}

.breadcrumb-item.active {
    color: var(--pb-text);
}

/* ── SPA Loading Bar ── */
.spa-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pb-accent), #818cf8, var(--pb-accent));
    background-size: 200% 100%;
    z-index: 99999;
    animation: shimmer 1.5s infinite linear;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.spa-loading-bar.active {
    opacity: 1;
}

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

/* ── SPA Page Transition ── */
.page-content {
    animation: pageEnter 0.2s ease-out;
}
