/* 🍏 macOS Professional Dark Theme */
:root {
    --mac-bg: #161617; /* Apple Dark Mode System Background */
    --mac-sidebar-bg: rgba(18, 18, 22, 0.80); /* Slightly darker translucent sidebar */
    --mac-panel-bg: rgba(22, 22, 28, 0.84); /* Darker panel background for separation */
    --mac-border: rgba(255, 255, 255, 0.12); /* Clear high-contrast border */
    --mac-border-hover: rgba(255, 255, 255, 0.18);
    --mac-text: #f5f5f7;
    --mac-text-muted: #86868b;
    
    /* Apple Dynamic Dark Colors */
    --apple-blue: #0a84ff;
    --apple-blue-hover: #0071e3;
    --apple-green: #30d158;
    --apple-red: #ff453a;
    --apple-orange: #ff9f0a;
    --apple-purple: #bf5af2;
    --apple-yellow: #ffd60a;
    
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Reset & Scrollbars ── */
* {
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #07193d;
    background-image: url('/admin/icloud-bg.svg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--mac-text);
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    border: 2px solid var(--mac-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Sidebar (macOS style) ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--mac-sidebar-bg);
    backdrop-filter: blur(28px) saturate(210%);
    -webkit-backdrop-filter: blur(28px) saturate(210%);
    border-right: 1px solid var(--mac-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 28px 18px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 24px;
}

.sidebar .brand span {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.4px;
}

.sidebar .nav-link {
    color: var(--mac-text-muted);
    font-weight: 500;
    font-size: .88rem;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.sidebar .nav-link.active {
    color: #fff !important;
    background: var(--apple-blue);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.35);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.9;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Main Content Area ── */
.main-content {
    margin-left: 260px;
    padding: 40px 48px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

body.no-sidebar .main-content {
    margin-left: 0;
    padding: 40px 24px;
}

/* ── Glass/macOS Panel Cards ── */
.card-panel {
    background: var(--mac-panel-bg);
    backdrop-filter: blur(30px) saturate(210%);
    -webkit-backdrop-filter: blur(30px) saturate(210%);
    border: 1px solid var(--mac-border);
    border-top: 1px solid rgba(255, 255, 255, 0.2); /* Highlight top edge for 3D glass effect */
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s;
}

.card-panel:hover {
    border-color: var(--mac-border-hover);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

/* ── Stat Cards ── */
.stat-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mac-text-muted);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 2.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.6px;
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ── Tables ── */
.table-dark-custom {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table-dark-custom th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--mac-text-muted);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--mac-border);
    padding: 14px 18px;
}

.table-dark-custom td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    color: var(--mac-text);
    font-size: .9rem;
    background: transparent;
}

.table-dark-custom tbody tr {
    transition: background 0.2s ease;
}

.table-dark-custom tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* DataTables elements alignment */
.dataTables_wrapper .dataTables_length select, 
.dataTables_wrapper .dataTables_filter input {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--mac-border) !important;
    color: var(--mac-text) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 0.88rem !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dataTables_wrapper .dataTables_length select:focus, 
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--apple-blue) !important;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25) !important;
    outline: none;
}

.dataTables_wrapper .dataTables_info {
    color: var(--mac-text-muted) !important;
    font-size: .82rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--mac-text-muted) !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    padding: 6px 12px !important;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--apple-blue) !important;
    color: #fff !important;
    font-weight: 600;
    border-color: transparent !important;
    box-shadow: 0 4px 10px rgba(10, 132, 255, 0.25);
}

/* ── Badges ── */
.badge {
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    letter-spacing: 0.2px;
}

.badge-soft-primary {
    background: rgba(10, 132, 255, 0.12) !important;
    color: #409eff !important;
    border: 1px solid rgba(10, 132, 255, 0.15);
}

.badge-soft-success {
    background: rgba(48, 209, 88, 0.12) !important;
    color: #55d674 !important;
    border: 1px solid rgba(48, 209, 88, 0.15);
}

.badge-soft-danger {
    background: rgba(255, 69, 58, 0.12) !important;
    color: #ff6057 !important;
    border: 1px solid rgba(255, 69, 58, 0.15);
}

.badge-soft-purple {
    background: rgba(191, 90, 242, 0.12) !important;
    color: #c97ff5 !important;
    border: 1px solid rgba(191, 90, 242, 0.15);
}

.badge-soft-warning {
    background: rgba(255, 159, 10, 0.12) !important;
    color: #ffb13d !important;
    border: 1px solid rgba(255, 159, 10, 0.15);
}

/* ── Buttons ── */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: .88rem;
    padding: 8px 16px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary {
    background: var(--apple-blue);
    border: 1px solid var(--apple-blue-hover);
    color: #fff;
}

.btn-primary:hover {
    background: var(--apple-blue-hover);
    border-color: var(--apple-blue-hover);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
    transform: translateY(-1px);
}

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

.btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--mac-text);
    background: rgba(255, 255, 255, 0.03);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Action button configurations */
.btn-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: .95rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.btn-action.btn-outline-info:hover {
    color: var(--apple-blue) !important;
    border-color: rgba(10, 132, 255, 0.3) !important;
    background: rgba(10, 132, 255, 0.08) !important;
}

.btn-action.btn-outline-warning:hover {
    color: var(--apple-orange) !important;
    border-color: rgba(255, 159, 10, 0.3) !important;
    background: rgba(255, 159, 10, 0.08) !important;
}

.btn-action.btn-outline-danger:hover {
    color: var(--apple-red) !important;
    border-color: rgba(255, 69, 58, 0.3) !important;
    background: rgba(255, 69, 58, 0.08) !important;
}

/* ── Forms ── */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--mac-border) !important;
    color: var(--mac-text) !important;
    border-radius: 8px !important;
    font-size: .9rem !important;
    padding: 10px 14px !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--apple-blue) !important;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25) !important;
    outline: none;
}

.form-check-input {
    background-color: rgba(255,255,255,0.06);
    border: 1px solid var(--mac-border);
}

.form-check-input:checked {
    background-color: var(--apple-blue);
    border-color: var(--apple-blue);
}

/* ── Page Header ── */
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin: 0;
}

.page-header p {
    color: var(--mac-text-muted);
    margin: 6px 0 0;
    font-size: .92rem;
}

/* ── Progress Indicators ── */
.progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    background-color: var(--apple-blue) !important;
}

/* ── Custom options container inside form ── */
.option-row-custom {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--mac-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.option-row-custom:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

/* ── Modals ── */
.modal-content {
    background: rgba(30, 30, 32, 0.85) !important;
    backdrop-filter: blur(30px) saturate(210%);
    -webkit-backdrop-filter: blur(30px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5) !important;
}

.modal-header, .modal-footer {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* SweetAlert2 macOS Customizations */
.swal2-popup {
    background: rgba(30, 30, 32, 0.9) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 18px !important;
    color: var(--mac-text) !important;
}
.swal2-title, .swal2-html-container {
    color: var(--mac-text) !important;
}
.swal2-confirm {
    background-color: var(--apple-blue) !important;
    border-radius: 8px !important;
}
.swal2-cancel {
    background-color: rgba(255,255,255,0.08) !important;
    border-radius: 8px !important;
    color: var(--mac-text) !important;
}

/* checkcard and custom options wrapper styles */
.mac-form-check-card {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--mac-border) !important;
    border-radius: 10px !important;
    padding: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    transition: border-color 0.2s, background-color 0.2s !important;
}

.mac-form-check-card:hover {
    border-color: var(--mac-border-hover) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

.mac-form-check-card.active-success {
    border-color: rgba(48, 209, 88, 0.35) !important;
    background: rgba(48, 209, 88, 0.04) !important;
}

.mac-form-check-card.active-success:hover {
    border-color: rgba(48, 209, 88, 0.5) !important;
}

.mac-form-check-card.active-danger {
    border-color: rgba(255, 69, 58, 0.35) !important;
    background: rgba(255, 69, 58, 0.04) !important;
}

.mac-form-check-card.active-danger:hover {
    border-color: rgba(255, 69, 58, 0.5) !important;
}

/* ── Nav Tabs Customizations (macOS Style) ── */
.nav-tabs .nav-link {
    transition: all 0.2s ease !important;
}
.nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}
.nav-tabs .nav-link.active {
    background: var(--apple-blue) !important;
    color: #fff !important;
    border-color: var(--apple-blue) !important;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3) !important;
}
