/*
 * myPuskeswan — Clean Healthcare SaaS + Soft UI Theme
 * Fokus: profesional, ringan, modern, nyaman untuk input data harian.
 */

:root {
    --hc-bg: #f4f8f7;
    --hc-bg-soft: #eef8f4;
    --hc-surface: #ffffff;
    --hc-surface-soft: #f8fffc;
    --hc-primary: #16a34a;
    --hc-primary-dark: #15803d;
    --hc-primary-soft: #dcfce7;
    --hc-secondary: #0284c7;
    --hc-secondary-soft: #e0f2fe;
    --hc-accent: #14b8a6;
    --hc-warning: #f59e0b;
    --hc-warning-soft: #fef3c7;
    --hc-danger: #ef4444;
    --hc-danger-soft: #fee2e2;
    --hc-info: #6366f1;
    --hc-info-soft: #e0e7ff;
    --hc-text: #0f172a;
    --hc-muted: #64748b;
    --hc-border: #dbe7e2;
    --hc-border-strong: #b7ccc3;
    --hc-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    --hc-shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
    --hc-radius: 18px;
    --hc-radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(22, 163, 74, 0.12), transparent 34%),
        radial-gradient(circle at top right, rgba(2, 132, 199, 0.10), transparent 30%),
        linear-gradient(180deg, #f8fffc 0%, var(--hc-bg) 45%, #eef6f3 100%);
    color: var(--hc-text);
    min-height: 100vh;
}

#app.bg-light,
.bg-light {
    background: transparent !important;
}

/* Sidebar / Navigation */
.sidebar {
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--hc-border);
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.05);
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
}

.sidebar .nav-link {
    font-size: 0.86rem;
    margin: 0.12rem 0.55rem;
    padding: 0.58rem 0.75rem;
    border-radius: 12px;
}

.nav-link {
    color: #334155;
    font-weight: 650;
    transition: all 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, var(--hc-primary-soft), var(--hc-secondary-soft));
    color: var(--hc-primary-dark) !important;
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.12);
}

.navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hc-border);
    box-shadow: var(--hc-shadow-sm);
}

.navbar-brand,
.navbar .fw-bold,
h1, h2, h3, h4, h5, h6 {
    color: var(--hc-text);
    font-weight: 750;
    letter-spacing: -0.025em;
}

/* Cards */
.card,
.modal-content,
.dropdown-menu,
.login-container .card,
.swal2-popup {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid var(--hc-border) !important;
    border-radius: var(--hc-radius) !important;
    box-shadow: var(--hc-shadow) !important;
    color: var(--hc-text) !important;
    overflow: hidden;
}

.card-header,
.modal-header {
    background: linear-gradient(135deg, #ffffff 0%, var(--hc-surface-soft) 100%) !important;
    border-bottom: 1px solid var(--hc-border) !important;
    color: var(--hc-text) !important;
    font-weight: 750 !important;
}

.card-body {
    background: transparent;
}

.card-dashboard {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-dashboard:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12) !important;
}

.card-dashboard-sm .card-body {
    padding: 0.85rem !important;
}

.card-dashboard-sm .card-title {
    font-size: 0.78rem;
    margin-bottom: 0.28rem;
    font-weight: 700;
    color: var(--hc-muted);
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.card-dashboard-sm h3 {
    font-size: 1.4rem;
    margin-bottom: 0;
    font-weight: 800;
}

.card-dashboard-sm .fs-6 {
    font-size: 0.76rem !important;
}

/* Bootstrap color cards refined */
.card.bg-primary,
.bg-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, var(--hc-secondary) 100%) !important;
    color: #fff !important;
}

.card.bg-success,
.bg-success {
    background: linear-gradient(135deg, #22c55e 0%, var(--hc-primary) 100%) !important;
    color: #fff !important;
}

.card.bg-warning,
.bg-warning {
    background: linear-gradient(135deg, #fbbf24 0%, var(--hc-warning) 100%) !important;
    color: #1f2937 !important;
}

.card.bg-danger,
.bg-danger {
    background: linear-gradient(135deg, #fb7185 0%, var(--hc-danger) 100%) !important;
    color: #fff !important;
}

.card.bg-info,
.bg-info {
    background: linear-gradient(135deg, #818cf8 0%, var(--hc-info) 100%) !important;
    color: #fff !important;
}

.card.bg-primary .text-white,
.card.bg-success .text-white,
.card.bg-danger .text-white,
.card.bg-info .text-white {
    color: #fff !important;
}

.card.bg-warning .text-white {
    color: #1f2937 !important;
}

/* Buttons */
.btn,
.swal2-confirm,
.swal2-cancel,
.swal2-deny {
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:hover,
.swal2-confirm:hover,
.swal2-cancel:hover,
.swal2-deny:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12) !important;
    filter: brightness(1.02);
}

.btn:active,
.swal2-confirm:active,
.swal2-cancel:active,
.swal2-deny:active {
    transform: translateY(0);
}

.btn-primary,
.swal2-confirm {
    background: linear-gradient(135deg, #38bdf8, var(--hc-secondary)) !important;
    color: #fff !important;
}

.btn-success {
    background: linear-gradient(135deg, #4ade80, var(--hc-primary)) !important;
    color: #fff !important;
}

.btn-warning {
    background: linear-gradient(135deg, #facc15, var(--hc-warning)) !important;
    color: #1f2937 !important;
}

.btn-danger,
.swal2-deny {
    background: linear-gradient(135deg, #fb7185, var(--hc-danger)) !important;
    color: #fff !important;
}

.btn-secondary,
.swal2-cancel {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

.btn-info {
    background: linear-gradient(135deg, #818cf8, var(--hc-info)) !important;
    color: #fff !important;
}

.btn-sm {
    border-radius: 10px !important;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08) !important;
}

/* Tables */
.table-responsive {
    border: 1px solid var(--hc-border);
    border-radius: var(--hc-radius);
    background: var(--hc-surface);
    box-shadow: var(--hc-shadow-sm);
    overflow: auto;
}

.table {
    margin-bottom: 0;
    color: var(--hc-text);
    border-color: var(--hc-border);
}

.table thead th,
.table > :not(caption) > * > th {
    background: #f1faf6 !important;
    color: #0f5132 !important;
    border-bottom: 1px solid var(--hc-border-strong) !important;
    font-weight: 750;
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.table td,
.table th {
    border-color: var(--hc-border) !important;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(20, 184, 166, 0.035) !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(22, 163, 74, 0.08) !important;
}

/* Forms */
.form-control,
.form-select,
textarea,
input[type="date"],
input[type="number"],
input[type="text"],
input[type="password"],
input[type="file"] {
    border: 1px solid var(--hc-border-strong) !important;
    border-radius: 12px !important;
    background-color: #fff !important;
    color: var(--hc-text) !important;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus {
    border-color: var(--hc-primary) !important;
    box-shadow: 0 0 0 0.22rem rgba(22, 163, 74, 0.16) !important;
}

.form-label,
label {
    font-weight: 700;
    color: #334155;
}

.form-check-input {
    border: 1px solid var(--hc-border-strong) !important;
}

.form-check-input:checked {
    background-color: var(--hc-primary) !important;
    border-color: var(--hc-primary) !important;
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--hc-border);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    border: 1px solid transparent !important;
    border-radius: 12px 12px 0 0 !important;
    background: transparent;
    color: var(--hc-muted);
    box-shadow: none;
}

.nav-tabs .nav-link.active {
    background: #fff !important;
    color: var(--hc-primary-dark) !important;
    border-color: var(--hc-border) var(--hc-border) #fff !important;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.04);
}

/* Badges and alerts */
.badge {
    border-radius: 999px !important;
    font-weight: 700;
    padding: 0.42em 0.68em;
}

.alert {
    border: 1px solid var(--hc-border) !important;
    border-radius: var(--hc-radius-sm) !important;
    box-shadow: var(--hc-shadow-sm);
}

/* Images in gallery */
img[loading="lazy"] {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

img[loading="lazy"]:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}

/* Login */
.login-container {
    max-width: 430px;
    width: 100%;
    padding: 20px;
}

/* SweetAlert polish */
.swal2-title {
    color: var(--hc-text) !important;
    font-weight: 800 !important;
}

.swal2-html-container {
    color: var(--hc-text) !important;
}

.swal2-actions {
    gap: 0.5rem;
}

/* Mobile Sidebar Styles */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 265px;
        transform: translateX(-110%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(15, 23, 42, 0.48);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .card,
    .modal-content,
    .table-responsive {
        border-radius: 14px !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08) !important;
    }
}

/* Print Styles */
@media print {
    @page {
        size: landscape;
        margin: 0.8in;
    }

    body {
        background: #fff !important;
    }

    .sidebar,
    .navbar,
    .btn,
    .modal,
    .card-header button,
    .nav-tabs,
    #sidebarOverlay,
    #sidebarToggle,
    .d-print-none {
        display: none !important;
    }

    .nav-tabs {
        border-bottom: none !important;
    }

    .card,
    .table-responsive {
        border: none !important;
        box-shadow: none !important;
    }

    .card-header {
        background-color: transparent !important;
        border-bottom: 2px solid #000 !important;
        padding-left: 0 !important;
        margin-bottom: 20px !important;
    }

    .card-body {
        padding: 0 !important;
    }

    .table {
        width: 100% !important;
    }
}

/* Fixed desktop sidebar — 2026-08-26
   Keeps sidebar pinned at left so large/scrolling content cannot push it away.
   Mobile drawer behavior remains handled by the existing max-width:768px rules.
*/
@media (min-width: 769px) {
    #sidebar.sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 250px !important;
        height: 100vh !important;
        max-height: 100vh;
        overflow-y: auto !important;
        overflow-x: hidden;
        transform: none !important;
        flex: 0 0 250px;
    }

    #sidebar + .flex-grow-1 {
        margin-left: 250px;
        width: calc(100vw - 250px);
        max-width: calc(100vw - 250px);
        min-width: 0;
    }

    #main-content {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    #sidebar + .flex-grow-1 {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}

html, body, #app {
    max-width: 100%;
    overflow-x: hidden;
}

/* Jarvis MCV-inspired Blue HUD admin theme — 2026-08-27
   Scope: unify myPuskeswan with Jarvis MCV visual identity without sacrificing form/table readability.
   Rollback: restore style.css + index.html from backup noted in blueprint/TOOLS.
*/
:root {
    --hc-bg: #030817;
    --hc-bg-soft: #061426;
    --hc-surface: rgba(8, 22, 42, 0.86);
    --hc-surface-soft: rgba(13, 32, 58, 0.78);
    --hc-primary: #39ffb6;
    --hc-primary-dark: #12d89a;
    --hc-primary-soft: rgba(57, 255, 182, 0.13);
    --hc-secondary: #41d9ff;
    --hc-secondary-soft: rgba(65, 217, 255, 0.13);
    --hc-accent: #6ee7ff;
    --hc-warning: #ffd166;
    --hc-warning-soft: rgba(255, 209, 102, 0.15);
    --hc-danger: #ff4d6d;
    --hc-danger-soft: rgba(255, 77, 109, 0.14);
    --hc-info: #7dd3fc;
    --hc-info-soft: rgba(125, 211, 252, 0.14);
    --hc-text: #eafff8;
    --hc-muted: #93c5bd;
    --hc-border: rgba(95, 255, 203, 0.20);
    --hc-border-strong: rgba(95, 255, 203, 0.34);
    --hc-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), 0 0 35px rgba(57, 255, 182, 0.07);
    --hc-shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.20), 0 0 22px rgba(65, 217, 255, 0.05);
}

body {
    background:
        radial-gradient(circle at 14% 8%, rgba(57, 255, 182, 0.18), transparent 31%),
        radial-gradient(circle at 88% 18%, rgba(65, 217, 255, 0.14), transparent 28%),
        radial-gradient(circle at 62% 86%, rgba(37, 99, 235, 0.18), transparent 35%),
        linear-gradient(135deg, #030817 0%, #061426 48%, #020617 100%) !important;
    color: var(--hc-text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(57, 255, 182, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(65, 217, 255, 0.032) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.sidebar {
    background: linear-gradient(180deg, rgba(2, 8, 23, 0.96), rgba(5, 25, 42, 0.94)) !important;
    border-right: 1px solid var(--hc-border-strong) !important;
    box-shadow: 10px 0 34px rgba(0, 0, 0, 0.35), inset -1px 0 0 rgba(65, 217, 255, 0.12) !important;
}

.sidebar .border-bottom {
    border-color: var(--hc-border) !important;
}

.sidebar .nav-link,
.nav-link {
    color: #b7f7ec !important;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, rgba(57, 255, 182, 0.17), rgba(65, 217, 255, 0.13)) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(95, 255, 203, 0.24), 0 0 22px rgba(57, 255, 182, 0.09) !important;
}

.navbar {
    background: rgba(4, 13, 29, 0.86) !important;
    border-bottom: 1px solid var(--hc-border) !important;
    box-shadow: var(--hc-shadow-sm) !important;
}

.navbar .text-muted,
.text-muted {
    color: var(--hc-muted) !important;
}

.navbar-brand,
.navbar .fw-bold,
h1, h2, h3, h4, h5, h6 {
    color: var(--hc-text) !important;
    text-shadow: 0 0 18px rgba(57, 255, 182, 0.10);
}

.card,
.modal-content,
.dropdown-menu,
.login-container .card,
.swal2-popup {
    position: relative;
    background: linear-gradient(145deg, rgba(8, 22, 42, 0.92), rgba(7, 28, 43, 0.84)) !important;
    border: 1px solid var(--hc-border) !important;
    box-shadow: var(--hc-shadow) !important;
    color: var(--hc-text) !important;
    backdrop-filter: blur(16px);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(57, 255, 182, 0.08), transparent 34%, rgba(65, 217, 255, 0.06));
    opacity: .65;
}

.card > *,
.modal-content > *,
.swal2-popup > * {
    position: relative;
    z-index: 1;
}

.card-header,
.modal-header {
    background: linear-gradient(135deg, rgba(57, 255, 182, 0.12), rgba(65, 217, 255, 0.08)) !important;
    border-bottom: 1px solid var(--hc-border) !important;
    color: var(--hc-text) !important;
}

.card-dashboard:hover {
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.34), 0 0 34px rgba(57, 255, 182, 0.13) !important;
}

.card-dashboard-sm .card-title,
.form-label,
label {
    color: #b6efe6 !important;
}

.btn-primary,
.btn-success,
.swal2-confirm {
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-secondary)) !important;
    color: #00131d !important;
    border-color: rgba(95, 255, 203, 0.25) !important;
    box-shadow: 0 0 24px rgba(57, 255, 182, 0.18) !important;
}

.btn-secondary,
.swal2-cancel,
.btn-light {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--hc-border) !important;
    color: var(--hc-text) !important;
}

/* Keep daily-work tables and inputs highly readable on dark HUD background. */
.table-responsive {
    background: rgba(238, 248, 255, 0.96) !important;
    border-color: rgba(95, 255, 203, 0.24) !important;
    box-shadow: var(--hc-shadow-sm) !important;
}

.table {
    color: #0f172a !important;
}

.table thead th,
.table > :not(caption) > * > th {
    background: linear-gradient(135deg, #dffcf6, #e2f4ff) !important;
    color: #063342 !important;
    border-bottom-color: #a7d8d1 !important;
}

.table td,
.table th {
    border-color: #d7e7e5 !important;
    color: #0f172a !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(8, 145, 178, 0.055) !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(20, 184, 166, 0.13) !important;
}

.form-control,
.form-select,
textarea,
input[type="date"],
input[type="number"],
input[type="text"],
input[type="password"],
input[type="file"] {
    background-color: rgba(241, 252, 255, 0.98) !important;
    border-color: rgba(95, 255, 203, 0.36) !important;
    color: #0f172a !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus {
    border-color: var(--hc-secondary) !important;
    box-shadow: 0 0 0 0.22rem rgba(65, 217, 255, 0.19), 0 0 22px rgba(57, 255, 182, 0.12) !important;
}

.alert {
    background: rgba(8, 22, 42, 0.86) !important;
    color: var(--hc-text) !important;
}

.dropdown-item {
    color: var(--hc-text) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(65, 217, 255, 0.13) !important;
}

@media print {
    body::before { display: none !important; }
}
