/* Centralized Backup Dashboard — "Aurora Ops" polish, 3rd-party theming, dark mode.
   Tailwind (tailwind.input.css) holds the component classes; this file styles
   things Tailwind can't reach (DataTables, SweetAlert2) and the dark theme. */

:root {
    --brand: #6a2ff5;
    --brand-soft: rgba(122, 77, 255, .12);
    --accent: #06b6d4;
    --ink-100: #f1f5f9;
    --ink-200: #e2e8f0;
    --ink-300: #cbd5e1;
    --ink-500: #64748b;
    --ink-700: #334155;
    --ink-900: #0f172a;
    --surface: #ffffff;
    --canvas: #f6f7fb;
}

* { -webkit-font-smoothing: antialiased; }
body { background-color: var(--canvas); }
::selection { background: rgba(122, 77, 255, .22); }

/* Tabular figures for data (sizes, dates, counts) */
.tnum { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* ---------------- Aurora backdrop (fixed, behind content) ---------------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora::before, .aurora::after, .aurora span {
    content: ''; position: absolute; border-radius: 9999px; filter: blur(80px); opacity: .55;
    animation: aurora 18s ease-in-out infinite;
}
.aurora::before { width: 46rem; height: 46rem; top: -22rem; right: -10rem; background: radial-gradient(circle, rgba(122,77,255,.35), transparent 65%); }
.aurora::after  { width: 40rem; height: 40rem; bottom: -24rem; left: 10rem; background: radial-gradient(circle, rgba(6,182,212,.28), transparent 65%); animation-delay: -6s; }
.aurora span    { width: 30rem; height: 30rem; top: 30%; left: 55%; background: radial-gradient(circle, rgba(16,185,129,.16), transparent 65%); animation-delay: -12s; }
/* Faint dot grid for texture. */
.aurora-grid { position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: radial-gradient(rgba(15,23,42,.07) 1px, transparent 1px); background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 70%); -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 70%); }
@keyframes aurora { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(3%,-4%,0) scale(1.08); } }

/* Sidebar: deep midnight with a glow at the top. */
#sidebar {
    background:
        radial-gradient(120% 40% at 0% 0%, rgba(122,77,255,.28), transparent 60%),
        radial-gradient(80% 30% at 100% 100%, rgba(6,182,212,.14), transparent 60%),
        #070b18;
}

/* Glass topbar */
.topbar { background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); }

/* Slim scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); background-clip: padding-box; }

/* Count-up numbers shouldn't jitter */
[data-countup] { font-variant-numeric: tabular-nums; }

/* ---------- DataTables restyled to match ---------- */
.dataTables_wrapper { font-size: .875rem; color: var(--ink-700); }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: .9rem; }
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--ink-200); border-radius: .75rem; padding: .45rem .7rem; outline: none; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.dataTables_wrapper .dataTables_filter input { margin-left: .5rem; min-width: 240px; padding-left: 2rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M13 13l-3.6-3.6'/%3E%3C/svg%3E") no-repeat .7rem center; }
.dataTables_wrapper .dataTables_length select { padding-right: 1.8rem; }
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus { border-color: #b6a6ff; box-shadow: 0 0 0 4px var(--brand-soft); }

table.dataTable { width: 100% !important; border-collapse: separate !important; border-spacing: 0; }
table.dataTable thead th {
    text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-500); background: #f8f9fc; border-bottom: 1px solid var(--ink-200) !important; padding: .75rem .95rem;
}
table.dataTable thead th:first-child { border-top-left-radius: .75rem; }
table.dataTable thead th:last-child  { border-top-right-radius: .75rem; }
table.dataTable tbody td { padding: .75rem .95rem; border-bottom: 1px solid #f1f3f8; vertical-align: middle; transition: background-color .15s; }
table.dataTable tbody tr { transition: box-shadow .15s; }
table.dataTable tbody tr:hover > td { background: rgba(122,77,255,.04); }
table.dataTable tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 #9476ff; }
table.dataTable.no-footer { border-bottom: none; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { cursor: pointer; }
table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { color: var(--brand); }

.dataTables_wrapper .dataTables_paginate { margin-top: .9rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: .65rem !important; border: 1px solid var(--ink-200) !important; padding: .35rem .75rem !important;
    margin: 0 2px; background: #fff !important; color: var(--ink-700) !important; transition: all .15s;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg,#7a4dff,#5a1fd9) !important; border-color: transparent !important; color: #fff !important;
    box-shadow: 0 6px 16px -6px rgba(106,47,245,.6);
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f3f1ff !important; border-color: #d5cdff !important; color: var(--brand) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .4; }
.dataTables_wrapper .dataTables_info { padding-top: .9rem; color: var(--ink-500); font-size: .8rem; }
.dataTables_wrapper .dataTables_processing {
    border-radius: .9rem; border: 1px solid var(--ink-200); background: rgba(255,255,255,.92);
    box-shadow: 0 12px 32px -12px rgb(15 23 42 / .25); font-weight: 600; color: var(--brand);
}

/* ---------- SweetAlert2 ---------- */
.swal2-popup { border-radius: 1.25rem !important; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; padding: 1.5rem !important; }
.swal2-title { font-weight: 700 !important; color: var(--ink-900) !important; }
.swal2-styled { border-radius: .75rem !important; font-weight: 600 !important; padding: .6rem 1.2rem !important; }
.swal2-styled.swal2-confirm { background-image: linear-gradient(135deg,#7a4dff,#5a1fd9); box-shadow: 0 8px 20px -8px rgba(106,47,245,.6) !important; }
.swal2-styled:focus { box-shadow: 0 0 0 4px var(--brand-soft) !important; }
.swal2-input { border-radius: .75rem !important; }
.swal2-toast { border-radius: 1rem !important; box-shadow: 0 16px 40px -12px rgb(15 23 42 / .3) !important; }
.swal2-timer-progress-bar { background: linear-gradient(90deg,#7a4dff,#06b6d4) !important; }

/* =================== Dark mode (class strategy) =================== */
.dark { --surface: #0e1424; --canvas: #070b16; color-scheme: dark; }
.dark body, body.dark { background: var(--canvas); color: #cbd5e1; }
.dark .aurora::before { opacity: .7; }
.dark .aurora-grid { background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); }
.dark .topbar { background: rgba(10,15,30,.72); }

.dark .bg-white { background-color: var(--surface) !important; }
.dark .bg-ink-50, .dark .bg-ink-50\/50, .dark .bg-ink-50\/60, .dark .bg-ink-50\/70, .dark .bg-ink-100 { background-color: rgba(255,255,255,.035) !important; }
.dark .hover\:bg-ink-50:hover, .dark .hover\:bg-brand-50\/40:hover { background-color: rgba(255,255,255,.04) !important; }
.dark .text-ink-900 { color: #f1f5f9 !important; }
.dark .text-ink-800 { color: #e2e8f0 !important; }
.dark .text-ink-700 { color: #cbd5e1 !important; }
.dark .text-ink-600 { color: #94a3b8 !important; }
.dark .border-ink-100, .dark .border-ink-100\/70 { border-color: rgba(148,163,184,.10) !important; }
.dark .border-ink-200, .dark .border-ink-200\/80 { border-color: rgba(148,163,184,.14) !important; }
.dark .divide-ink-50 > * + *, .dark .divide-ink-100 > * + * { border-color: rgba(148,163,184,.08) !important; }

.dark .card { background-color: var(--surface); border-color: rgba(148,163,184,.12); box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -12px rgba(0,0,0,.5); }
.dark .card-hover:hover { border-color: rgba(148,118,255,.35); }
.dark .card-head { border-color: rgba(148,163,184,.10); }
.dark .card-foot { border-color: rgba(148,163,184,.10); background-color: rgba(255,255,255,.02); }

.dark .input, .dark input:not([type=checkbox]):not([type=radio]), .dark select, .dark textarea {
    background-color: rgba(255,255,255,.03) !important; border-color: rgba(148,163,184,.18) !important; color: #e2e8f0 !important;
}
.dark .btn-soft { background-color: rgba(255,255,255,.06) !important; color: #cbd5e1 !important; }
.dark .btn-soft:hover { background-color: rgba(255,255,255,.1) !important; }
.dark .btn-ghost:hover, .dark .btn-icon:hover, .dark .hover\:bg-ink-100:hover { background-color: rgba(255,255,255,.06) !important; color: #f1f5f9; }

.dark .badge-success   { background: rgba(16,185,129,.12); color: #6ee7b7; --tw-ring-color: rgba(16,185,129,.3); }
.dark .badge-danger    { background: rgba(244,63,94,.12);  color: #fda4af; --tw-ring-color: rgba(244,63,94,.3); }
.dark .badge-warning   { background: rgba(245,158,11,.12); color: #fcd34d; --tw-ring-color: rgba(245,158,11,.3); }
.dark .badge-info      { background: rgba(6,182,212,.12);  color: #67e8f9; --tw-ring-color: rgba(6,182,212,.3); }
.dark .badge-primary   { background: rgba(122,77,255,.15); color: #c4b5fd; --tw-ring-color: rgba(122,77,255,.35); }
.dark .badge-secondary { background: rgba(148,163,184,.10); color: #cbd5e1; --tw-ring-color: rgba(148,163,184,.2); }
.dark .bg-rose-50 { background-color: rgba(244,63,94,.10) !important; }
.dark .bg-emerald-50 { background-color: rgba(16,185,129,.10) !important; }
.dark .bg-amber-50 { background-color: rgba(245,158,11,.10) !important; }
.dark .bg-sky-50, .dark .bg-accent-50 { background-color: rgba(6,182,212,.10) !important; }
.dark .bg-brand-50 { background-color: rgba(122,77,255,.12) !important; }
.dark .border-rose-200 { border-color: rgba(244,63,94,.3) !important; }
.dark .border-emerald-200 { border-color: rgba(16,185,129,.3) !important; }
.dark .border-amber-200 { border-color: rgba(245,158,11,.3) !important; }
.dark .border-sky-200 { border-color: rgba(6,182,212,.3) !important; }
.dark .text-rose-700 { color: #fda4af !important; }
.dark .text-emerald-700 { color: #6ee7b7 !important; }
.dark .text-amber-700 { color: #fcd34d !important; }
.dark .text-sky-700 { color: #7dd3fc !important; }

/* Component classes built with @apply carry light colours — remap them. */
.dark .card-title, .dark .page-title { color: #f1f5f9; }
.dark .label { color: #cbd5e1; }
.dark .page-sub, .dark .crumb { color: #94a3b8; }
.dark .crumb .text-ink-700 { color: #e2e8f0 !important; }
.dark .tbl thead th { background: rgba(255,255,255,.035); color: #94a3b8; }
.dark .tbl thead tr { border-color: rgba(148,163,184,.12); }
.dark .tbl tbody tr { border-color: rgba(148,163,184,.08); }
.dark .tbl tbody tr:hover { background: rgba(122,77,255,.07); }
.dark .text-ink-100 { color: rgba(255,255,255,.08) !important; }
.dark .text-ink-200 { color: rgba(255,255,255,.10) !important; }
.dark .bg-ink-100\/80 { background-color: rgba(255,255,255,.06) !important; }
.dark .border-ink-200\/70 { border-color: rgba(148,163,184,.12) !important; }
.dark .border-white { border-color: var(--surface) !important; }
.dark .ring-white { --tw-ring-color: var(--surface) !important; }
.dark .bg-ink-950 { box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.dark .empty i { color: #475569; }

/* DataTables dark */
.dark table.dataTable thead th { background: rgba(255,255,255,.035); color: #94a3b8; border-bottom-color: rgba(148,163,184,.14) !important; }
.dark table.dataTable tbody td { border-bottom-color: rgba(148,163,184,.07); color: #cbd5e1; }
.dark table.dataTable tbody tr:hover > td { background: rgba(122,77,255,.07); }
.dark .dataTables_wrapper { color: #cbd5e1; }
.dark .dataTables_wrapper .dataTables_filter input,
.dark .dataTables_wrapper .dataTables_length select { background-color: rgba(255,255,255,.03); border-color: rgba(148,163,184,.18); color: #e2e8f0; }
.dark .dataTables_wrapper .paginate_button { background: rgba(255,255,255,.03) !important; border-color: rgba(148,163,184,.18) !important; color: #cbd5e1 !important; }
.dark .dataTables_wrapper .paginate_button.current { color: #fff !important; }
.dark .dataTables_wrapper .dataTables_processing { background: rgba(14,20,36,.95); border-color: rgba(148,163,184,.18); }

/* SweetAlert dark */
.dark .swal2-popup { background: #0e1424 !important; color: #cbd5e1 !important; border: 1px solid rgba(148,163,184,.14); }
.dark .swal2-title { color: #f1f5f9 !important; }
.dark .swal2-html-container { color: #94a3b8 !important; }
.dark .swal2-input { background: rgba(255,255,255,.03) !important; color: #e2e8f0 !important; border-color: rgba(148,163,184,.2) !important; }

/* ---------------- Responsive tables (mobile horizontal scroll) ----------------
   On small screens, force tables to size to their content so they overflow the
   .overflow-x-auto wrapper and become scrollable instead of being squeezed. */
.overflow-x-auto { -webkit-overflow-scrolling: touch; }
@media (max-width: 1023px) {
    .overflow-x-auto > table { width: max-content; min-width: 100%; }
    .overflow-x-auto > .dataTables_wrapper table.dataTable { width: max-content !important; min-width: 100%; }
    .overflow-x-auto > table th, .overflow-x-auto > table td,
    .overflow-x-auto .dataTables_wrapper table.dataTable th,
    .overflow-x-auto .dataTables_wrapper table.dataTable td { white-space: nowrap; }
    .overflow-x-auto { scrollbar-width: thin; }
    .overflow-x-auto::-webkit-scrollbar { height: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .aurora::before, .aurora::after, .aurora span { animation: none; }
    *, *::before, *::after { scroll-behavior: auto !important; }
}

/* ---------------- Print (monthly report → "Save as PDF") ---------------- */
@media print {
    #sidebar, header.topbar, .aurora, .aurora-grid, main footer, .no-print, #sbBackdrop { display: none !important; }
    .lg\:pl-72 { padding-left: 0 !important; }
    body, .dark body { background: #fff !important; color: #0f172a !important; }
    main { padding: 0 !important; }
    .card { box-shadow: none !important; border-color: #e2e8f0 !important; break-inside: avoid; background: #fff !important; }
    .page-enter > *, .stagger > * { animation: none !important; opacity: 1 !important; transform: none !important; }
    .icon-tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 14mm; }
}
