/* WMS — form & interaction layer */
:root {
    --wms-primary: #2563eb;
    --wms-primary-dark: #1d4ed8;
    --wms-surface: #f8fafc;
    --wms-page-bg: #f1f5f9;
    --wms-border: #e2e8f0;
    --wms-radius: 0.75rem;
    --wms-shadow: 0 1px 3px rgb(15 23 42 / 8%), 0 8px 24px rgb(15 23 42 / 6%);
}

/* Layout & brand */
.app-main,
.content-wrapper {
    background-color: var(--wms-page-bg) !important;
}
.brand-image {
    height: 2.25rem;
    width: 2.25rem;
    object-fit: contain;
}
.sidebar-menu .nav-icon,
.app-sidebar .nav-icon {
    width: 1.5rem;
    font-size: 1.2rem;
    opacity: 0.95;
    margin-right: 0.15rem;
}
.nav-sidebar .nav-link.active {
    border-radius: 0.5rem;
    font-weight: 600;
}

/* Dashboard stat tiles */
.wms-stat-card {
    background: #fff;
    border-radius: var(--wms-radius);
    padding: 1.25rem;
    border: 1px solid var(--wms-border);
    box-shadow: var(--wms-shadow);
    position: relative;
    overflow: hidden;
    height: 100%;
}
.wms-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.wms-stat-primary::before { background: var(--wms-primary); }
.wms-stat-success::before { background: #22c55e; }
.wms-stat-warning::before { background: #f59e0b; }
.wms-stat-danger::before { background: #ef4444; }
.wms-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--wms-surface);
    color: var(--wms-primary);
}
.wms-stat-success .wms-stat-icon { color: #16a34a; }
.wms-stat-warning .wms-stat-icon { color: #d97706; }
.wms-stat-danger .wms-stat-icon { color: #dc2626; }
.wms-stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}
.wms-stat-label {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.15rem;
}
.wms-stat-icon-lg {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.75rem;
    background: var(--wms-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Login */
.login-page .login-box,
.register-page .register-box {
    width: min(420px, 92vw);
}
.login-page .login-logo a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #0f172a;
    font-weight: 700;
    font-size: 1.35rem;
}
.login-page .login-logo img {
    border-radius: 0.75rem;
    box-shadow: var(--wms-shadow);
}
.login-page .card {
    border: none;
    border-radius: var(--wms-radius);
    box-shadow: 0 16px 48px rgb(15 23 42 / 12%);
}

.wms-content {
    max-width: 1320px;
}

/* Page header */
.wms-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.wms-page-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
}
.wms-page-header .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

/* Form shell */
.wms-form {
    position: relative;
    padding-bottom: 5rem;
}
.wms-form-card {
    background: #fff;
    border: 1px solid var(--wms-border);
    border-radius: var(--wms-radius);
    box-shadow: var(--wms-shadow);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.wms-form-card .card-header {
    background: var(--wms-surface);
    border-bottom: 1px solid var(--wms-border);
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wms-form-card .card-header i {
    color: var(--wms-primary);
}
.wms-form-card .card-body {
    padding: 1.25rem;
}

/* Field */
.wms-field {
    margin-bottom: 1rem;
}
.wms-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}
.wms-field label .text-danger {
    font-weight: 400;
}
.wms-field .form-control,
.wms-field .form-select,
.wms-field .select2-container {
    border-radius: 0.5rem;
}
.wms-field .form-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}
.wms-field.is-invalid .form-control {
    border-color: #dc3545;
}

/* Input group icons */
.wms-input-icon {
    position: relative;
}
.wms-input-icon > i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 4;
    pointer-events: none;
}
.wms-input-icon .form-control,
.wms-input-icon .form-select {
    padding-left: 2.35rem;
}

/* Sticky actions */
.wms-form-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--wms-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    box-shadow: 0 -4px 20px rgb(15 23 42 / 8%);
}
@media (min-width: 992px) {
    .layout-fixed .main-sidebar ~ .wms-form-actions {
        left: 300px;
    }
}

/* Transaction lines */
.wms-lines-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.wms-lines-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}
.wms-lines-stats strong {
    color: #0f172a;
}

.wms-line-row {
    border: 1px solid var(--wms-border);
    border-radius: var(--wms-radius);
    margin-bottom: 0.75rem;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
    animation: wmsLineIn 0.25s ease-out;
}
.wms-line-row:hover {
    border-color: #cbd5e1;
    box-shadow: var(--wms-shadow);
}
.wms-line-row.is-focused {
    border-color: var(--wms-primary);
    box-shadow: 0 0 0 3px rgb(13 110 253 / 15%);
}
@keyframes wmsLineIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.wms-line-row .line-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--wms-surface);
    border-bottom: 1px solid var(--wms-border);
    cursor: pointer;
    user-select: none;
}
.wms-line-row .line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--wms-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}
.wms-line-row .line-title {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wms-line-row .line-body {
    padding: 1rem;
}
.wms-line-row .line-body.collapsed {
    display: none;
}
.wms-line-extra {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px dashed var(--wms-border);
}
.wms-line-extra-toggle {
    font-size: 0.8125rem;
    color: var(--wms-primary);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}
.wms-line-extra-panel {
    display: none;
    margin-top: 0.75rem;
}
.wms-line-extra-panel.show {
    display: block;
}

/* Barcode scan zone */
.wms-scan-zone {
    border: 2px dashed #93c5fd;
    border-radius: var(--wms-radius);
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s, background 0.2s;
}
.wms-scan-zone.is-active {
    border-color: var(--wms-primary);
    border-style: solid;
    background: #eff6ff;
}
.wms-scan-zone .scan-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: var(--wms-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 0.75rem;
}
.wms-scan-feedback {
    font-size: 0.8125rem;
    min-height: 1.25rem;
    margin-top: 0.5rem;
}
.wms-scan-feedback.success { color: #16a34a; }
.wms-scan-feedback.error { color: #dc2626; }

.wms-barcode-preview svg {
    max-width: 100%;
    height: auto;
    max-height: 72px;
}
.wms-barcode-result-icon {
    font-size: 1.75rem;
    line-height: 1;
}
.wms-barcode-result-empty kbd,
.wms-barcode-page-scan kbd {
    background: #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
}

/* Toast alerts */
.wms-toast-stack {
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    z-index: 1080;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.wms-toast {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #fff;
    border-left: 4px solid var(--wms-primary);
    box-shadow: var(--wms-shadow);
    animation: wmsToastIn 0.3s ease;
    font-size: 0.875rem;
}
.wms-toast.success { border-left-color: #22c55e; }
.wms-toast.danger { border-left-color: #ef4444; }
@keyframes wmsToastIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* List / index */
.wms-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.wms-search {
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}
.wms-table-card {
    border-radius: var(--wms-radius);
    border: 1px solid var(--wms-border);
    box-shadow: var(--wms-shadow);
    overflow: visible;
}
.wms-table-card .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}
.wms-table-card .table td:last-child,
.wms-table-card .table th:last-child {
    min-width: 11rem;
    white-space: nowrap;
}
.wms-table-card .table {
    margin-bottom: 0;
}
.wms-table-card .table thead th {
    background: var(--wms-surface);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 1px;
}
.wms-table-card .table tbody tr {
    transition: background 0.15s;
}
.wms-table-card .table tbody tr:hover {
    background: #f8fafc;
}

/* Login */
.wms-login-card {
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgb(15 23 42 / 12%);
    overflow: hidden;
}
.wms-login-card .login-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.select2-container--default .select2-selection--single {
    height: calc(2.25rem + 2px);
    border-radius: 0.5rem;
    border-color: #ced4da;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.25rem;
    padding-left: 0.75rem;
}

.wms-row-actions .btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
    line-height: 1.2;
}
.wms-row-actions .btn i {
    font-size: 0.95rem;
    vertical-align: -0.1em;
}

/* Sidebar — lebih besar & mudah dibaca */
.app-sidebar .brand-link {
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.85rem 1rem;
}
.app-sidebar .brand-link .brand-image {
    width: 2.5rem;
    height: 2.5rem;
}
.app-sidebar .nav-link {
    padding: 0.62rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    gap: 0.5rem;
}
.app-sidebar .nav-treeview .nav-link {
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    font-size: 0.9375rem;
}
.app-sidebar .nav-treeview .nav-icon {
    font-size: 1rem;
}
.app-sidebar .form-control.sidebar-search,
.app-sidebar input[type="search"] {
    font-size: 0.9375rem;
    padding: 0.5rem 0.75rem;
    min-height: 2.5rem;
}
.app-sidebar .sidebar-menu {
    padding: 0.5rem 0.35rem 1.25rem;
}
.wms-status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.wms-detail-dl dt {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.wms-detail-dl dd {
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}