/*
|--------------------------------------------------------------------------
| Smart Apotek UI
|--------------------------------------------------------------------------
|
| Hand-written stylesheet, no build step. Tailwind utilities come from the
| Tailwind browser runtime loaded in layouts/partials/head.blade.php.
|
| The component layer below styles the class vocabulary used across the
| views (card, btn, form-control, row /
| col-*, table, modal, badge, ...). Everything sits in the `components`
| layer so Tailwind utilities on the same element always win.
|
*/

@layer theme, base, components, utilities;

:root {
    --ui-primary: #0d9488;
    --ui-primary-hover: #0f766e;
    --ui-primary-soft: #ccfbf1;
    --ui-success: #16a34a;
    --ui-success-hover: #15803d;
    --ui-success-soft: #dcfce7;
    --ui-info: #0284c7;
    --ui-info-hover: #0369a1;
    --ui-info-soft: #e0f2fe;
    --ui-warning: #d97706;
    --ui-warning-hover: #b45309;
    --ui-warning-soft: #fef3c7;
    --ui-danger: #dc2626;
    --ui-danger-hover: #b91c1c;
    --ui-danger-soft: #fee2e2;
    --ui-secondary: #64748b;
    --ui-secondary-hover: #475569;
    --ui-secondary-soft: #f1f5f9;

    /* text on *-soft backgrounds, and matching soft borders */
    --ui-primary-fg: #0f766e;
    --ui-success-fg: #166534;
    --ui-info-fg: #075985;
    --ui-warning-fg: #92400e;
    --ui-danger-fg: #991b1b;
    --ui-secondary-fg: #475569;
    --ui-primary-border: #99f6e4;
    --ui-success-border: #bbf7d0;
    --ui-info-border: #bae6fd;
    --ui-warning-border: #fde68a;
    --ui-danger-border: #fecaca;

    --ui-bg: #f5f7fa;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f8fafc;
    --ui-surface-hover: #f1f5f9;
    --ui-border: #e2e8f0;
    --ui-border-strong: #cbd5e1;
    --ui-text: #0f172a;
    --ui-text-soft: #334155;
    --ui-muted: #64748b;
    --ui-placeholder: #94a3b8;
    --ui-radius: 0.75rem;
    --ui-radius-sm: 0.5rem;
    --ui-ring: 0 0 0 3px rgb(13 148 136 / 0.18);
    --ui-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 1px 3px rgb(15 23 42 / 0.06);
    --ui-shadow-lg: 0 20px 45px -12px rgb(15 23 42 / 0.25);
    --ui-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

/* Dark theme: <html class="dark">, set by the theme script in layouts/partials/head.blade.php */
html.dark {
    --ui-primary: #14b8a6;
    --ui-primary-hover: #0d9488;
    --ui-primary-soft: rgb(20 184 166 / 0.14);
    --ui-success: #22c55e;
    --ui-success-hover: #16a34a;
    --ui-success-soft: rgb(34 197 94 / 0.14);
    --ui-info: #0ea5e9;
    --ui-info-hover: #0284c7;
    --ui-info-soft: rgb(14 165 233 / 0.14);
    --ui-warning: #f59e0b;
    --ui-warning-hover: #d97706;
    --ui-warning-soft: rgb(245 158 11 / 0.14);
    --ui-danger: #ef4444;
    --ui-danger-hover: #dc2626;
    --ui-danger-soft: rgb(239 68 68 / 0.14);
    --ui-secondary: #94a3b8;
    --ui-secondary-hover: #64748b;
    --ui-secondary-soft: rgb(148 163 184 / 0.14);

    --ui-primary-fg: #5eead4;
    --ui-success-fg: #86efac;
    --ui-info-fg: #7dd3fc;
    --ui-warning-fg: #fcd34d;
    --ui-danger-fg: #fca5a5;
    --ui-secondary-fg: #cbd5e1;
    --ui-primary-border: rgb(20 184 166 / 0.35);
    --ui-success-border: rgb(34 197 94 / 0.35);
    --ui-info-border: rgb(14 165 233 / 0.35);
    --ui-warning-border: rgb(245 158 11 / 0.35);
    --ui-danger-border: rgb(239 68 68 / 0.35);

    --ui-bg: #0b1120;
    --ui-surface: #111827;
    --ui-surface-muted: #0f172a;
    --ui-surface-hover: #1e293b;
    --ui-border: #1f2937;
    --ui-border-strong: #334155;
    --ui-text: #e2e8f0;
    --ui-text-soft: #cbd5e1;
    --ui-muted: #94a3b8;
    --ui-placeholder: #64748b;
    --ui-ring: 0 0 0 3px rgb(20 184 166 / 0.3);
    --ui-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 1px 3px rgb(0 0 0 / 0.35);
    --ui-shadow-lg: 0 20px 45px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
}

@layer components {

    /* ---------------------------------------------------------------- base */

    body {
        font-family: var(--ui-font);
        color: var(--ui-text);
        background: var(--ui-bg);
        font-size: 0.9375rem;
        line-height: 1.55;
        -webkit-font-smoothing: antialiased;
    }

    a { color: var(--ui-primary); }
    a:hover { color: var(--ui-primary-hover); }

    h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--ui-text); }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1.0625rem; }
    h6 { font-size: 0.9375rem; }
    hr { border: 0; border-top: 1px solid var(--ui-border); margin: 1.25rem 0; }
    label { display: inline-block; font-weight: 500; font-size: 0.875rem; color: var(--ui-text-soft); margin-bottom: 0.375rem; }
    small, .small { font-size: 0.8125rem; }
    ol, ul { padding-left: 1.25rem; }
    ol { list-style: decimal; }
    ul { list-style: disc; }
    nav ul, nav ol, .list-unstyled { list-style: none; padding-left: 0; }

    /* ---------------------------------------------------------------- grid */

    .container-fluid { width: 100%; padding-inline: 1rem; }
    .row { display: flex; flex-wrap: wrap; margin-inline: -0.625rem; }
    .row > * { position: relative; width: 100%; max-width: 100%; padding-inline: 0.625rem; }
    .col { flex: 1 0 0%; }
    .col-auto { flex: 0 0 auto; width: auto; }
    .col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-3 { flex: 0 0 25%; max-width: 25%; }
    .col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-6 { flex: 0 0 50%; max-width: 50%; }
    .col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-9 { flex: 0 0 75%; max-width: 75%; }
    .col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-12 { flex: 0 0 100%; max-width: 100%; }

    @media (min-width: 576px) {
        .col-sm { flex: 1 0 0%; max-width: 100%; }
        .col-sm-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
        .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
        .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
        .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
        .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    }

    @media (min-width: 768px) {
        .col-md { flex: 1 0 0%; max-width: 100%; }
        .col-md-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
        .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
        .col-md-3 { flex: 0 0 25%; max-width: 25%; }
        .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
        .col-md-6 { flex: 0 0 50%; max-width: 50%; }
        .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
        .col-md-12 { flex: 0 0 100%; max-width: 100%; }
        .d-md-none { display: none !important; }
        .d-md-block { display: block !important; }
        .d-md-flex { display: flex !important; }
    }

    @media (min-width: 992px) {
        .col-lg { flex: 1 0 0%; max-width: 100%; }
        .col-lg-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
        .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
        .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
        .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
        .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
        .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
        .d-lg-none { display: none !important; }
        .d-lg-block { display: block !important; }
    }

    @media (min-width: 1200px) {
        .col-xl { flex: 1 0 0%; max-width: 100%; }
        .col-xl-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
        .col-xl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
        .col-xl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
        .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
        .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
        .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
        .d-xl-none { display: none !important; }
        .d-xl-block { display: block !important; }
    }

    /* ----------------------------------------------- bootstrap-style utils */

    .d-none { display: none !important; }
    .d-block { display: block !important; }
    .d-inline { display: inline !important; }
    .d-inline-block { display: inline-block !important; }
    .d-flex { display: flex !important; }
    .flex-column { flex-direction: column !important; }
    .flex-wrap { flex-wrap: wrap; }
    .justify-content-start { justify-content: flex-start !important; }
    .justify-content-end { justify-content: flex-end !important; }
    .justify-content-center { justify-content: center !important; }
    .justify-content-between { justify-content: space-between !important; }
    .align-items-start { align-items: flex-start !important; }
    .align-items-end { align-items: flex-end !important; }
    .align-items-center { align-items: center !important; }
    .font-weight-bold { font-weight: 600 !important; }
    .font-weight-normal { font-weight: 400 !important; }
    .font-italic { font-style: italic !important; }
    .float-right { float: right !important; }
    .float-left { float: left !important; }
    .w-100 { width: 100% !important; }
    .text-white-50 { color: rgb(255 255 255 / 0.75) !important; }
    .text-muted { color: var(--ui-muted) !important; }
    .text-primary { color: var(--ui-primary) !important; }
    .text-success { color: var(--ui-success) !important; }
    .text-info { color: var(--ui-info) !important; }
    .text-warning { color: var(--ui-warning) !important; }
    .text-danger { color: var(--ui-danger) !important; }
    .text-secondary { color: var(--ui-secondary) !important; }
    .bg-primary { background-color: var(--ui-primary) !important; }
    .bg-success { background-color: var(--ui-success) !important; }
    .bg-info { background-color: var(--ui-info) !important; }
    .bg-warning { background-color: var(--ui-warning) !important; }
    .bg-danger { background-color: var(--ui-danger) !important; }
    .bg-secondary { background-color: var(--ui-secondary) !important; }
    .shadow { box-shadow: var(--ui-shadow) !important; }

    /* ---------------------------------------------------------------- card */

    .card {
        position: relative;
        display: flex;
        flex-direction: column;
        min-width: 0;
        background: var(--ui-surface);
        border: 1px solid var(--ui-border);
        border-radius: var(--ui-radius);
        box-shadow: var(--ui-shadow);
    }
    .card-header {
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid var(--ui-border);
        border-radius: var(--ui-radius) var(--ui-radius) 0 0;
    }
    .card-body { flex: 1 1 auto; padding: 1.25rem; min-width: 0; }
    .card-footer {
        padding: 0.875rem 1.25rem;
        border-top: 1px solid var(--ui-border);
        background: var(--ui-surface-muted);
        border-radius: 0 0 var(--ui-radius) var(--ui-radius);
    }
    .card-title { font-size: 1.0625rem; font-weight: 600; margin: 0; }
    .card-header h6.text-primary { color: var(--ui-text) !important; font-size: 1rem; }

    /* stat cards: <div class="card text-white bg-xxx"> */
    .card.text-white { border: 0; overflow: hidden; }
    .card.text-white .card-header {
        border-bottom: 0;
        padding-bottom: 0;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: rgb(255 255 255 / 0.85);
    }
    .card.text-white .card-title { color: #fff; font-size: 1.5rem; font-weight: 700; }
    /* headings inside stat cards inherit the global dark heading color otherwise */
    .card.text-white :is(h1, h2, h3, h4, h5, h6, p, span) { color: #fff; }
    .card.text-white.bg-primary { background: linear-gradient(135deg, #14b8a6, #0f766e) !important; }
    .card.text-white.bg-success { background: linear-gradient(135deg, #22c55e, #15803d) !important; }
    .card.text-white.bg-info { background: linear-gradient(135deg, #38bdf8, #0369a1) !important; }
    .card.text-white.bg-warning { background: linear-gradient(135deg, #fbbf24, #d97706) !important; }
    .card.text-white.bg-danger { background: linear-gradient(135deg, #f87171, #b91c1c) !important; }
    .card.text-white.bg-secondary { background: linear-gradient(135deg, #94a3b8, #475569) !important; }

    /* ------------------------------------------------------------- buttons */

    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.25rem;
        border: 1px solid transparent;
        border-radius: var(--ui-radius-sm);
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
        text-decoration: none;
        transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
    }
    .btn:focus-visible { outline: none; box-shadow: var(--ui-ring); }
    .btn:disabled, .btn.disabled { opacity: 0.55; pointer-events: none; }
    .btn-sm { padding: 0.3125rem 0.625rem; font-size: 0.8125rem; gap: 0.375rem; }
    .btn-lg { padding: 0.75rem 1.25rem; font-size: 1rem; }
    .btn-block { display: flex; width: 100%; }

    .btn-primary { background: var(--ui-primary); color: #fff !important; }
    .btn-primary:hover { background: var(--ui-primary-hover); }
    .btn-success { background: var(--ui-success); color: #fff !important; }
    .btn-success:hover { background: var(--ui-success-hover); }
    .btn-info { background: var(--ui-info); color: #fff !important; }
    .btn-info:hover { background: var(--ui-info-hover); }
    .btn-warning { background: var(--ui-warning); color: #fff !important; }
    .btn-warning:hover { background: var(--ui-warning-hover); }
    .btn-danger { background: var(--ui-danger); color: #fff !important; }
    .btn-danger:hover { background: var(--ui-danger-hover); }
    .btn-secondary { background: var(--ui-surface); color: var(--ui-text-soft) !important; border-color: var(--ui-border-strong); }
    .btn-secondary:hover { background: var(--ui-secondary-soft); }
    .btn-light { background: var(--ui-surface-hover); color: var(--ui-text-soft) !important; }
    .btn-light:hover { background: var(--ui-border); }

    .btn-outline-primary { background: var(--ui-surface); color: var(--ui-primary) !important; border-color: var(--ui-primary); }
    .btn-outline-primary:hover { background: var(--ui-primary-soft); }
    .btn-outline-success { background: var(--ui-surface); color: var(--ui-success) !important; border-color: var(--ui-success); }
    .btn-outline-success:hover { background: var(--ui-success-soft); }
    .btn-outline-danger { background: var(--ui-surface); color: var(--ui-danger) !important; border-color: var(--ui-danger); }
    .btn-outline-danger:hover { background: var(--ui-danger-soft); }

    /* <a class="btn btn-icon-split"><span class="icon">..</span><span class="text">..</span></a> */
    .btn-icon-split { padding: 0; gap: 0; overflow: hidden; align-items: stretch; }
    .btn-icon-split .icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        background: rgb(0 0 0 / 0.12);
    }
    .btn-icon-split .icon:only-child { background: transparent; }
    .btn-icon-split .text { display: inline-flex; align-items: center; padding: 0.5rem 1rem; }
    .btn-icon-split.btn-sm .icon, .btn-icon-split.btn-sm .text { padding: 0.3125rem 0.625rem; }
    .btn-icon-split .icon.text-white-50 { color: #fff !important; }

    /* Row actions (Ubah / Detail / Hapus / Retur): one size, icon + label, soft colors */
    .btn-action {
        gap: 0.375rem;
        min-width: 5.25rem;
        height: 2rem;
        padding: 0 0.75rem;
        font-size: 0.8125rem;
        font-weight: 500;
        border-radius: var(--ui-radius-sm);
        border: 1px solid transparent;
    }
    .btn-action i { font-size: 0.75rem; }
    .btn-action-edit { background: var(--ui-primary-soft); color: var(--ui-primary-fg) !important; border-color: var(--ui-primary-border); }
    .btn-action-edit:hover { background: var(--ui-primary); color: #fff !important; border-color: var(--ui-primary); }
    .btn-action-show { background: var(--ui-info-soft); color: var(--ui-info-fg) !important; border-color: var(--ui-info-border); }
    .btn-action-show:hover { background: var(--ui-info); color: #fff !important; border-color: var(--ui-info); }
    .btn-action-delete { background: var(--ui-danger-soft); color: var(--ui-danger-fg) !important; border-color: var(--ui-danger-border); }
    .btn-action-delete:hover { background: var(--ui-danger); color: #fff !important; border-color: var(--ui-danger); }
    .btn-action-return { background: var(--ui-warning-soft); color: var(--ui-warning-fg) !important; border-color: var(--ui-warning-border); }
    .btn-action-return:hover { background: var(--ui-warning); color: #fff !important; border-color: var(--ui-warning); }

    /* --------------------------------------------------------------- forms */

    .form-group { margin-bottom: 1rem; }
    .form-control {
        display: block;
        width: 100%;
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
        line-height: 1.4;
        color: var(--ui-text);
        background: var(--ui-surface);
        border: 1px solid var(--ui-border-strong);
        border-radius: var(--ui-radius-sm);
        transition: border-color .15s, box-shadow .15s;
    }
    .form-control::placeholder { color: var(--ui-placeholder); }
    .form-control:focus { outline: none; border-color: var(--ui-primary); box-shadow: var(--ui-ring); }
    .form-control:disabled, .form-control[readonly] { background: var(--ui-surface-hover); color: var(--ui-muted); }
    .form-control-sm { padding: 0.3125rem 0.5rem; font-size: 0.8125rem; }
    .form-control.is-invalid { border-color: var(--ui-danger); }
    select.form-control {
        appearance: none;
        padding-right: 2.25rem;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.5rem center;
        background-repeat: no-repeat;
        background-size: 1.25rem;
    }
    select.form-control[multiple] { background-image: none; padding-right: 0.75rem; }
    textarea.form-control { min-height: 5rem; }
    .invalid-feedback { display: block; margin-top: 0.25rem; font-size: 0.8125rem; color: var(--ui-danger); }

    .form-check { display: flex; align-items: center; gap: 0.5rem; min-height: 1.5rem; }
    .form-check-input {
        width: 1.125rem;
        height: 1.125rem;
        accent-color: var(--ui-primary);
        cursor: pointer;
        flex: none;
    }
    .form-check-label { margin: 0; font-weight: 400; cursor: pointer; }

    .input-group { display: flex; align-items: stretch; width: 100%; }
    .input-group > .form-control { flex: 1 1 auto; width: 1%; min-width: 0; }
    .input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
    .input-group > :not(:first-child) .btn,
    .input-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
    .input-group-append, .input-group-prepend { display: flex; }
    .input-group-text {
        display: flex;
        align-items: center;
        padding: 0 0.75rem;
        font-size: 0.875rem;
        color: var(--ui-muted);
        background: var(--ui-surface-muted);
        border: 1px solid var(--ui-border-strong);
        border-left: 0;
        border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0;
    }
    .input-group-prepend .input-group-text {
        border-left: 1px solid var(--ui-border-strong);
        border-right: 0;
        border-radius: var(--ui-radius-sm) 0 0 var(--ui-radius-sm);
        font-weight: 500;
    }
    .input-group > .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }

    /* hand-written forms: <label class="required">, <p class="form-hint">, two-column .form-grid */
    label.required::after { content: " *"; color: var(--ui-danger); }
    .form-hint { margin: 0.375rem 0 0; font-size: 0.8125rem; color: var(--ui-muted); }
    .form-grid { display: grid; gap: 0 1rem; }
    @media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    .form-section-title {
        margin: 0 0 0.75rem;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--ui-muted);
    }

    /* toggle switch: <label class="form-switch"><input type="checkbox"><span>Text</span></label> */
    .form-switch { display: inline-flex; align-items: center; gap: 0.625rem; margin: 0; cursor: pointer; font-weight: 400; }
    .form-switch input {
        appearance: none;
        position: relative;
        width: 2.5rem;
        height: 1.375rem;
        flex: none;
        border-radius: 999px;
        background: var(--ui-border-strong);
        cursor: pointer;
        transition: background .15s;
    }
    .form-switch input::before {
        content: "";
        position: absolute;
        top: 0.1875rem;
        left: 0.1875rem;
        width: 1rem;
        height: 1rem;
        border-radius: 999px;
        background: #fff;
        box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
        transition: transform .15s;
    }
    .form-switch input:checked { background: var(--ui-primary); }
    .form-switch input:checked::before { transform: translateX(1.125rem); }
    .form-switch input:focus-visible { outline: none; box-shadow: var(--ui-ring); }

    /* selectable day pill: <label class="day-chip"><input type="checkbox"><span>Sen</span></label> */
    .day-chip { position: relative; margin: 0; cursor: pointer; }
    .day-chip input { position: absolute; opacity: 0; pointer-events: none; }
    .day-chip span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 3rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--ui-text-soft);
        background: var(--ui-surface);
        border: 1px solid var(--ui-border-strong);
        border-radius: 999px;
        transition: background .15s, border-color .15s, color .15s;
    }
    .day-chip:hover span { border-color: var(--ui-primary); }
    .day-chip input:checked + span { color: #fff; background: var(--ui-primary); border-color: var(--ui-primary); }
    .day-chip input:focus-visible + span { box-shadow: var(--ui-ring); }

    /* image upload with preview (company logos) */
    .image-upload { display: flex; align-items: center; gap: 1rem; }
    .image-upload img {
        width: 4.5rem;
        height: 4.5rem;
        flex: none;
        object-fit: contain;
        padding: 0.375rem;
        border: 1px solid var(--ui-border);
        border-radius: var(--ui-radius-sm);
        background: var(--ui-surface-muted);
    }

    /* drag & drop file picker (components/file-drop.blade.php) */
    .file-drop {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        width: 100%;
        margin: 0;
        padding: 1.75rem 1rem;
        text-align: center;
        font-weight: 400;
        background: var(--ui-surface-muted);
        border: 2px dashed var(--ui-border-strong);
        border-radius: var(--ui-radius);
        cursor: pointer;
        transition: border-color .15s, background .15s;
    }
    .file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
    .file-drop:hover, .file-drop.is-dragover { border-color: var(--ui-primary); background: var(--ui-primary-soft); }
    .file-drop:focus-within { border-color: var(--ui-primary); box-shadow: var(--ui-ring); }
    .file-drop-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        margin-bottom: 0.375rem;
        font-size: 1.125rem;
        color: var(--ui-primary);
        background: var(--ui-primary-soft);
        border-radius: 999px;
    }
    .file-drop-title { font-size: 0.9375rem; font-weight: 600; color: var(--ui-text); word-break: break-all; }
    .file-drop-hint { font-size: 0.8125rem; color: var(--ui-muted); }
    .file-drop.has-file { border-style: solid; border-color: var(--ui-primary); }

    /* custom-file input */
    .custom-file { position: relative; display: block; width: 100%; height: 2.5rem; }
    .custom-file-input { position: relative; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
    .custom-file-label {
        position: absolute;
        inset: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        margin: 0;
        padding: 0 7rem 0 0.75rem;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-weight: 400;
        color: var(--ui-muted);
        background: var(--ui-surface);
        border: 1px dashed var(--ui-border-strong);
        border-radius: var(--ui-radius-sm);
    }
    .custom-file-label::after {
        content: "Pilih File";
        position: absolute;
        top: 0.25rem;
        right: 0.25rem;
        bottom: 0.25rem;
        display: flex;
        align-items: center;
        padding: 0 0.75rem;
        font-weight: 500;
        color: var(--ui-primary);
        background: var(--ui-primary-soft);
        border-radius: 0.375rem;
    }
    .custom-file-input:focus ~ .custom-file-label { border-color: var(--ui-primary); box-shadow: var(--ui-ring); }

    /* -------------------------------------------------------------- tables */

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--ui-border);
        border-radius: var(--ui-radius-sm);
    }
    .table { width: 100%; margin-bottom: 0; border-collapse: collapse; font-size: 0.875rem; }
    .table th, .table td { padding: 0.75rem 0.875rem; vertical-align: middle; border-bottom: 1px solid var(--ui-border); }
    .table thead th {
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        color: var(--ui-muted);
        text-align: left;
        background: var(--ui-surface-muted);
        white-space: nowrap;
    }
    .table tbody tr { transition: background-color .1s; }
    .table tbody tr:hover { background: var(--ui-surface-muted); }
    .table tbody tr:last-child td { border-bottom: 0; }
    .table tfoot td, .table tfoot th { font-weight: 600; background: var(--ui-surface-muted); border-top: 1px solid var(--ui-border); }
    .table-sm th, .table-sm td { padding: 0.5rem 0.625rem; }
    .table-bordered th, .table-bordered td { border-right: 1px solid var(--ui-border); }
    .table-bordered th:last-child, .table-bordered td:last-child { border-right: 0; }
    .table-no-border th, .table-no-border td { border: 0 !important; }
    .table td.text-center, .table th.text-center { text-align: center; }
    .table td.text-right, .table th.text-right { text-align: right; }
    .table td form { display: inline; }
    .table td .btn-action { margin: 0.125rem 0.375rem 0.125rem 0; }
    .table td li .btn-action { margin-left: 0.5rem; }

    /* -------------------------------------------------------------- badges */

    .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.125rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.25rem;
        white-space: nowrap;
        border-radius: 9999px;
        background: var(--ui-secondary-soft);
        color: var(--ui-secondary-fg);
    }
    .badge-primary { background: var(--ui-primary-soft); color: var(--ui-primary-fg); }
    .badge-success { background: var(--ui-success-soft); color: var(--ui-success-fg); }
    .badge-info { background: var(--ui-info-soft); color: var(--ui-info-fg); }
    .badge-warning { background: var(--ui-warning-soft); color: var(--ui-warning-fg); }
    .badge-danger { background: var(--ui-danger-soft); color: var(--ui-danger-fg); }
    .badge-secondary { background: var(--ui-secondary-soft); color: var(--ui-secondary-fg); }

    /* -------------------------------------------------------------- alerts */

    .alert {
        position: relative;
        padding: 0.875rem 1rem;
        margin-bottom: 1rem;
        font-size: 0.875rem;
        border: 1px solid transparent;
        border-radius: var(--ui-radius-sm);
    }
    .alert-success { background: var(--ui-success-soft); border-color: var(--ui-success-border); color: var(--ui-success-fg); }
    .alert-info { background: var(--ui-info-soft); border-color: var(--ui-info-border); color: var(--ui-info-fg); }
    .alert-warning { background: var(--ui-warning-soft); border-color: var(--ui-warning-border); color: var(--ui-warning-fg); }
    .alert-danger { background: var(--ui-danger-soft); border-color: var(--ui-danger-border); color: var(--ui-danger-fg); }

    /* -------------------------------------------------------------- modals */

    .modal {
        position: fixed;
        inset: 0;
        z-index: 60;
        display: none;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 1.5rem 1rem;
        background: rgb(15 23 42 / 0.5);
        backdrop-filter: blur(2px);
    }
    .modal.show { display: block; }
    .modal.fade { opacity: 0; transition: opacity .15s ease; }
    .modal.fade.in { opacity: 1; }
    .modal-dialog {
        position: relative;
        width: 100%;
        max-width: 32rem;
        margin: 1.5rem auto;
        transform: translateY(-0.75rem) scale(0.98);
        transition: transform .2s ease;
    }
    .modal.in .modal-dialog { transform: none; }
    .modal-sm { max-width: 24rem; }
    .modal-lg { max-width: 48rem; }
    .modal-xl { max-width: 72rem; }
    .modal-content {
        display: flex;
        flex-direction: column;
        background: var(--ui-surface);
        border-radius: 1rem;
        box-shadow: var(--ui-shadow-lg);
    }
    .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--ui-border);
    }
    .modal-title { margin: 0; font-size: 1.0625rem; font-weight: 600; }
    .modal-body { padding: 1.25rem; }
    .modal-footer {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        padding: 0.875rem 1.25rem;
        border-top: 1px solid var(--ui-border);
        background: var(--ui-surface-muted);
        border-radius: 0 0 1rem 1rem;
    }
    .close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        font-size: 1.5rem;
        line-height: 1;
        color: var(--ui-muted);
        background: transparent;
        border: 0;
        border-radius: 0.5rem;
        cursor: pointer;
    }
    .close:hover { color: var(--ui-text); background: var(--ui-surface-hover); }
    body.modal-open { overflow: hidden; }

    /* ----------------------------------------------------------- pagination */

    .pagination-wrap { margin-top: 1rem; }
}

/*
|--------------------------------------------------------------------------
| Third-party widgets (unlayered on purpose: they must beat the plugin CSS
| that pages load after this file, e.g. jquery-ui.css)
|--------------------------------------------------------------------------
*/

/* DataTables 1.10 (loaded without its own stylesheet) */
.dataTables_wrapper { position: relative; font-size: 0.875rem; }
.dataTables_wrapper::after { content: ""; display: table; clear: both; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: 0.75rem; color: var(--ui-muted); }
.dataTables_wrapper .dataTables_length { float: left; }
.dataTables_wrapper .dataTables_filter { float: right; }
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    margin: 0 0.375rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus { outline: none; border-color: var(--ui-primary); box-shadow: var(--ui-ring); }
.dataTables_wrapper .dataTables_info { float: left; padding-top: 1rem; color: var(--ui-muted); }
.dataTables_wrapper .dataTables_paginate { float: right; padding-top: 0.75rem; display: flex; gap: 0.25rem; }
.dataTables_wrapper .dataTables_paginate span { display: inline-flex; gap: 0.25rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.125rem;
    height: 2.125rem;
    padding: 0 0.625rem;
    color: var(--ui-text-soft) !important;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    cursor: pointer;
    text-decoration: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--ui-surface-hover); }
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    color: #fff !important;
    background: var(--ui-primary);
    border-color: var(--ui-primary);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.dataTables_wrapper .dataTables_processing {
    position: absolute;
    top: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 0.5rem 1rem;
    color: var(--ui-primary);
    font-weight: 500;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: 9999px;
    box-shadow: var(--ui-shadow);
}
table.dataTable { border-collapse: collapse !important; }
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc { cursor: pointer; position: relative; padding-right: 1.5rem; }
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    position: absolute;
    right: 0.5rem;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.65rem;
    opacity: 0.35;
    content: "\f0dc";
}
table.dataTable thead .sorting_asc::after { content: "\f0de"; opacity: 0.9; color: var(--ui-primary); }
table.dataTable thead .sorting_desc::after { content: "\f0dd"; opacity: 0.9; color: var(--ui-primary); }
table.dataTable td.dataTables_empty { text-align: center; color: var(--ui-muted); padding: 2rem; }
.table-responsive > .dataTables_wrapper { padding: 0.75rem; }

/* Select2 4.0 */
body .select2-container--default .select2-selection--single,
body .select2-container--default .select2-selection--multiple {
    min-height: 2.5rem;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
}
body .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 2.375rem; padding-left: 0.75rem; color: var(--ui-text); }
body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 2.375rem; right: 0.375rem; }
body .select2-container--default.select2-container--focus .select2-selection--multiple,
body .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--ui-primary); box-shadow: var(--ui-ring); }
body .select2-dropdown { border-color: var(--ui-border-strong); border-radius: var(--ui-radius-sm); overflow: hidden; box-shadow: var(--ui-shadow-lg); z-index: 70; }
body .select2-container--default .select2-search--dropdown .select2-search__field { border-color: var(--ui-border-strong); border-radius: 0.375rem; padding: 0.375rem 0.5rem; }
body .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--ui-primary); }
body .select2-container--open { z-index: 70; }

/* jQuery UI datepicker */
body .ui-datepicker {
    z-index: 80 !important;
    padding: 0.5rem;
    font-family: var(--ui-font);
    font-size: 0.8125rem;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-lg);
    background: var(--ui-surface);
}
body .ui-datepicker .ui-datepicker-header { background: transparent; border: 0; color: var(--ui-text); font-weight: 600; }
body .ui-datepicker .ui-datepicker-prev,
body .ui-datepicker .ui-datepicker-next { cursor: pointer; border-radius: 0.375rem; }
body .ui-datepicker .ui-state-hover.ui-datepicker-prev,
body .ui-datepicker .ui-state-hover.ui-datepicker-next { background: var(--ui-surface-hover); border: 0; }
body .ui-datepicker th { color: var(--ui-muted); font-weight: 500; }
body .ui-datepicker .ui-state-default {
    text-align: center;
    background: transparent;
    border: 0;
    border-radius: 0.375rem;
    color: var(--ui-text);
    padding: 0.375rem;
}
body .ui-datepicker .ui-state-default.ui-state-hover { background: var(--ui-surface-hover); }
body .ui-datepicker .ui-state-highlight { background: var(--ui-primary-soft); color: var(--ui-primary-fg); }
body .ui-datepicker .ui-state-active { background: var(--ui-primary); color: #fff; }
body .ui-datepicker select { border: 1px solid var(--ui-border-strong); border-radius: 0.375rem; padding: 0.125rem 0.25rem; margin: 0 0.125rem; }

/* SweetAlert2 */
body .swal2-popup { border-radius: 1rem; font-family: var(--ui-font); }
body .swal2-styled.swal2-confirm { background-color: var(--ui-primary) !important; border-radius: var(--ui-radius-sm); }
body .swal2-styled.swal2-cancel { border-radius: var(--ui-radius-sm); }
body .swal2-container { z-index: 90; }

/* Dark theme for the widgets above that bring their own light colors */
html.dark .select2-container--default .select2-selection--single,
html.dark .select2-container--default .select2-selection--multiple,
html.dark .select2-dropdown,
html.dark .select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--ui-surface);
    color: var(--ui-text);
}
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--ui-surface-hover);
    border-color: var(--ui-border-strong);
    color: var(--ui-text);
}
html.dark .select2-container--default .select2-results__option[aria-selected="true"] { background: var(--ui-surface-hover); }
html.dark .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--ui-placeholder); }
html.dark body .ui-datepicker .ui-widget-header,
html.dark body .ui-datepicker .ui-widget-content { background: var(--ui-surface); color: var(--ui-text); }
html.dark body .swal2-popup { background: var(--ui-surface); }
html.dark body .swal2-title,
html.dark body .swal2-content,
html.dark body .swal2-html-container { color: var(--ui-text); }
html.dark body .swal2-icon.swal2-success [class^=swal2-success-circular-line],
html.dark body .swal2-icon.swal2-success .swal2-success-fix { background: var(--ui-surface) !important; }

/* Theme switch in the top bar */
.theme-toggle .theme-icon-light { display: none; }
html.dark .theme-toggle .theme-icon-light { display: inline-block; }
html.dark .theme-toggle .theme-icon-dark { display: none; }

/* Laravel paginator (tailwind view) sits inside cards */
nav[role="navigation"] { margin-top: 1rem; }
