/* Metronic 8.3 Design System & Theme Customization for MyBengkel ERP */
:root {
    --kt-primary: #3E97FF;
    --kt-primary-active: #2884EF;
    --kt-primary-light: #EEF6FF;
    --kt-success: #50CD89;
    --kt-success-light: #E8FFF3;
    --kt-info: #7239EA;
    --kt-info-light: #F8F5FF;
    --kt-warning: #FFC700;
    --kt-warning-light: #FFF8DD;
    --kt-danger: #F1416C;
    --kt-danger-light: #FFF5F8;
    --kt-dark: #1E1E2D;
    --kt-body-bg: #F5F8FA;
    --kt-card-bg: #FFFFFF;
    --kt-text-gray-800: #181C32;
    --kt-text-gray-600: #5E6278;
    --kt-text-gray-400: #A1A5B7;
    --kt-border-color: #EFF2F5;
    --kt-sidebar-bg: #1E1E2D;
    --kt-sidebar-text: #92929F;
    --kt-sidebar-hover: #1B1B28;
    --kt-sidebar-active: #009EF7;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --kt-radius: 0.625rem;
    --kt-shadow: 0px 0px 20px 0px rgba(76, 87, 125, 0.02);
}

[data-bs-theme="dark"] {
    --kt-body-bg: #151521;
    --kt-card-bg: #1E1E2D;
    --kt-text-gray-800: #FFFFFF;
    --kt-text-gray-600: #92929F;
    --kt-text-gray-400: #565674;
    --kt-border-color: #2B2B40;
    --kt-sidebar-bg: #14141F;
}

*, *::before, *::after {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--kt-body-bg);
    color: var(--kt-text-gray-800);
    font-size: 0.95rem;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--kt-text-gray-800);
}

/* Metronic Header & Layout */
.app-header {
    height: 70px;
    background-color: var(--kt-card-bg);
    border-bottom: 1px solid var(--kt-border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 265px;
    background-color: var(--kt-sidebar-bg);
    color: var(--kt-sidebar-text);
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-menu {
    flex-grow: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
}

.menu-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08rem;
    color: #4C4E6F;
    padding: 0.75rem 1rem 0.35rem 1rem;
}

.menu-item {
    margin-bottom: 0.25rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    color: #92929F;
    text-decoration: none;
    border-radius: 0.475rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-link:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.05);
}

.menu-link.active {
    color: #FFFFFF;
    background: linear-gradient(90deg, #3E97FF 0%, #2884EF 100%);
    box-shadow: 0px 4px 12px rgba(62, 151, 255, 0.35);
}

.menu-icon {
    margin-right: 0.75rem;
    font-size: 1.15rem;
    width: 1.5rem;
    display: inline-flex;
    justify-content: center;
    color: inherit;
}

.menu-title {
    flex-grow: 1;
}

.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-content {
    flex-grow: 1;
    padding: 1.75rem 2rem;
}

.app-footer {
    height: 55px;
    background-color: var(--kt-card-bg);
    border-top: 1px solid var(--kt-border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    font-size: 0.85rem;
    color: var(--kt-text-gray-600);
}

/* Card Styling */
.card {
    background-color: var(--kt-card-bg);
    border: 1px solid var(--kt-border-color);
    border-radius: var(--kt-radius);
    box-shadow: var(--kt-shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--kt-border-color);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.15rem;
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Badges */
.badge-light-primary {
    background-color: var(--kt-primary-light);
    color: var(--kt-primary);
}
.badge-light-success {
    background-color: var(--kt-success-light);
    color: var(--kt-success);
}
.badge-light-warning {
    background-color: var(--kt-warning-light);
    color: #D69E2E;
}
.badge-light-danger {
    background-color: var(--kt-danger-light);
    color: var(--kt-danger);
}
.badge-light-info {
    background-color: var(--kt-info-light);
    color: var(--kt-info);
}

/* Buttons */
.btn-primary {
    background-color: var(--kt-primary);
    border-color: var(--kt-primary);
}
.btn-primary:hover {
    background-color: var(--kt-primary-active);
    border-color: var(--kt-primary-active);
}

/* Windows Spotlight Command Palette (Ctrl+K) */
.spotlight-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.spotlight-modal {
    width: 100%;
    max-width: 640px;
    background: var(--kt-card-bg);
    border: 1px solid var(--kt-border-color);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: spotlightPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spotlightPop {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.spotlight-search-bar {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--kt-border-color);
}

.spotlight-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    color: var(--kt-text-gray-800);
    width: 100%;
    margin-left: 0.75rem;
}

.spotlight-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.75rem;
}

.spotlight-search-item-row:hover,
.spotlight-app-card:hover,
.spotlight-quick-card:hover {
    background: rgba(62, 151, 255, 0.18) !important;
    border-color: rgba(62, 151, 255, 0.5) !important;
    transform: translateY(-2px);
}
.spotlight-app-card:hover .text-white-50 {
    color: #FFFFFF !important;
}

.spotlight-shortcut-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--kt-border-color);
    border-radius: 0.35rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--kt-text-gray-600);
}

/* Split Bill multi-payment UI */
.split-bill-card {
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 0.75rem;
    padding: 1rem;
}

/* Custom Table */
.table thead th {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-weight: 600;
    color: var(--kt-text-gray-600);
    border-bottom: 1px solid var(--kt-border-color);
    padding: 0.85rem 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--kt-border-color);
}

/* Dashboard polish */
.app-sidebar {
    background: linear-gradient(180deg, #101828 0%, #151f35 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    background: rgba(255, 255, 255, 0.025);
}

.app-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
}

.app-content {
    max-width: 100% !important;
    width: 100%;
    padding: 1.75rem 2rem;
}

/* Metronic Solid Form Controls & Small Default Sizing */
.form-control,
.form-select,
.form-control-solid,
.form-select-solid {
    background-color: #F5F8FA;
    border-color: #F5F8FA;
    color: var(--kt-text-gray-800);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.form-control:focus,
.form-select:focus,
.form-control-solid:focus,
.form-select-solid:focus {
    background-color: #EEF6FF;
    border-color: var(--kt-primary);
    color: var(--kt-text-gray-800);
    box-shadow: none;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control-solid,
[data-bs-theme="dark"] .form-select-solid {
    background-color: #1B1B29;
    border-color: #1B1B29;
    color: #FFFFFF;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control-solid:focus,
[data-bs-theme="dark"] .form-select-solid:focus {
    background-color: #212133;
    border-color: var(--kt-primary);
    color: #FFFFFF;
}

/* Clean Modern ERP Table Design (Matching User Specification) */
.table-erp {
    border-collapse: separate;
    border-spacing: 0;
    width: 100% !important;
}

.table-erp thead th {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06rem;
    font-weight: 700;
    color: #8898AA;
    border-bottom: 1px solid #E9ECEF;
    padding: 1rem 0.85rem;
    background-color: #FFFFFF;
}

.table-erp thead tr.filter-row th {
    padding: 0.5rem 0.4rem !important;
    background-color: #FAFCFE;
    border-bottom: 1px solid #E2E8F0;
}

.table-erp thead tr.filter-row th input.col-search,
.table-erp thead tr.filter-row th select.col-search {
    font-size: 0.78rem;
    font-weight: 400;
    padding: 0.4rem 0.65rem;
    border-radius: 0.45rem;
    border: 1px solid #E2E8F0;
    background-color: #FFFFFF;
    color: #1E293B;
    transition: all 0.2s ease;
}

.table-erp thead tr.filter-row th input.col-search:focus,
.table-erp thead tr.filter-row th select.col-search:focus {
    border-color: #3E97FF;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(62, 151, 255, 0.12);
}

.table-erp tbody tr {
    transition: background-color 0.15s ease;
}

.table-erp tbody tr:hover {
    background-color: #F8FAFC !important;
}

.table-erp tbody td {
    padding: 0.85rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.88rem;
    color: #334155;
}

/* ERP Soft Badge Pills */
.badge-code-pill {
    background-color: #EEF6FF;
    color: #2563EB;
    font-weight: 700;
    font-family: var(--font-heading);
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.02rem;
}

.badge-sub-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-erp-action {
    background-color: #F1F5F9;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.45rem;
    border: none;
    transition: all 0.2s ease;
}

.btn-erp-action:hover {
    background-color: #E2E8F0;
    color: #0F172A;
}

.card-custom,
.card {
    border: 1px solid rgba(16, 24, 40, 0.07);
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.045);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-custom:hover,
.card:hover {
    border-color: rgba(62, 151, 255, 0.18);
    box-shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
}

.card-header {
    padding: 1.25rem 1.5rem;
}

.btn {
    border-radius: 0.65rem;
    font-weight: 600;
}



.table > :not(caption) > * > * {
    border-color: #f0f2f5;
}

/* Animations */
.animate-pulse-slow {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.18);
    }

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

    .app-content {
        padding: 1.25rem;
    }
}
