/* ========================================================================
   APEX Premium Component Overrides
   Replaces Bootstrap's default visual signature with the Lake/Prime
   glass-morphic design language. Every component should feel bespoke.
   ======================================================================== */


/* ========================================
   1. CARDS — Glass Depth + Glow Hover
   ======================================== */

.apex-premium .card,
.apex-premium .apex-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(26, 34, 54, 0.4));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

/* Command surface glow overlay */
.apex-premium .card::before,
.apex-premium .apex-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(6, 182, 212, 0.03), transparent 35%),
                linear-gradient(300deg, rgba(34, 197, 94, 0.02), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
    z-index: 0;
}

.apex-premium .card:hover::before,
.apex-premium .apex-card:hover::before {
    opacity: 1;
}

.apex-premium .card:hover,
.apex-premium .apex-card:hover {
    border-color: rgba(6, 182, 212, 0.15);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.06);
    transform: translateY(-1px);
}

.apex-premium .card > *,
.apex-premium .apex-card > * {
    position: relative;
    z-index: 1;
}

.apex-premium .card-header,
.apex-premium .apex-card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.25rem;
}

.apex-premium .card-body,
.apex-premium .apex-card-body {
    padding: 1.25rem;
}

.apex-premium .card-title,
.apex-premium .apex-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.apex-premium .card-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Stat cards — neon accent */
.apex-premium .apex-stat-card {
    position: relative;
    overflow: hidden;
}

.apex-premium .apex-stat-card .stat-value,
.apex-premium .apex-stat-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.apex-premium .apex-stat-card .stat-label,
.apex-premium .apex-stat-card .text-muted {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

/* Stat icon backgrounds */
.apex-premium .stat-icon,
.apex-premium .apex-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.15);
}


/* ========================================
   2. TABLES — Dark Data Grid
   ======================================== */

.apex-premium .table {
    --bs-table-bg: transparent;
    --bs-table-color: #f1f5f9;
    --bs-table-border-color: rgba(255, 255, 255, 0.05);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.015);
    --bs-table-hover-bg: rgba(6, 182, 212, 0.04);
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.apex-premium .table thead th {
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.apex-premium .table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    color: #e2e8f0;
}

.apex-premium .table tbody tr {
    transition: background 0.15s ease;
}

.apex-premium .table tbody tr:hover {
    background: rgba(6, 182, 212, 0.04);
}

/* Table inside card — remove double borders */
.apex-premium .card .table {
    margin: 0;
}

.apex-premium .card .table thead th:first-child { border-top-left-radius: 0; }
.apex-premium .card .table thead th:last-child { border-top-right-radius: 0; }


/* ========================================
   3. FORMS — Glass Inputs
   ======================================== */

.apex-premium .form-control,
.apex-premium .form-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.apex-premium .form-control:focus,
.apex-premium .form-select:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12), 0 0 20px rgba(6, 182, 212, 0.05);
    color: #f1f5f9;
}

.apex-premium .form-control::placeholder {
    color: #475569;
}

.apex-premium .form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.375rem;
}

.apex-premium .form-text {
    color: #64748b;
    font-size: 0.75rem;
}

.apex-premium .form-check-input {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.apex-premium .form-check-input:checked {
    background-color: #06b6d4;
    border-color: #06b6d4;
}

.apex-premium .input-group-text {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: #64748b;
}


/* ========================================
   4. BUTTONS — Gradient + Glow
   ======================================== */

.apex-premium .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

.apex-premium .btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    color: #090d1a;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.apex-premium .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
    color: #090d1a;
}

.apex-premium .btn-primary:active {
    transform: scale(0.97);
}

.apex-premium .btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    color: #090d1a;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
}

.apex-premium .btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.apex-premium .btn-outline-primary {
    background: transparent;
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #06b6d4;
}

.apex-premium .btn-outline-primary:hover {
    background: rgba(6, 182, 212, 0.08);
    border-color: #06b6d4;
    color: #06b6d4;
}

.apex-premium .btn-outline-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.apex-premium .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
}

.apex-premium .btn-light {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.apex-premium .btn-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Small buttons */
.apex-premium .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 8px;
}


/* ========================================
   5. BADGES — Glass Pill
   ======================================== */

.apex-premium .badge {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.625rem;
    border-radius: 99px;
    border: 1px solid transparent;
}

.apex-premium .badge.bg-primary,
.apex-premium .badge.bg-primary-subtle {
    background: rgba(6, 182, 212, 0.12) !important;
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.2);
}

.apex-premium .badge.bg-success,
.apex-premium .badge.bg-success-subtle {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.apex-premium .badge.bg-warning,
.apex-premium .badge.bg-warning-subtle {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.apex-premium .badge.bg-danger,
.apex-premium .badge.bg-danger-subtle {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.apex-premium .badge.bg-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.1);
}

.apex-premium .badge.bg-info {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.apex-premium .badge.bg-light {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8;
}


/* ========================================
   6. ALERTS — Subtle Glass
   ======================================== */

.apex-premium .alert {
    border-radius: 12px;
    backdrop-filter: blur(8px);
    font-size: 0.875rem;
}

.apex-premium .alert-success {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.apex-premium .alert-danger {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.apex-premium .alert-warning {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.apex-premium .alert-info {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}


/* ========================================
   7. MODALS — Dark Glass
   ======================================== */

.apex-premium .modal-content {
    background: linear-gradient(135deg, rgba(12, 18, 36, 0.95), rgba(17, 24, 39, 0.95));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    color: #f1f5f9;
}

.apex-premium .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem 1.5rem;
}

.apex-premium .modal-title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.apex-premium .modal-body {
    padding: 1.5rem;
}

.apex-premium .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1rem 1.5rem;
}

.apex-premium .modal-backdrop.show {
    opacity: 0.7;
    backdrop-filter: blur(4px);
}

.apex-premium .btn-close {
    filter: invert(1) brightness(0.8);
}


/* ========================================
   8. PAGINATION — Dark
   ======================================== */

.apex-premium .page-link {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border-radius: 8px;
    margin: 0 2px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.apex-premium .page-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.1);
}

.apex-premium .page-item.active .page-link {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border-color: transparent;
    color: #090d1a;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.apex-premium .page-item.disabled .page-link {
    background: transparent;
    color: #334155;
    border-color: rgba(255, 255, 255, 0.03);
}


/* ========================================
   9. BREADCRUMBS
   ======================================== */

.apex-premium .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.apex-premium .breadcrumb-item a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.8125rem;
}

.apex-premium .breadcrumb-item a:hover {
    color: #06b6d4;
}

.apex-premium .breadcrumb-item.active {
    color: #94a3b8;
    font-size: 0.8125rem;
}

.apex-premium .breadcrumb-item + .breadcrumb-item::before {
    color: #334155;
}


/* ========================================
   10. NAV TABS & PILLS
   ======================================== */

.apex-premium .nav-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.apex-premium .nav-tabs .nav-link {
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.apex-premium .nav-tabs .nav-link:hover {
    color: #f1f5f9;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.apex-premium .nav-tabs .nav-link.active {
    color: #06b6d4;
    background: transparent;
    border-bottom-color: #06b6d4;
}

.apex-premium .nav-pills .nav-link {
    color: #94a3b8;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.apex-premium .nav-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
}

.apex-premium .nav-pills .nav-link.active {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}


/* ========================================
   11. PROGRESS BARS
   ======================================== */

.apex-premium .progress {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}

.apex-premium .progress-bar {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
    border-radius: 99px;
}

.apex-premium .progress-bar.bg-success {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.apex-premium .progress-bar.bg-warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.apex-premium .progress-bar.bg-danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}


/* ========================================
   12. TOOLTIPS & POPOVERS
   ======================================== */

.apex-premium .tooltip-inner {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.apex-premium .popover {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.apex-premium .popover-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.apex-premium .popover-body {
    color: #94a3b8;
}


/* ========================================
   13. LIST GROUPS
   ======================================== */

.apex-premium .list-group-item {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    padding: 0.75rem 1rem;
}

.apex-premium .list-group-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.apex-premium .list-group-item.active {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
}


/* ========================================
   14. DASHBOARD PAGE HEADER
   ======================================== */

.apex-premium .main-dash-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.apex-premium h1, .apex-premium h2, .apex-premium h3,
.apex-premium h4, .apex-premium h5, .apex-premium h6 {
    color: #f1f5f9;
}

.apex-premium .fw-bold {
    color: #f1f5f9;
}
