/* RollTrace additions on top of the SkyDash theme. */

/* The logo is Hevafsid's; its lotus mark stands in where the logo would be too small to read. */
.navbar .navbar-brand-wrapper .navbar-brand img.brand-icon { width: 34px; height: 34px; border-radius: 8px; }
.brand-text { font-weight: 700; font-size: 1.25rem; color: #4B49AC; vertical-align: middle; margin-left: .4rem; }

/* Sign-in pages: SkyDash's split layout, the form on white and the Hevafsid brand beside it. */
.auth.auth-img-bg { background: #fff; }
.auth .brand-logo.auth-brand { display: flex; align-items: center; margin-bottom: 2rem; }
.auth .brand-logo img.auth-brand-mark { width: 44px; height: 44px; border-radius: 10px; }
.auth-brand-text { font-weight: 700; font-size: 1.6rem; color: #4B49AC; margin-left: .75rem; }
.auth-brand-panel {
    position: relative; flex-direction: column; align-items: center; justify-content: center;
    padding: 3rem; text-align: center;
    background: linear-gradient(135deg, #d7a8cc 0%, #b89bcb 55%, #a08fc6 100%);
}
.auth-brand-panel-logo { width: 80%; max-width: 460px; }
.auth-brand-panel-tagline { color: #fff; font-size: 1.05rem; line-height: 1.6; max-width: 360px; margin: 2rem 0 0; }
.auth-brand-panel-copy { position: absolute; left: 0; right: 0; bottom: 1.5rem; margin: 0; color: rgba(255, 255, 255, .85); font-size: .8rem; }
.auth form .input-group .form-control { padding-left: .5rem; }
.auth form .input-group .is-invalid ~ .invalid-feedback { display: block; }
.auth form .input-group .form-control.is-invalid,
.auth form .input-group:has(.is-invalid) .input-group-text { border-color: #dc3545; }
.auth form .input-group .form-control.is-invalid:focus { box-shadow: none; }
.captcha-picture { display: flex; align-items: center; }
.captcha-picture img { border: 1px solid #CED4DA; border-radius: 6px; }
.captcha-picture .btn { margin-left: .5rem; }

.avatar-initials {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(75, 73, 172, .15); color: #4B49AC; font-weight: 700; font-size: .8rem;
}
.navbar .navbar-menu-wrapper .navbar-nav .nav-item.nav-profile .dropdown-toggle::after { display: none; }

/*
 * The sidebar rail (desktop): one icon per group. Pointing at an icon, or tabbing to it, shows a panel
 * beside it with the group name and its menus, like onion-web's side nav; the group being shown has a
 * bar on its left. Built on SkyDash's icon-only mode, whose hover script adds .hover-open.
 */
/* A folder in the sidebar: its menus fold open under it (wide sidebar, phone), or open beside it on the rail. */
.sidebar .nav .menu-folder { position: relative; }
.sidebar .nav .menu-folder > .nav-link { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.sidebar .nav .menu-folder > .nav-link .menu-folder-arrow { font-size: .65rem; margin-left: .5rem; transition: transform .2s; }
.sidebar .nav .menu-folder > .menu-folder-panel { display: none; }
.sidebar .nav .menu-folder.is-open > .menu-folder-panel { display: block; }
.sidebar .nav .menu-folder.is-open > .nav-link .menu-folder-arrow { transform: rotate(90deg); }
.sidebar .nav .menu-folder .sub-menu { padding: 0 0 0 .9rem; background: transparent; }

@media (min-width: 992px) {
    /* The rail's icons stay in the middle of the screen, whatever the page scrolls to. */
    .sidebar-icon-only .sidebar > .nav {
        position: fixed; top: 60px; bottom: 0; width: 70px; margin: 0; padding: 0;
        display: flex; flex-direction: column; justify-content: center;
    }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] > .nav-link { padding-top: .85rem; padding-bottom: .85rem; }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] > .nav-link i.menu-icon { font-size: 1.05rem; }
    /* No filled block as in the wide sidebar: a light background on hover, the icon in colour when its group is shown. */
    .sidebar-icon-only .sidebar .nav:not(.sub-menu) > .nav-item[data-menu-group],
    .sidebar-icon-only .sidebar .nav:not(.sub-menu) > .nav-item[data-menu-group].active,
    .sidebar-icon-only .sidebar .nav:not(.sub-menu) > .nav-item[data-menu-group] > .nav-link { background: transparent; border-radius: 0; }
    .sidebar-icon-only .sidebar .nav:not(.sub-menu) > .nav-item[data-menu-group]:hover > .nav-link,
    .sidebar-icon-only .sidebar .nav:not(.sub-menu) > .nav-item[data-menu-group].hover-open > .nav-link { background: rgba(75, 73, 172, .08); }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] > .nav-link i.menu-icon { color: #6C7383; }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group]:hover > .nav-link i.menu-icon,
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group].active > .nav-link i.menu-icon { color: #4B49AC; }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group].active::before {
        content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: #4B49AC;
    }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group].hover-open > .nav-link .menu-title,
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group]:focus-within > .nav-link .menu-title {
        display: flex; align-items: flex-end; position: absolute; left: 70px; top: 0; bottom: auto; height: 2.6rem; width: 230px; z-index: 1050;
        padding: 0 1.4rem .35rem; background: #fff !important; color: #9c9fa6 !important; border-radius: 10px 10px 0 0;
        font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
        box-shadow: 6px -2px 14px rgba(146, 146, 148, .22);
    }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group].hover-open > .collapse,
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group]:focus-within > .collapse {
        display: block; position: absolute; left: 70px; top: 2.6rem; width: 230px; z-index: 1050;
        background: #fff; border-radius: 0 0 10px 10px; box-shadow: 6px 8px 14px rgba(146, 146, 148, .3);
    }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] .sub-menu { background: transparent; padding: .2rem 0 .6rem; }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] .sub-menu .nav-item::before { display: none; }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] .sub-menu .nav-item .nav-link {
        color: #3A4257; font-weight: 600; padding: .6rem 1.4rem; opacity: 1; position: relative; text-align: left; border-radius: 0;
    }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] .sub-menu .nav-item .nav-link:hover,
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] .sub-menu .nav-item .nav-link:focus,
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] .sub-menu .nav-item .nav-link.active { color: #4B49AC; background: rgba(75, 73, 172, .06); }
    /* On the rail a folder's menus open in a further panel beside it, on hover or by keyboard (or a tap on a touch screen). */
    .sidebar-icon-only .sidebar .nav .menu-folder > .menu-folder-panel,
    .sidebar-icon-only .sidebar .nav .menu-folder.is-open > .menu-folder-panel { display: none; }
    .sidebar-icon-only .sidebar .nav .menu-folder:hover > .menu-folder-panel,
    .sidebar-icon-only .sidebar .nav .menu-folder:focus-within > .menu-folder-panel,
    .sidebar-icon-only .sidebar .nav .menu-folder.tap-open > .menu-folder-panel {
        display: block; position: absolute; left: 100%; top: -.4rem; width: 230px; z-index: 1060;
        background: #fff; border-radius: 10px; box-shadow: 6px 6px 16px rgba(146, 146, 148, .32);
    }
    .sidebar-icon-only .sidebar .nav .menu-folder .sub-menu { padding: .4rem 0; }
    .sidebar-icon-only .sidebar .nav .menu-folder > .nav-link .menu-folder-arrow { transform: none; }
    .sidebar-icon-only .sidebar .nav .menu-folder:hover > .nav-link { color: #4B49AC; background: rgba(75, 73, 172, .06); }
    .sidebar-icon-only .sidebar .nav .nav-item[data-menu-group] .sub-menu .nav-item .nav-link.active::before {
        content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 0 2px 2px 0; background: #4B49AC;
    }
}

/* Soft badges, readable in tables full of numbers. */
.badge { font-size: .75rem; padding: .35em .6em; font-weight: 600; }
.badge-soft-success { background: rgba(87, 182, 87, .15); color: #3a8a3a; }
.badge-soft-warning { background: rgba(255, 193, 0, .2); color: #a07900; }
.badge-soft-danger { background: rgba(255, 71, 71, .15); color: #d63031; }
.badge-soft-info { background: rgba(36, 138, 253, .15); color: #1a6fd1; }
.badge-soft-primary { background: rgba(75, 73, 172, .15); color: #4B49AC; }
.badge-soft-secondary { background: rgba(100, 100, 120, .12); color: #5a5c69; }

label.required::after { content: " *"; color: #ff4747; }

.filters .filter-label { font-size: .75rem; font-weight: 600; color: #6c7383; margin-bottom: .2rem; }
.filters .form-control-sm, .filters .input-group-sm .form-control { height: calc(1.5em + .75rem + 2px); }

.table th, .table td { padding: .8rem .6rem; }
.table th { white-space: nowrap; }
.table td { vertical-align: middle; line-height: 1.35; }
/* Long names wrap instead of pushing the table past the screen. */
.table td.wrap { white-space: normal; max-width: 16rem; }
.table td .sub { display: block; font-size: .78rem; color: #8a8d93; line-height: 1.3; margin-top: .15rem; }
.table td .above { display: block; font-size: .78rem; color: #6c7383; line-height: 1.3; margin-bottom: .15rem; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .btn, .table .actions form { margin-left: .2rem; display: inline-block; }
.btn-action { padding: .4rem .55rem; line-height: 1; }
.btn-action i { font-size: .9rem; margin: 0; }

.sort-link { color: inherit; text-decoration: none !important; }
.sort-link.active { color: #4B49AC; }

.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-note { font-size: .8rem; opacity: .85; }

.pagination { margin-bottom: 0; flex-wrap: wrap; }

.scan-result { font-weight: 600; font-size: 1.05rem; }
.scan-input { font-size: 1.4rem; height: auto; padding: .7rem 1rem; letter-spacing: .03em; }
.mode-buttons .btn { min-width: 8.5rem; }

/* Scanning with the camera: the picture with a box; only what is inside the box is read. */
.camera-view { position: relative; width: 100%; max-width: 520px; aspect-ratio: 4 / 3; background: #000; border-radius: 6px; overflow: hidden; }
.camera-view video { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera-guide { position: absolute; left: 8%; right: 8%; top: 25%; bottom: 25%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 6px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); transition: border-color .15s; }
.camera-guide::after { content: ""; position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; background: rgba(255, 71, 71, .85); }
.camera-guide.is-read { border-color: #57b657; }
.camera-guide.is-read::after { background: #57b657; }

.feature-menu .card-title { margin-bottom: .75rem; }
.feature-menu .form-check { margin-top: .35rem; margin-bottom: .35rem; }

/* Invoice form: one card-like block per line, stacking on a phone. */
.invoice-item { border-bottom: 1px solid #ececec; margin-bottom: 1rem; }
.invoice-item:last-child { border-bottom: 0; }
.invoice-item-total { min-height: 3.6rem; }
.invoice-item input[type="date"].form-control { padding-left: .75rem; padding-right: .5rem; }
.invoice-sums { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin-bottom: 1rem; }
.invoice-sums dt { font-weight: 400; color: #6c7383; }
.invoice-sums dd { margin: 0; text-align: right; font-weight: 600; }
.invoice-grand { padding-top: .75rem; border-top: 1px solid #ececec; font-size: 1.15rem; }
.invoice-grand dt { color: inherit; font-weight: 700; }
.invoice-ready { border-left: 4px solid #57b657; }

/* Dasbor Invoice: the chart's box holds its axis labels too, so the card never scrolls inside. */
.invoice-chart { position: relative; height: 260px; }
.period-switch { flex-wrap: wrap; }
.report-presets { gap: .4rem; }
.table td.top-product { min-width: 7.5rem; white-space: normal; line-height: 1.35; }
@media (min-width: 768px) { .table td.top-product { width: 60%; } }
@media (max-width: 575px) { .top-products td, .top-products th { padding-left: .4rem; padding-right: .4rem; } }
.stat-card .stat-value { overflow-wrap: anywhere; }
@media (max-width: 575px) { .period-switch .btn { flex: 1 1 50%; } }
.invoice-ready-actions { gap: .5rem; margin-top: .5rem; }

.yard-summary { font-size: .9rem; }
.product-list { margin: 0; padding-left: 1.1rem; }

@media (max-width: 767px) {
    .content-wrapper { padding: 1.25rem .9rem; }
}

/* Inside a folded-out menu, the page being shown stands out from its neighbours. */
.sidebar .nav .nav-item.active .sub-menu .nav-item .nav-link { opacity: .7; }
.sidebar .nav .nav-item.active .sub-menu .nav-item .nav-link.active { opacity: 1; font-weight: 700; }

/* Sending an invoice PDF: the button waits while the PDF is made, and a short note says what happened. */
.btn.is-loading { opacity: .65; cursor: progress; }
.app-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 1080; max-width: calc(100% - 2rem); padding: .75rem 1.1rem; border-radius: 8px; background: #212529; color: #fff; font-size: .9rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
/* Catat kain masuk, like the stock sheet: a row per color and supplier, then a box per roll. */
.color-row { position: relative; border-bottom: 1px solid #ececec; padding: .75rem 2rem 0 0; }
.color-row:first-child { padding-top: 0; }
/* The remove cross sits level with the fields, below their labels. */
.color-row-remove { position: absolute; top: calc(.75rem + 2.2rem); right: 0; }
.color-row:first-child .color-row-remove { top: 2.2rem; }
/* A heading over a field that is not a single input, looking like the labels beside it. */
.field-heading { display: block; margin-bottom: .25rem; font-size: .875rem; line-height: 1.4rem; }
.field-heading.required::after { content: " *"; color: #ff4747; }
/* Yard or Kg: one box as tall as the fields beside it, with the picked unit filled in. */
.unit-toggle { display: inline-flex; gap: 3px; height: 2.575rem; padding: 3px; border: 1px solid #CED4DA; border-radius: 4px; background: #fff; }
.unit-toggle .unit-option { display: flex; align-items: center; margin: 0; padding: 0 .9rem; border-radius: 3px; color: #4B49AC; font-size: .875rem; line-height: 1; cursor: pointer; user-select: none; }
.unit-toggle .unit-option:hover { background: rgba(75, 73, 172, .08); }
.unit-toggle .unit-option.is-on { background: #4B49AC; color: #fff; }
.unit-toggle .unit-option:focus-within { box-shadow: 0 0 0 2px rgba(75, 73, 172, .35); }
.roll-cells { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.roll-cells .roll-cell { flex: 0 0 auto; width: 4.75rem; padding-left: .45rem; padding-right: .25rem; }
.roll-cells select.roll-cell { color: #212529; }
/* Adding a roll looks like one more empty box at the end of the line. */
.roll-cells .roll-add { height: 2.575rem; padding: 0 .8rem; border: 1px dashed #4B49AC; border-radius: 4px; background: transparent; color: #4B49AC; font-size: .8125rem; line-height: calc(2.575rem - 2px); white-space: nowrap; cursor: pointer; }
.roll-cells .roll-add:hover { background: rgba(75, 73, 172, .08); }
.roll-cells .roll-add:focus { outline: none; box-shadow: 0 0 0 2px rgba(75, 73, 172, .35); }
.roll-cells .roll-add i { margin-right: .3rem; font-size: .7rem; }

/* A day's rolls on Data Kain, like the stock sheet: each roll's size in a box, yellow once it has gone out. */
.roll-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.roll-chip { display: inline-block; min-width: 2.6rem; padding: .1rem .35rem; border: 1px solid #cfd4e6; border-radius: 4px; background: #fff; font-size: .8rem; line-height: 1.4; text-align: center; }
.roll-chip.is-out { background: #ffe94d; border-color: #e0c92a; }
.roll-chip.is-partly-out { background: linear-gradient(135deg, #ffe94d 50%, #fff 50%); border-color: #e0c92a; }

/* Catat kain masuk: a picked type, color or supplier reads as filled in, not as the theme's grey placeholder. */
.combo select.form-control:not(:disabled) { color: #212529; }

/* Produk: the colors a product is made in, a long list ticked in a scrolling box. */
.color-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: .15rem .75rem;
    max-height: 18rem;
    overflow-y: auto;
    padding: .6rem .75rem;
    border: 1px solid #CED4DA;
    border-radius: 4px;
}
.color-checklist.is-invalid { border-color: #FF4747; }
.color-checklist .color-option {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: .2rem 0;
    font-size: .875rem;
    cursor: pointer;
}
.color-checklist .color-option input { margin: 0; flex-shrink: 0; }
.color-checklist [data-color-empty] { grid-column: 1 / -1; }

/* A record's details as label and value rows, e.g. one produk order. */
.detail-table th { width: 38%; padding-left: 0; font-weight: 500; color: #6C7383; vertical-align: top; white-space: normal; }
.detail-table td { padding-right: 0; vertical-align: top; white-space: normal; }

/* Dasbor Produksi: the chart's legend, the list of what waits, and the top products. */
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: #6C7383; }
.chart-legend .swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.action-list li + li { border-top: 1px solid #F2F2F2; }
.top-product + .top-product { margin-top: .9rem; }
.top-product-bar { height: .5rem; margin-top: .35rem; border-radius: 4px; background: #F2F2F2; overflow: hidden; }
.top-product-bar span { display: block; height: 100%; border-radius: 4px; background: #4B49AC; }

/* Surat Tugas Saya: one card per task, easy to tap on a phone. */
.my-task { padding: .85rem 1rem; border: 1px solid #E8EAF2; border-radius: 8px; margin-bottom: .6rem; }
.my-task:hover, .my-task:focus { border-color: #4B49AC; text-decoration: none; }
