/**
 * KARYANUSA INTERIOR - SHADCN UI GLOBAL THEME ENGINE
 * Standardizes design tokens, inputs, buttons, cards, modals, tables, and filters
 * across all Blade templates (Master, Transaksi, Laporan, and Modals).
 */

:root {
    --shad-background: #ffffff;
    --shad-foreground: #09090b;
    --shad-card: #ffffff;
    --shad-card-foreground: #09090b;
    --shad-primary: #18181b;
    --shad-primary-foreground: #fafafa;
    --shad-secondary: #f4f4f5;
    --shad-secondary-foreground: #18181b;
    --shad-muted: #f4f4f5;
    --shad-muted-foreground: #71717a;
    --shad-border: #e4e4e7;
    --shad-accent-gold: #c59b27;
    --shad-accent-gold-hover: #a87d19;
    --shad-radius-sm: 0.45rem;
    --shad-radius-input: 0.65rem;
    --shad-radius-btn: 0.65rem;
    --shad-radius-card: 0.85rem;
    --shad-radius-modal: 1.15rem;
    --shad-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shad-shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.06);
    --shad-shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] {
    --shad-background: #100e0c;
    --shad-foreground: #f5ede2;
    --shad-card: #181411;
    --shad-card-foreground: #f5ede2;
    --shad-primary: #c59b27;
    --shad-primary-foreground: #14100c;
    --shad-secondary: #241e19;
    --shad-secondary-foreground: #e6dfd5;
    --shad-muted: #241e19;
    --shad-muted-foreground: #a89887;
    --shad-border: rgba(197, 155, 39, 0.18);
    --shad-accent-gold: #c59b27;
    --shad-accent-gold-hover: #dbb33e;
    --shad-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shad-shadow-md: 0 6px 20px -2px rgba(0, 0, 0, 0.4);
    --shad-shadow-lg: 0 16px 40px -4px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   1. GLOBAL FORM CONTROLS (INPUTS, SELECTS, TEXTAREAS)
   ========================================================================== */
.form-control,
.form-select,
.form-control-sm,
.form-select-sm,
.form-select[readonly],
textarea.form-control {
    border-radius: var(--shad-radius-input) !important;
    border: 1px solid var(--shad-border) !important;
    background-color: var(--shad-card) !important;
    color: var(--shad-foreground) !important;
    font-size: 0.875rem !important;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
}

.form-control:not(.form-control-sm),
.form-select:not(.form-select-sm) {
    padding: 0.6rem 0.95rem !important;
    min-height: 40px;
}

.form-control-sm,
.form-select-sm {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.8125rem !important;
    min-height: 34px;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--shad-accent-gold) !important;
    box-shadow: 0 0 0 3.5px rgba(197, 155, 39, 0.18) !important;
    background-color: var(--shad-card) !important;
    color: var(--shad-foreground) !important;
    outline: none !important;
}

/* Modal Lookups input with readonly but active pointer */
.form-select[readonly] {
    cursor: pointer !important;
    background-color: var(--shad-card) !important;
    opacity: 1 !important;
}

.form-select[readonly]:hover {
    border-color: var(--shad-accent-gold) !important;
}

.form-control[disabled],
.form-select:disabled {
    background-color: var(--shad-secondary) !important;
    color: var(--shad-muted-foreground) !important;
    opacity: 0.85;
    cursor: not-allowed;
    border-color: var(--shad-border) !important;
}

.form-label,
label.form-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--shad-muted-foreground) !important;
    margin-bottom: 0.35rem !important;
    letter-spacing: 0.01em;
}

/* ==========================================================================
   1.1 FORM ICONS & EMBEDDED INPUT ICONS (No Overlapping Placeholders)
   ========================================================================== */
.form-icon {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

/* Left Icon Container: ensure icon is properly positioned and centered vertically */
.form-icon:not(.right) > i,
.form-icon:not(.right) > [class^="ri-"],
.form-icon:not(.right) > [class*=" ri-"],
.form-icon:not(.right) > [class^="bx-"],
.form-icon:not(.right) > [class*=" bx-"],
.form-icon:not(.right) > [class^="mdi-"],
.form-icon:not(.right) > [class*=" mdi-"] {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.05rem !important;
    color: var(--shad-muted-foreground) !important;
    pointer-events: none !important;
    z-index: 4 !important;
    line-height: 1 !important;
    transition: color 0.2s ease !important;
}

/* Input with Icon on Left: Generous padding-left so placeholder and input never collide with icon */
.form-icon:not(.right) > .form-control,
.form-icon:not(.right) > .form-control-sm,
.form-icon:not(.right) > .form-control-icon,
.form-control-icon:not(.form-control-icon-right) {
    padding-left: 2.5rem !important;
    padding-right: 0.75rem !important;
}

.form-icon:not(.right) > .form-control:not(.form-control-sm) {
    padding-left: 2.75rem !important;
    padding-right: 0.95rem !important;
}

/* Right Icon / Suffix Container (e.g., Hari, search icon) */
.form-icon.right > i,
.form-icon.right > [class^="ri-"],
.form-icon.right > [class*=" ri-"],
.form-icon.right > [class^="bx-"],
.form-icon.right > [class*=" bx-"],
.form-icon.right > [class^="mdi-"],
.form-icon.right > [class*=" mdi-"],
.form-icon.right > .search-widget-icon {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0.85rem !important;
    left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-style: normal !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--shad-muted-foreground) !important;
    pointer-events: none !important;
    z-index: 4 !important;
    line-height: 1 !important;
    transition: color 0.2s ease !important;
}

/* Input with Icon or Suffix on Right: Generous padding-right */
.form-icon.right > .form-control,
.form-icon.right > .form-control-sm,
.form-icon.right > .form-control-icon,
.form-icon.right > .search-widget-icon {
    padding-left: 0.75rem !important;
    padding-right: 2.75rem !important;
}

.form-icon.right > .form-control:not(.form-control-sm) {
    padding-left: 0.95rem !important;
    padding-right: 3rem !important;
}

/* Search Box Support */
.search-box {
    position: relative !important;
}

.search-box > .form-control,
.search-box > input {
    padding-left: 2.5rem !important;
}

.search-box > i,
.search-box > .search-icon {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    color: var(--shad-muted-foreground) !important;
    pointer-events: none !important;
    z-index: 4 !important;
    line-height: 1 !important;
}

/* Password Toggle Support */
.auth-pass-inputgroup input,
.form-control.pe-5,
.form-control-sm.pe-5 {
    padding-right: 3rem !important;
}

/* Focus states for embedded icons */
.form-icon:focus-within > i,
.form-icon:focus-within > [class^="ri-"],
.form-icon:focus-within > [class*=" ri-"],
.form-icon:focus-within > [class^="bx-"],
.form-icon:focus-within > [class*=" bx-"],
.form-icon:focus-within > [class^="mdi-"],
.form-icon:focus-within > [class*=" mdi-"],
.search-box:focus-within > i,
.search-box:focus-within > .search-icon {
    color: var(--shad-accent-gold) !important;
}

/* ==========================================================================
   2. UNIFIED INPUT GROUPS (SEAMLESS CURVATURE & NO SQUARE EDGES)
   ========================================================================== */
.input-group,
.input-group-sm {
    border-radius: var(--shad-radius-input) !important;
    transition: all 0.2s ease;
}

.input-group > :first-child,
.input-group > .input-group-text:first-child,
.input-group > .form-control:first-child,
.input-group > .form-select:first-child {
    border-top-left-radius: var(--shad-radius-input) !important;
    border-bottom-left-radius: var(--shad-radius-input) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > :last-child,
.input-group > .input-group-text:last-child,
.input-group > .form-control:last-child,
.input-group > .form-select:last-child,
.input-group > .btn:last-child {
    border-top-right-radius: var(--shad-radius-input) !important;
    border-bottom-right-radius: var(--shad-radius-input) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

.input-group-text {
    background-color: var(--shad-secondary) !important;
    color: var(--shad-muted-foreground) !important;
    border: 1px solid var(--shad-border) !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 0.85rem !important;
}

.input-group:focus-within > .input-group-text {
    border-color: var(--shad-accent-gold) !important;
}

/* ==========================================================================
   3. GLOBAL BUTTONS (SHADCN RADIUS & LIFT INTERACTIONS)
   ========================================================================== */
.btn {
    border-radius: var(--shad-radius-btn) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    padding: 0.55rem 1.25rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-sm {
    padding: 0.38rem 0.85rem !important;
    font-size: 0.8125rem !important;
    border-radius: calc(var(--shad-radius-btn) - 0.1rem) !important;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1.5px) !important;
}

.btn:active:not(:disabled) {
    transform: translateY(0) !important;
}

/* Specific High-Contrast Filter Toolbar Buttons (Refresh is never white) */
#btn-filter,
button#btn-filter,
.btn#btn-filter,
.btn-filter {
    background: linear-gradient(135deg, #d4af37 0%, #a87d19 100%) !important;
    border: none !important;
    color: #14100c !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.28) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    text-shadow: none !important;
}

#btn-filter:hover,
button#btn-filter:hover {
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45) !important;
    color: #14100c !important;
}

#btn-filter i,
#btn-filter span {
    color: #14100c !important;
    font-weight: 700 !important;
}

[data-bs-theme="dark"] #btn-filter,
[data-bs-theme="dark"] button#btn-filter {
    background: linear-gradient(135deg, #c59b27 0%, #927014 100%) !important;
    color: #14100c !important;
}

#btn-clear-filter,
button#btn-clear-filter,
.btn#btn-clear-filter,
.btn-clear-filter {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
}

#btn-clear-filter:hover,
button#btn-clear-filter:hover {
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4) !important;
    color: #ffffff !important;
}

#btn-clear-filter i,
#btn-clear-filter span {
    color: #ffffff !important;
}

/* Success Buttons (Green) */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22) !important;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35) !important;
    color: #ffffff !important;
}

/* Info Buttons */
.btn-info {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2) !important;
}

/* Danger Buttons */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22) !important;
}

/* Secondary / Light Buttons */
.btn-secondary,
.btn-light {
    background-color: var(--shad-secondary) !important;
    color: var(--shad-foreground) !important;
    border: 1px solid var(--shad-border) !important;
    box-shadow: var(--shad-shadow-sm) !important;
}

.btn-secondary:hover:not(:disabled),
.btn-light:hover:not(:disabled) {
    background-color: var(--shad-border) !important;
    color: var(--shad-foreground) !important;
}

/* Close Buttons */
.btn-close {
    border-radius: 50% !important;
    padding: 0.5rem !important;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ==========================================================================
   4. CARDS & COLLAPSIBLE FILTER TOOLBARS
   ========================================================================== */
.card {
    background-color: var(--shad-card) !important;
    border: 1px solid var(--shad-border) !important;
    border-radius: var(--shad-radius-card) !important;
    box-shadow: var(--shad-shadow-md) !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--shad-card) !important;
    border-bottom: 1px solid var(--shad-border) !important;
    padding: 1rem 1.4rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.35rem 1.4rem !important;
}

.card-footer {
    background-color: var(--shad-secondary) !important;
    border-top: 1px solid var(--shad-border) !important;
    padding: 0.9rem 1.4rem !important;
}

/* Upgrade Legacy Cyan/Blue Filter Headers to Luxury Modern Filter Bar */
.card-body.bg-info,
.card-header.bg-info {
    background: linear-gradient(135deg, rgba(197, 155, 39, 0.12) 0%, rgba(197, 155, 39, 0.04) 100%) !important;
    border-bottom: 1px solid var(--shad-border) !important;
    color: var(--shad-foreground) !important;
    padding: 0.85rem 1.4rem !important;
}

.card-body.bg-info a,
.card-body.bg-info a span,
.card-body.bg-info a i {
    color: var(--shad-foreground) !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
    text-decoration: none !important;
    letter-spacing: 0.02em;
}

[data-bs-theme="dark"] .card-body.bg-info a span,
[data-bs-theme="dark"] .card-body.bg-info a i {
    color: #f7d88c !important;
}

/* Filter collapse border */
.collapse.border-top-dashed {
    border-top: 1px solid var(--shad-border) !important;
    background-color: var(--shad-card);
}

/* ==========================================================================
   5. MODALS (LUXURY SHADCN ELEVATION & ROUNDED DIALOGS)
   ========================================================================== */
.modal-content {
    background-color: var(--shad-card) !important;
    color: var(--shad-foreground) !important;
    border: 1px solid var(--shad-border) !important;
    border-radius: var(--shad-radius-modal) !important;
    box-shadow: var(--shad-shadow-lg) !important;
    overflow: hidden;
}

.modal-header {
    background-color: var(--shad-secondary) !important;
    border-bottom: 1px solid var(--shad-border) !important;
    padding: 1.15rem 1.5rem !important;
    border-top-left-radius: var(--shad-radius-modal) !important;
    border-top-right-radius: var(--shad-radius-modal) !important;
}

.modal-title {
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    color: var(--shad-foreground) !important;
}

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

.modal-footer {
    background-color: var(--shad-secondary) !important;
    border-top: 1px solid var(--shad-border) !important;
    padding: 1rem 1.5rem !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ==========================================================================
   6. DATATABLES & STANDARD TABLES (CLEAN, SPACED, AND ACCENTED)
   ========================================================================== */
.table {
    width: 100% !important;
    min-width: 100% !important;
    color: var(--shad-foreground) !important;
    border-color: var(--shad-border) !important;
    margin-bottom: 0 !important;
    vertical-align: middle;
}

.table thead th {
    background-color: var(--shad-secondary) !important;
    color: var(--shad-muted-foreground) !important;
    font-weight: 600 !important;
    font-size: 0.785rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border-bottom: 1px solid var(--shad-border) !important;
    padding: 0.8rem 1rem !important;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--shad-border) !important;
    font-size: 0.85rem !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(197, 155, 39, 0.05) !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.015) !important;
}

/* ==========================================================================
   6.0. TRANSACTION DETAIL TABLES (100% PROPORTIONAL & NATURAL FIT)
   ========================================================================== */
.table-responsive:has(#dynamic-table),
.table-responsive:has(#table-item),
.table-responsive > .card:has(#dynamic-table),
.table-responsive > .card:has(#table-item) {
    width: 100% !important;
    border-radius: var(--shad-radius-card) !important;
    border: 1px solid var(--shad-border) !important;
    background-color: var(--shad-card) !important;
    box-shadow: none !important;
    margin-bottom: 0.75rem !important;
    min-height: 150px !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
}

#dynamic-table,
#table-item,
table[id^="dynamic-table"] {
    width: 100% !important;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

#dynamic-table thead,
#table-item thead {
    background-color: var(--shad-secondary) !important;
}

#dynamic-table thead th,
#table-item thead th {
    background-color: var(--shad-secondary) !important;
    color: var(--shad-muted-foreground) !important;
    font-weight: 700 !important;
    font-size: 0.785rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 0.75rem 0.85rem !important;
    border-bottom: 1px solid var(--shad-border) !important;
    border-top: none !important;
    vertical-align: middle !important;
}

#dynamic-table thead th:first-child,
#table-item thead th:first-child {
    border-top-left-radius: var(--shad-radius-card) !important;
}

#dynamic-table thead th:last-child,
#table-item thead th:last-child {
    border-top-right-radius: var(--shad-radius-card) !important;
}

#dynamic-table tbody td,
#table-item tbody td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.85rem !important;
    border-bottom: 1px solid var(--shad-border) !important;
    color: var(--shad-foreground) !important;
    vertical-align: middle !important;
    word-break: break-word !important;
}

#dynamic-table tbody tr:hover,
#table-item tbody tr:hover {
    background-color: rgba(197, 155, 39, 0.04) !important;
}

#dynamic-table thead th:first-child,
#table-item thead th:first-child {
    border-top-left-radius: var(--shad-radius-card) !important;
}

#dynamic-table thead th:last-child,
#table-item thead th:last-child {
    border-top-right-radius: var(--shad-radius-card) !important;
}

#dynamic-table tbody td,
#table-item tbody td {
    padding: 0.8rem 1rem !important;
    font-size: 0.85rem !important;
    border-bottom: 1px solid var(--shad-border) !important;
    color: var(--shad-foreground) !important;
    vertical-align: middle !important;
}

#dynamic-table tbody tr:hover,
#table-item tbody tr:hover {
    background-color: rgba(197, 155, 39, 0.04) !important;
}

/* ==========================================================================
   6.0.1. AUDIT / OPERATOR & TAX CONTROLS ALIGNMENT
   ========================================================================== */
.row:has(#upduser),
.row:has(#upddate) {
    align-items: flex-start !important;
}

#nilaitax,
input#nilaitax {
    border-radius: var(--shad-radius-input) !important;
    border: 1px solid var(--shad-input) !important;
    background-color: var(--shad-background) !important;
    color: var(--shad-foreground) !important;
    text-align: right !important;
    font-size: 0.8125rem !important;
    padding: 0.25rem 0.5rem !important;
    outline: none !important;
    box-shadow: none !important;
}

#nilaitax:focus,
input#nilaitax:focus {
    border-color: var(--shad-ring) !important;
}

#fgtax,
select#fgtax {
    border-radius: var(--shad-radius-input) !important;
    border: 1px solid var(--shad-input) !important;
    background-color: var(--shad-background) !important;
    color: var(--shad-foreground) !important;
    font-size: 0.8125rem !important;
    padding: 0.25rem 0.5rem !important;
    outline: none !important;
}

/* ==========================================================================
   6.1. ULTRA-MODERN PAGINATION & GO-TO-PAGE TOOLBAR
   ========================================================================== */
#divPagination,
.text-center#divPagination,
div#divPagination,
[id^="pagination"],
.dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    width: 100% !important;
    text-align: center !important;
}

.pagination,
#divPagination .pagination,
[id^="pagination"] .pagination {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    margin: 0 auto !important;
    padding: 0 !important;
    list-style: none !important;
}

.pagination .page-item {
    display: inline-block !important;
    margin: 0 !important;
}

.pagination .page-item .page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: var(--shad-radius-sm) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--shad-foreground) !important;
    background-color: var(--shad-card) !important;
    border: 1px solid var(--shad-border) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    box-shadow: var(--shad-shadow-sm) !important;
    user-select: none !important;
}

.pagination .page-item .page-link:hover:not(.active) {
    background-color: var(--shad-secondary) !important;
    border-color: var(--shad-accent-gold) !important;
    color: var(--shad-accent-gold) !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 4px 12px rgba(197, 155, 39, 0.18) !important;
}

.pagination .page-item.active .page-link,
.pagination .page-item .page-link.active {
    background: linear-gradient(135deg, #d4af37 0%, #a87d19 100%) !important;
    border-color: #d4af37 !important;
    color: #14100c !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35) !important;
    transform: none !important;
}

.pagination .page-item.disabled .page-link,
.pagination .page-item.disabled span.page-link {
    opacity: 0.5 !important;
    cursor: default !important;
    background-color: var(--shad-secondary) !important;
    border-color: var(--shad-border) !important;
    color: var(--shad-muted-foreground) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Elegant Pill Container for Go-To-Page Widget (Fixes awkward left/stacking layout) */
#divPaginationGoTo,
div#divPaginationGoTo,
.col-md-6#divPaginationGoTo,
.row#divPaginationGoTo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    width: auto !important;
    max-width: fit-content !important;
    margin: 0.65rem auto 1.5rem auto !important;
    padding: 0.35rem 0.95rem !important;
    background-color: var(--shad-secondary) !important;
    border: 1px solid var(--shad-border) !important;
    border-radius: 9999px !important;
    box-shadow: var(--shad-shadow-sm) !important;
    float: none !important;
}

/* Reset Bootstrap Grid inside Go-To Widget */
#divPaginationGoTo > div,
#divPaginationGoTo .col-md-2 {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Label "Page" inside widget */
#divPaginationGoTo > div:first-child {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: var(--shad-muted-foreground) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    margin-right: 0.15rem !important;
}

/* Input txt-go-to */
#divPaginationGoTo input#txt-go-to,
#divPaginationGoTo input.form-control {
    width: 52px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0.2rem 0.35rem !important;
    text-align: center !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    border-radius: var(--shad-radius-sm) !important;
    border: 1px solid var(--shad-border) !important;
    background-color: var(--shad-card) !important;
    color: var(--shad-foreground) !important;
    transition: all 0.2s ease !important;
}

#divPaginationGoTo input#txt-go-to:focus {
    border-color: var(--shad-accent-gold) !important;
    box-shadow: 0 0 0 2.5px rgba(197, 155, 39, 0.2) !important;
    outline: none !important;
}

/* Button Go inside widget */
#divPaginationGoTo button#btn-go,
#divPaginationGoTo .btn#btn-go {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0.2rem 0.8rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    border-radius: var(--shad-radius-sm) !important;
    background: linear-gradient(135deg, #d4af37 0%, #a87d19 100%) !important;
    border: none !important;
    color: #14100c !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    float: none !important;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#divPaginationGoTo button#btn-go:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.42) !important;
    color: #14100c !important;
}

/* Native DataTables Paginate Buttons */
.dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.25rem !important;
    margin-top: 0.75rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--shad-radius-sm) !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    border: 1px solid var(--shad-border) !important;
    background: var(--shad-card) !important;
    color: var(--shad-foreground) !important;
    margin: 0 2px !important;
    cursor: pointer !important;
    box-shadow: var(--shad-shadow-sm) !important;
    transition: all 0.2s ease !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: var(--shad-secondary) !important;
    border-color: var(--shad-accent-gold) !important;
    color: var(--shad-accent-gold) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #d4af37 0%, #a87d19 100%) !important;
    border-color: #d4af37 !important;
    color: #14100c !important;
    font-weight: 700 !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--shad-muted-foreground) !important;
    padding-top: 0.85rem !important;
}

/* Badges */
.badge {
    border-radius: 9999px !important;
    padding: 0.35rem 0.65rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   7. TRANSACTION SUMMARY CARDS & CALCULATIONS (PENJUALAN, PEMBELIAN, PO)
   ========================================================================== */
.summary-container {
    background-color: var(--shad-secondary) !important;
    border: 1px solid var(--shad-border) !important;
    border-radius: var(--shad-radius-card) !important;
    padding: 1.25rem !important;
}

.summary-row {
    border-bottom: 1px dashed var(--shad-border) !important;
    padding: 0.5rem 0 !important;
}

.summary-label {
    color: var(--shad-muted-foreground) !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
}

.grand-total-row {
    background: var(--shad-secondary) !important;
    border: 1px solid var(--shad-border) !important;
    border-radius: var(--shad-radius-sm) !important;
    padding: 0.65rem 1rem !important;
}

.grand-total-label {
    color: var(--shad-foreground) !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.grand-total-input {
    color: var(--shad-accent-gold) !important;
    font-weight: 800 !important;
    font-size: 1.25rem !important;
    background: transparent !important;
    border: none !important;
    text-align: right !important;
}

/* Modernizing .invoice-table across all transaction forms */
.invoice-table {
    width: 100% !important;
    background: var(--shad-card) !important;
    border: 1px solid var(--shad-border) !important;
    border-radius: var(--shad-radius-card) !important;
    box-shadow: var(--shad-shadow-sm) !important;
    overflow: hidden !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.invoice-table table {
    width: 100% !important;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.invoice-table td,
.invoice-table th,
.invoice-table table td,
.invoice-table table th {
    padding: 0.6rem 1rem !important;
    vertical-align: middle !important;
    border-bottom: 1px dashed var(--shad-border) !important;
    border-top: none !important;
}

/* Grand Total highlight row in invoice-table */
.invoice-table table tbody tr:last-child td,
.invoice-table table tbody tr:last-child th,
.invoice-table tr:has(#grandtotal) td,
.invoice-table tr:has(#grandtotal) th,
.invoice-table table tr:has(#grandtotal) td,
.invoice-table table tr:has(#grandtotal) th {
    border-bottom: none !important;
    border-top: 2px solid var(--shad-border) !important;
    background: var(--shad-secondary) !important;
    padding: 0.75rem 1rem !important;
}

/* Grand Total text label */
.invoice-table tr:has(#grandtotal) th,
.invoice-table table tr:has(#grandtotal) th,
.invoice-table th:has(+ td #grandtotal) {
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    color: var(--shad-foreground) !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
}

/* Summary input fields & Grand Total (uniform size, borders, and background) */
.invoice-table input.form-control,
.invoice-table table input.form-control,
.invoice-table input#grandtotal,
.invoice-table table input#grandtotal,
.grand-total-input,
input#grandtotal {
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    text-align: right !important;
    background-color: var(--shad-card) !important;
    border: 1px solid var(--shad-border) !important;
    border-radius: var(--shad-radius-sm) !important;
    color: var(--shad-foreground) !important;
    padding: 0.25rem 0.5rem !important;
    box-shadow: none !important;
    height: auto !important;
}

/* User and Waktu styling (clean and compact) */
.row:has(#upduser) > .col-md-4,
.row:has(#upduser) > .col-lg-5 {
    padding-top: 0.4rem !important;
    font-size: 0.8125rem !important;
    color: var(--shad-muted-foreground) !important;
}

.row:has(#upduser) label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--shad-muted-foreground) !important;
    margin-bottom: 0.2rem !important;
}

.row:has(#upduser) p {
    font-weight: 700 !important;
    color: var(--shad-foreground) !important;
}

/* ==========================================================================
   8. RESPONSIVE OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 991px) {
    .row:has(#upduser) > .col-md-4,
    .row:has(#upduser) > .col-md-8 {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1rem !important;
    }
    .card-footer.hstack {
        flex-wrap: wrap;
    }
    .card-footer.hstack > div {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    .card-footer.hstack .btn {
        width: 100%;
    }
}

/* ==========================================================================
   9. FLOATING & BACK TO TOP BUTTON (FIXED FOR ALL VIEWPORTS)
   ========================================================================== */
#back-to-top,
.btn#back-to-top,
.btn-icon#back-to-top {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 0 !important;
    border-radius: var(--shad-radius-sm, 6px) !important;
    position: fixed !important;
    right: 20px !important;
    bottom: 30px !important;
    z-index: 1050 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

#back-to-top i,
.btn#back-to-top i {
    font-size: 18px !important;
    line-height: 1 !important;
    margin: 0 auto !important;
    display: inline-block !important;
}

@media (min-width: 769px) {
    #back-to-top,
    .btn#back-to-top,
    .btn-icon#back-to-top {
        bottom: 50px !important;
        right: 28px !important;
    }
}
