/* =========================================================
   Wortel - Modern Theme Overlay
   Purpose: Modernize the entire UI on top of the existing
   Bootstrap 4 markup without breaking any layouts.
   Loaded AFTER style.css so its rules win.
   ========================================================= */

:root {
    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-700: #3730a3;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;

    --success: #10b981;
    --success-50: #ecfdf5;
    --warning: #f59e0b;
    --warning-50: #fffbeb;
    --danger: #ef4444;
    --danger-50: #fef2f2;
    --info: #06b6d4;
    --info-50: #ecfeff;

    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 4px 12px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, .08), 0 4px 10px -4px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, .12);

    --sidebar-w: 232px;
    --sidebar-w-collapsed: 76px;
    --navbar-h: 64px;

    --grad-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --grad-success: linear-gradient(135deg, #34d399 0%, #059669 100%);
    --grad-warning: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    --grad-danger:  linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    --grad-info:    linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --grad-violet:  linear-gradient(135deg, #c084fc 0%, #7c3aed 100%);
}

/* ---------- Base ---------- */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1.0625rem; }
h6 { font-size: 0.95rem; }

a { color: var(--primary); transition: color .15s ease; }
a:hover { color: var(--primary-600); text-decoration: none; }

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

::selection { background: var(--primary-100); color: var(--primary-700); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Sidebar ---------- */
.side-navigation.col-md-1,
.side-navigation.bg-blue {
    flex: 0 0 var(--sidebar-w);
    max-width: var(--sidebar-w);
    width: var(--sidebar-w);
    background-color: #1e1b4b !important;
    background-image: linear-gradient(180deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%) !important;
    box-shadow: 0 0 30px rgba(15, 23, 42, .08);
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 0 !important;
}

.side-navigation::-webkit-scrollbar { width: 6px; }
.side-navigation::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); }

.side-header {
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
    padding: 18px 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--navbar-h);
}

.header-logo {
    width: auto !important;
    max-width: 140px !important;
    margin: 0 auto !important;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .15));
}

.list-group {
    padding: 14px 12px;
    margin-bottom: 0 !important;
    border: none;
}

.list-group-item {
    background: transparent !important;
    color: rgba(255, 255, 255, .72) !important;
    border-radius: 10px !important;
    border: none !important;
    text-align: center;
    padding: 12px 8px !important;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all .2s ease;
    position: relative;
    line-height: 1.3;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
}

.list-group-item.active {
    background: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.list-group-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

.list-group-item .icon {
    font-size: 20px !important;
    display: block;
    margin-bottom: 6px;
    opacity: .9;
}

.list-group-item .icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* ---------- Right content / layout ---------- */
.right-content.col-md-11 {
    flex: 0 0 calc(100% - var(--sidebar-w));
    max-width: calc(100% - var(--sidebar-w));
    left: 0 !important;
    margin-left: var(--sidebar-w);
    background: var(--bg);
    min-height: 100vh;
}

.full-height {
    min-height: 100vh;
    height: auto;
}

/* ---------- Top header / navbar ---------- */
.header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 0 24px !important;
    min-width: calc(100% - var(--sidebar-w)) !important;
    width: calc(100% - var(--sidebar-w));
    height: var(--navbar-h);
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
    z-index: 50;
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
}

.header > .row {
    width: 100%;
    align-items: center;
    margin: 0;
}

.header span,
.header span strong {
    color: var(--text);
    font-size: 14px;
}

.header span strong {
    font-weight: 600;
    color: var(--primary);
}

.header .menu-icon {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.header .menu-icon li {
    padding: 0 !important;
    list-style: none;
}

.header .menu-icon li a {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-muted) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}

.header .menu-icon li a:hover {
    background: var(--primary-50);
    color: var(--primary) !important;
}

.header .menu-icon li.text-red a:hover {
    background: var(--danger-50);
    color: var(--danger) !important;
}

.header .menu-icon li a svg {
    width: 18px !important;
    height: 18px !important;
}

/* ---------- Content area ---------- */
.content {
    margin-top: var(--navbar-h) !important;
    padding: 0 12px;
}

.content > .col-md-12 {
    padding: 24px 12px 8px;
}

.content h5.font-size-18 {
    font-size: 1.375rem !important;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem !important;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem !important;
    min-height: 60px;
}

.card-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--text);
    margin-bottom: 0;
    letter-spacing: -0.01em;
}

.card-body { padding: 1.25rem 1.5rem; }
.card-body.p-0 { padding: 0 !important; }

.card-footer {
    background: var(--surface-2) !important;
    border-top: 1px solid var(--border);
    padding: .85rem 1.5rem !important;
}

/* Stat / metric cards on dashboard */
.card .card-body.bg-success,
.card .card-body.bg-primary,
.card .card-body.bg-info,
.card .card-body.bg-danger,
.card .card-body.bg-warning {
    border-radius: var(--radius-lg) !important;
    padding: 1.25rem 1.5rem !important;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.card .card-body.bg-success { background: var(--grad-success) !important; }
.card .card-body.bg-primary { background: var(--grad-violet) !important; }
.card .card-body.bg-info { background: var(--grad-info) !important; }
.card .card-body.bg-danger { background: var(--grad-success) !important; }
.card .card-body.bg-warning { background: var(--grad-warning) !important; }

.card .card-body[class*="bg-"] h6 {
    color: rgba(255,255,255,.85) !important;
    font-size: .8125rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

.card .card-body[class*="bg-"] h5 {
    color: #fff !important;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.card .card-body[class*="bg-"] h4.small {
    color: rgba(255,255,255,.85) !important;
    font-size: .8125rem;
    font-weight: 500;
    margin-bottom: 0;
}

/* ---------- Tables ---------- */
.table {
    margin-bottom: 0;
    color: var(--text);
}

.table thead th {
    background: var(--surface-2);
    color: var(--text-muted) !important;
    font-size: .75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding: .85rem 1rem !important;
    white-space: nowrap;
}

.table tbody td {
    padding: .85rem 1rem !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text);
    font-size: .875rem !important;
    font-weight: 400 !important;
    vertical-align: middle !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: var(--surface-2) !important;
}

.table-hover tbody tr:hover,
.table tbody tr:hover {
    background: var(--primary-50) !important;
    transition: background .12s ease;
}

.table tbody tr td a:hover { text-decoration: none; }

.table-bordered, .table-bordered th, .table-bordered td {
    border-color: var(--border) !important;
}

.card-table tr td:first-child,
.card-table tr th:first-child { padding-left: 1.5rem !important; }
.card-table tr td:last-child,
.card-table tr th:last-child { padding-right: 1.5rem !important; }

.table-responsive {
    border-radius: 0;
    margin: 0 !important;
}

/* ---------- Forms ---------- */
.form-label {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: .375rem;
}

.form-group { margin-bottom: 1rem; }

.form-control {
    height: auto;
    padding: .55rem .85rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: var(--shadow-xs);
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15) !important;
    outline: 0;
}

.form-control::placeholder { color: var(--text-soft); font-weight: 400; }

.form-control.input-sm,
.input-sm.form-control {
    padding: .45rem .75rem !important;
    font-size: .8125rem !important;
}

select.form-control {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3e%3cpath d='M4.5 6.5L8 10l3.5-3.5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.25rem !important;
}

textarea.form-control { min-height: 90px; }

.form-line .form-control {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
    border-top: 1px solid var(--border) !important;
    border-right: 1px solid var(--border) !important;
    border-left: 1px solid var(--border) !important;
    margin-right: 0 !important;
    min-width: auto;
}

.input-group-text {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
}

.invalid-feedback { font-size: .8125rem; color: var(--danger) !important; }

/* ---------- Buttons ---------- */
.btn {
    font-size: .875rem;
    font-weight: 500;
    padding: .5rem 1rem;
    line-height: 1.45;
    border-radius: var(--radius);
    transition: all .15s ease;
    box-shadow: var(--shadow-xs);
    letter-spacing: -0.005em;
    border: 1px solid transparent;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:focus, .btn.focus { box-shadow: 0 0 0 3px rgba(79, 70, 229, .2) !important; }

.btn-sm {
    font-size: .8125rem;
    padding: .375rem .75rem;
    border-radius: 8px;
}

.btn-xs, .btn-group-xs > .btn {
    font-size: .75rem !important;
    padding: .3rem .6rem !important;
    border-radius: 6px;
}

.btn-flat { box-shadow: none; }
.btn-flat:hover { box-shadow: var(--shadow-sm); }

.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.btn-primary:hover {
    background: var(--primary-600) !important;
    border-color: var(--primary-600) !important;
    color: #fff !important;
}
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background: var(--primary-700) !important;
    border-color: var(--primary-700) !important;
}
.btn-primary.disabled, .btn-primary:disabled {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    opacity: .6;
}

.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}
.btn-success:hover { background: #059669 !important; border-color: #059669 !important; color: #fff !important; }

.btn-warning {
    background: var(--warning) !important;
    border-color: var(--warning) !important;
    color: #fff !important;
}
.btn-warning:hover { background: #d97706 !important; border-color: #d97706 !important; color: #fff !important; }

.btn-danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}
.btn-danger:hover { background: #dc2626 !important; border-color: #dc2626 !important; color: #fff !important; }

.btn-info {
    background: var(--info) !important;
    border-color: var(--info) !important;
    color: #fff !important;
}
.btn-info:hover { background: #0891b2 !important; border-color: #0891b2 !important; color: #fff !important; }

.btn-secondary {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
.btn-secondary:hover {
    background: var(--surface-2) !important;
    border-color: var(--border-strong) !important;
    color: var(--text) !important;
}

.btn-light {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.btn-outline-primary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

.btn-block { width: 100%; }

.btn .fe, .btn .fa {
    font-size: .875em;
    margin-right: .25rem;
    vertical-align: middle;
}

/* ---------- Badges / status ---------- */
.badge {
    font-weight: 500;
    padding: .35em .65em;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    letter-spacing: .01em;
}

.badge-success { background: var(--success-50); color: #065f46 !important; }
.badge-warning { background: var(--warning-50); color: #92400e !important; }
.badge-danger { background: var(--danger-50); color: #991b1b !important; }
.badge-info { background: var(--info-50); color: #155e75 !important; }
.badge-primary { background: var(--primary-50); color: var(--primary-700) !important; }
.badge-secondary { background: var(--surface-2); color: var(--text-muted) !important; }
.badge-pill { border-radius: var(--radius-pill); }

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--radius) !important;
    padding: .85rem 1rem !important;
    border: 1px solid transparent !important;
    font-size: .875rem;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: 1rem;
}

.alert ul { padding-left: 1.25rem; margin-bottom: 0; }
.alert li { padding: .15rem 0; }

.alert-success {
    background: var(--success-50) !important;
    color: #065f46 !important;
    border-color: #a7f3d0 !important;
}
.alert-warning {
    background: var(--warning-50) !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}
.alert-danger {
    background: var(--danger-50) !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}
.alert-info {
    background: var(--info-50) !important;
    color: #155e75 !important;
    border-color: #a5f3fc !important;
}

/* ---------- Modals ---------- */
.modal-content {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border) !important;
    padding: 1rem 1.5rem !important;
}

.modal-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
}

.modal-body { padding: 1.25rem 1.5rem !important; }

.modal-footer {
    border-top: 1px solid var(--border) !important;
    padding: .85rem 1.5rem !important;
    background: var(--surface-2);
}

.modal-header .close {
    color: var(--text-muted);
    text-shadow: none;
    opacity: .8;
    font-size: 1.5rem;
    transition: opacity .15s;
}
.modal-header .close:hover { opacity: 1; }

/* ---------- Pagination ---------- */
.pagination .page-link {
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--surface);
    margin: 0 2px;
    border-radius: 8px !important;
    min-width: 36px;
    text-align: center;
    padding: .375rem .65rem;
    font-size: .8125rem;
    transition: all .15s ease;
}
.pagination .page-link:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-100);
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    background: var(--surface-2);
    color: var(--text-soft);
}

/* ---------- Footer ---------- */
.footer {
    height: auto;
    padding: 24px 0;
    margin-top: 32px;
    position: relative !important;
    border-top: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
}

/* ---------- Tabs ---------- */
.nav-tabs {
    border-bottom: 1px solid var(--border);
}
.nav-tabs .nav-link {
    color: var(--text-muted);
    font-size: .875rem;
    font-weight: 500;
    border: none;
    padding: .75rem 1rem;
    border-bottom: 2px solid transparent;
    transition: all .15s ease;
}
.nav-tabs .nav-link:hover {
    background: transparent;
    color: var(--text);
    border-bottom-color: var(--border-strong);
}
.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* ---------- Avatar ---------- */
.avatar {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}
.avatar-xxl {
    box-shadow: var(--shadow);
    border: 4px solid var(--surface);
}

/* ---------- Status icons ---------- */
.status-icon {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
}

/* ---------- Misc ---------- */
.contact-list li {
    color: var(--text-muted);
    font-size: .8125rem;
    padding-right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.balance-box {
    border-left: 1px solid var(--border) !important;
    padding-left: 1.5rem;
}

/* Bootstrap collapse spacing fix for filter blocks */
.card-header > #accordion {
    width: 100%;
}

#collapseOne.collapse.show,
#collapseOne.collapsing {
    padding-top: .75rem;
}

/* Filter button row in card-header */
.card-header > div[id="accordion"] > .btn,
.card-header > div[id="accordion"] > a.btn {
    margin-left: 4px;
}

/* Page title block */
.content > .col-md-12 > div > h5.font-size-18 {
    display: inline-block;
    position: relative;
}

/* Text colors */
.text-muted, small.text-muted { color: var(--text-muted) !important; }
.text-red { color: var(--danger); }

/* Accordion */
.accordion .card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .5rem; }
.accordion .card .card-header a { color: var(--text); font-weight: 500; }

/* Responsive sidebar - mobile */
@media (max-width: 991.98px) {
    .side-navigation.col-md-1 {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        z-index: 1050;
        transition: left .25s ease;
        flex: 0 0 var(--sidebar-w);
        max-width: var(--sidebar-w);
        width: var(--sidebar-w);
    }
    .side-navigation.col-md-1.active {
        left: 0;
        box-shadow: var(--shadow-lg);
    }
    .right-content.col-md-11 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0 !important;
    }
    .header {
        left: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        padding: 0 16px !important;
    }
    .header .menu-icon.d-block {
        order: -1;
    }
    /* Mobile sidebar trigger button */
    a#sideButton {
        background: var(--surface-2);
        color: var(--text) !important;
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .header > .row > .col-6:first-of-type {
        flex: 0 0 auto;
        max-width: 60px;
    }
    .header > .row > .col-6:last-of-type {
        flex: 1;
    }
}

/* Backdrop when mobile sidebar opens */
@media (max-width: 991.98px) {
    .side-navigation.col-md-1.active::after {
        content: "";
        position: fixed;
        top: 0;
        left: var(--sidebar-w);
        width: calc(100vw - var(--sidebar-w));
        height: 100vh;
        background: rgba(15, 23, 42, .4);
        z-index: -1;
    }
}

/* ---------- Login page ---------- */
body.login-page {
    background: var(--bg);
}

.login-left-box.col-md-6 {
    background: var(--grad-primary) !important;
    background-image: var(--grad-primary), url('../image/bg-login.png') !important;
    background-blend-mode: overlay !important;
    background-size: cover !important;
    position: relative;
    overflow: hidden;
}
.login-left-box.col-md-6::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,.15), transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,.1), transparent 40%);
    pointer-events: none;
}
.login-left-box .bg-blue-transparent {
    background: rgba(255, 255, 255, .12) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--radius-lg) !important;
    padding: 1.5rem !important;
}
.login-left-box .bg-blue-transparent h1 {
    font-size: 2.25rem !important;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.form-login {
    padding: 0 12% !important;
    max-width: 480px;
    margin: 0 auto;
}
.form-login h5 {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: var(--text);
    padding-bottom: .25rem !important;
    margin-bottom: .25rem !important;
}
.form-login p { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }

.form-login .input-group .input-group-append .input-group-text {
    border-left: 0 !important;
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.form-login .input-group .form-control:focus + .input-group-append .input-group-text {
    border-color: var(--primary) !important;
}

/* Hide harsh login footer absolute positioning */
.login-left-box p[style*="bottom"] {
    color: rgba(255,255,255,.85) !important;
    padding: 1rem 2rem !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    text-align: center;
}

/* ---------- Mobile / responsive overrides ---------- */
@media (max-width: 575.98px) {
    .header {
        background: var(--surface) !important;
    }
    .header .menu-icon li { padding: 0; }
    .form-login { padding: 0 6% !important; }
    .card-body { padding: 1rem; }
    .card-header { padding: .85rem 1rem !important; }
    .table thead th, .table tbody td { padding: .65rem .75rem !important; font-size: .8125rem !important; }
}

/* ---------- Utilities ---------- */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }

.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-pill { border-radius: var(--radius-pill) !important; }

/* Animation on content entry */
.animate.fadeIns { animation-duration: .25s !important; animation-delay: 0s !important; }

/* Float (FAB) */
.float a {
    background: var(--primary) !important;
    box-shadow: var(--shadow-md);
    border-radius: 16px !important;
    width: 56px !important;
    height: 56px !important;
}
.float a:hover { background: var(--primary-600) !important; }

/* No-data states */
.table tbody tr td[colspan] {
    color: var(--text-soft);
    font-style: italic;
    padding: 2rem !important;
    text-align: center !important;
}

/* Filter chip / search button inline forms */
.form-line {
    background: var(--surface-2);
    padding: 12px;
    border-radius: var(--radius);
    margin-top: .5rem;
}
.form-line .form-group { margin-bottom: .5rem; }

/* Datepicker */
.datepicker.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 8px;
}
.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover {
    background: var(--primary-50) !important;
    color: var(--primary) !important;
}

/* Round circle client cards (penjualan/client.blade.php) */
.card-body .row > div[style*="border-radius:50%"] {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm);
    transition: all .2s ease;
    border-radius: var(--radius-lg) !important;
    min-height: 140px !important;
    max-height: none !important;
    padding: 20px 12px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.card-body .row > div[style*="border-radius:50%"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-100);
}
.card-body .row > div[style*="border-radius:50%"] a {
    color: var(--text);
    text-decoration: none;
    width: 100%;
}
.card-body .row > div[style*="border-radius:50%"] a:hover { color: var(--primary); }
.card-body .row > div[style*="border-radius:50%"] i.fa { color: var(--primary); }
.card-body .row > div[style*="border-radius:50%"] h6 {
    font-size: .875rem;
    font-weight: 600;
    margin-top: .5rem;
    margin-bottom: 0;
}

/* Print/PDF style guards (don't apply modern overrides to PDFs) */
@media print {
    .side-navigation, .header, .footer { display: none !important; }
    .right-content.col-md-11 { margin-left: 0 !important; max-width: 100% !important; flex: 0 0 100% !important; }
}


/* ============================================================
   Additional polish - second pass
   ============================================================ */

/* Year/folder picker grid (penjualan/year, tagihan/year) */
.card-body > .row > .col-md-3.text-center > a,
.card-body > .row > .col-md-2.text-center > a {
    display: block;
    padding: 24px 12px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all .2s ease;
    box-shadow: var(--shadow-xs);
    margin: 8px 0;
}
.card-body > .row > .col-md-3.text-center > a:hover,
.card-body > .row > .col-md-2.text-center > a:hover {
    transform: translateY(-2px);
    border-color: var(--primary-100);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}
.card-body > .row > .col-md-3.text-center i.fa-folder,
.card-body > .row > .col-md-3.text-center i.fa-folder-open {
    color: var(--primary);
    font-size: 2.5rem !important;
    margin-bottom: .5rem;
}
.card-body > .row > .col-md-3.text-center h5 {
    margin-top: .5rem;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--text);
}

/* Disabled / readonly form fields */
.form-control:disabled,
.form-control[readonly] {
    background: var(--surface-2) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 1;
}

/* Datetime-local inputs alignment */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    line-height: 1.5;
}

/* Image preview inside forms */
.form-group img[style*="max-width:100%"],
.form-group img[style*="max-width: 100%"] {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    margin-bottom: .5rem;
}

/* Custom file input styling */
.custom-file {
    height: auto;
}
.custom-file-label {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .55rem .85rem;
    font-size: .875rem;
    color: var(--text-muted);
    background: var(--surface);
}
.custom-file-label::after {
    background: var(--surface-2);
    color: var(--text);
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: 1px solid var(--border);
    padding: .55rem 1rem;
}
.custom-file-input:focus ~ .custom-file-label {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

/* Tooltips */
.tooltip-inner {
    background: var(--text) !important;
    color: #fff;
    border-radius: 6px;
    font-size: .75rem;
    padding: .35rem .55rem;
}
.tooltip.bs-tooltip-top .arrow::before { border-top-color: var(--text) !important; }
.tooltip.bs-tooltip-bottom .arrow::before { border-bottom-color: var(--text) !important; }
.tooltip.bs-tooltip-left .arrow::before { border-left-color: var(--text) !important; }
.tooltip.bs-tooltip-right .arrow::before { border-right-color: var(--text) !important; }

/* Action button cluster on table row (Edit / Approve / Detail / Print) */
.table td.text-right .btn,
.table td .btn {
    margin: 2px;
}
.table td.text-right .btn small {
    font-size: .75rem;
    font-weight: 500;
}

/* Status pill helpers (when getStatus returns spans) */
.table .badge,
.table .label {
    display: inline-block;
    padding: .35em .65em;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 500;
}

/* Inline forms in card-header (filter row + add button) */
.card-header > #accordion {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.card-header > #accordion > .btn,
.card-header > #accordion > a.btn {
    align-self: flex-end;
    margin-left: 4px;
}
.card-header > #accordion > .btn + a.btn,
.card-header > #accordion > .btn + .btn {
    margin-left: 4px;
}
/* Group filter trigger + add button on the same row */
.card-header > #accordion::before {
    content: "";
}

/* The filter expandable area inside accordion */
.card-header #collapseOne {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    text-align: left;
}
.card-header #collapseOne.show,
.card-header #collapseOne.collapsing {
    padding: 14px 14px 6px;
    margin-top: 6px;
}
.card-header #collapseOne .form-line {
    background: transparent;
    padding: 0;
    margin: 0;
}
.card-header #collapseOne .form-line .form-control {
    background: var(--surface);
}

/* Search submit button inside collapse */
.card-header #collapseOne .text-right .btn {
    margin-top: 4px;
}

/* Top-of-page client info row (penjualan/index) */
.row.no-margin.bg-white {
    background: var(--surface) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem !important;
    margin: 0 0 1rem 0 !important;
    box-shadow: var(--shadow-xs);
}
.row.no-margin.bg-white h5 {
    font-weight: 600;
    color: var(--text);
}
.row.no-margin.bg-white .balance-box label {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 600;
}
.row.no-margin.bg-white .balance-box h4 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
}
.row.no-margin.bg-white .balance-box h4 sup {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: .25rem;
}

/* PDF / print views safety: don't restyle if body has class pdf */
body.pdf-document, body.pdf-document * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Ensure feather icons render inline correctly */
em[data-feather] svg,
i[data-feather] svg {
    display: inline-block;
    vertical-align: middle;
}

/* Form footer (login button row) */
.form-footer { margin-top: 1.25rem; }

/* Empty state row - "No Data" cells */
tr td[colspan]:only-child {
    background: var(--surface-2);
}

/* Card shadow lift on hover for dashboard metric cards */
.row.mb-2 .card:hover .card-body[class*="bg-"] {
    transform: translateY(-2px);
    transition: transform .2s ease;
}


/* ============================================================
   Page-specific polish - third pass
   ============================================================ */

/* Stock page - colored table headers */
body .table thead th[style*="background"] {
    color: #1e293b !important;
    font-weight: 600 !important;
    font-size: .75rem !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-color: var(--border) !important;
}

/* Stock matrix - table cell borders */
.stock-matrix th,
.stock-matrix td {
    border: 1px solid var(--border) !important;
    text-align: center;
    padding: .5rem .75rem !important;
    font-size: .8125rem !important;
}

/* Pelunasan two-column layout */
.pelunasan-grid > .col-md-6 {
    border-radius: var(--radius);
    padding: 16px !important;
    margin-bottom: 1rem;
}
.pelunasan-grid > .col-md-6.bayar {
    background: var(--success-50) !important;
    border: 1px solid #a7f3d0;
}
.pelunasan-grid > .col-md-6.tagihan {
    background: var(--danger-50) !important;
    border: 1px solid #fecaca;
}
.pelunasan-grid h5 {
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: .5rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(15,23,42,.08);
}

/* Section headers (form panels) */
.card-header h5.card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.card-header h5.card-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 3px;
}

/* Tutup Transaksi banner */
.overlay {
    background: rgba(15, 23, 42, .55) !important;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.overlay h1 {
    color: #fff !important;
    font-weight: 700;
    background: var(--danger);
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 1.5rem !important;
    letter-spacing: .04em;
}

/* Form file upload preview */
.form-group img {
    max-width: 100%;
    border-radius: var(--radius);
    margin-bottom: .5rem;
}

/* Page header bar (used at top of show pages) */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-xs);
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header .page-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
}
.page-header .page-subtitle {
    color: var(--text-muted);
    font-size: .8125rem;
    margin-top: .15rem;
}

/* Read-only data display rows */
.detail-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    padding: .65rem 0;
    border-bottom: 1px dashed var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .detail-label {
    color: var(--text-muted);
    font-size: .8125rem;
    font-weight: 500;
}
.detail-row .detail-value {
    color: var(--text);
    font-size: .9rem;
    word-break: break-word;
}

/* Section divider */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.25rem 0 .85rem;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Badge pills inside getStatus() returns - if used unstyled */
table .badge.badge-warning,
table span.badge.badge-warning {
    background: var(--warning-50) !important;
    color: #92400e !important;
}
table .badge.badge-success,
table span.badge.badge-success {
    background: var(--success-50) !important;
    color: #065f46 !important;
}
table .badge.badge-danger,
table span.badge.badge-danger {
    background: var(--danger-50) !important;
    color: #991b1b !important;
}

/* Card with two-column form layout - left/right card */
.row > .col-md-5 > .card.mb-3,
.row > .col-md-7 > .card.mb-3 {
    height: calc(100% - 1rem);
}

/* Inputs inside the input-group with small button */
.input-group .input-group-append .input-group-text {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-muted);
    font-size: .8125rem;
    font-weight: 500;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.input-group .input-group-prepend .input-group-text,
.input-group .input-group-prepend ~ .input-group-append .input-group-text {
    border-radius: var(--radius) 0 0 var(--radius);
}

/* Progress bar */
.progress {
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    height: 8px;
    overflow: hidden;
}
.progress-bar {
    background: var(--primary);
    border-radius: var(--radius-pill);
}

/* Float ellipsis in long table cells */
.table td ul {
    margin: 0;
    padding-left: 1rem;
    font-size: .8125rem;
    line-height: 1.5;
}
.table td ul li {
    list-style: disc;
    padding: 0;
}

/* Tagihan/Pelunasan tables nested */
.card-body > .row > .col-md-6 .table thead tr th {
    background: rgba(255,255,255,.6) !important;
}

/* Filter card-header layout */
.card-header {
    flex-direction: column;
    align-items: stretch;
}
.card-header > .d-flex.flex-wrap {
    width: 100%;
}

/* Page subheader (small action row above the card) */
.page-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: .5rem;
}
