/* =====================================================================
   Supply Chain Management Nona Tenun NTT — style.css
   Modern Corporate Blue Design System
   Peningkatan Tipografi: Font Lebih Besar, Jelas & Tertata Rapi
   ===================================================================== */

:root {
    --navy: #102653;
    --navy-dark: #0b1d3d;
    --blue: #1769e0;
    --blue-dark: #123c78;
    --blue-soft: #edf5ff;
    --blue-light: #eaf3ff;
    --text: #111e38;
    --text-muted: #5e6f88;
    --muted: #5e6f88;
    --border: #e3e8f0;
    --border-light: #edf2f7;
    --bg: #f5f7fb;
    --white: #ffffff;
    --green: #15865a;
    --green-bg: #e6f7ef;
    --orange: #d97706;
    --orange-bg: #fffbeb;
    --red: #e11d48;
    --red-bg: #ffe4e6;

    /* Backward compatibility mapping with legacy classes */
    --nila: var(--blue);
    --nila-tua: var(--blue-dark);
    --nila-tinta: var(--blue-light);
    --mengkudu: var(--red);
    --mengkudu-tua: #be123c;
    --mengkudu-tinta: var(--red-bg);
    --kapas: var(--bg);
    --putih: var(--white);
    --garis: var(--border);
    --garis-halus: var(--border-light);
    --teks: var(--text);
    --teks-redup: var(--muted);
    --sukses: var(--green);
    --sukses-tinta: var(--green-bg);
    --tunda: var(--orange);
    --tunda-tinta: var(--orange-bg);
    --baris-hover: #f8fafc;
    --bayang-xs: 0 1px 3px rgba(16, 38, 83, .05);
    --bayang-sm: 0 3px 10px rgba(16, 38, 83, .04);
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    color: var(--text);
}

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

a:hover {
    color: #105dca;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

::selection {
    background: rgba(23, 105, 224, 0.2);
}

/* =====================================================================
   LAYOUT (Sidebar + Main)
   ===================================================================== */

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

/* SIDEBAR */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #102653 0%, #0d2147 100%);
    color: white;
    z-index: 50;
    overflow-y: auto;
    transition: transform .25s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .15);
    border-radius: 3px;
}

.brand, .merek {
    height: 88px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex-shrink: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.brand-text strong, .merek-nama {
    display: block;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: -.2px;
    color: #fff;
}

.brand-text span, .merek-sub {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: rgba(255, 255, 255, .62);
    text-transform: uppercase;
    letter-spacing: .7px;
}

.navigation, .menu {
    padding: 22px 14px;
    flex: 1;
}

.nav-title, .menu-kelompok-label {
    padding: 0 12px 10px;
    color: rgba(255, 255, 255, .42);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    font-weight: 700;
    display: block;
}

.nav-item, .menu-taut {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    height: 45px;
    padding: 0 14px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s ease;
}

.nav-item:hover, .menu-taut:hover {
    color: white;
    background: rgba(255, 255, 255, .09);
}

.nav-item.active, .nav-item.aktif, .menu-taut.aktif {
    color: white;
    background: linear-gradient(90deg, #1976ed, #1766d5);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .18);
    font-weight: 600;
}

.nav-icon, .menu-ikon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 17px;
    flex-shrink: 0;
}

.nav-icon svg, .menu-ikon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.sidebar-user {
    margin-top: auto;
    padding: 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    flex-shrink: 0;
}

.user-box, .kartu-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar, .user-avat {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: white;
    color: var(--blue);
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.user-info, .user-teks {
    flex: 1;
    min-width: 0;
}

.user-info strong, .user-nama {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13.5px;
    font-weight: 600;
    color: white;
}

.user-info span, .user-peran {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, .60);
    font-size: 12px;
}

.user-arrow {
    color: rgba(255, 255, 255, .65);
    font-size: 18px;
}

.sidebar-versi {
    display: block;
    margin-top: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, .38);
}

.lapis-drawer {
    display: none;
}

/* =====================================================================
   MAIN CONTAINER & TOPBAR
   ===================================================================== */

.main, .utama {
    width: calc(100% - 260px);
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar, .bilah-atas {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(8px);
}

.menu-button, .tombol-menu {
    display: none;
    border: 0;
    background: transparent;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
}

/* Rembakan (Breadcrumbs) */
.rembakan {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
}

.rembakan a {
    color: var(--muted);
}
.rembakan a:hover {
    color: var(--blue);
}
.rembakan-pemisah {
    color: #b0bfd4;
    user-select: none;
    font-size: 14px;
}
.rembakan-kini {
    color: var(--text);
    font-weight: 600;
}

.search {
    width: 420px;
    height: 44px;
    display: flex;
    align-items: center;
    background: #f4f7fb;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #7b8aa4;
    transition: all .15s ease;
    overflow: hidden;
    padding: 0 6px 0 16px;
}

.search:focus-within {
    background: #ffffff;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .1);
}

.search-form {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    gap: 10px;
}

.search-icon {
    font-size: 14px;
    flex-shrink: 0;
    user-select: none;
    opacity: .8;
}

.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    padding-right: 8px;
}

.search input::placeholder {
    color: #92a2b9;
}

.search-submit {
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 7px;
    background: var(--blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background-color .15s ease;
    flex-shrink: 0;
}

.search-submit:hover {
    background: #105dca;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.notification {
    position: relative;
    font-size: 17px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
}

.bilah-tanggal {
    font-size: 13px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.top-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.top-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--blue);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* =====================================================================
   CONTENT WRAPPER & PAGE HEADER
   ===================================================================== */

.content, .konten {
    padding: 32px;
    max-width: 1550px;
    width: 100%;
    margin: 0 auto;
}

.page-header, .kepala {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 18px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 9px;
    font-size: 18px;
}

.page-title h1, .kepala h1 {
    font-size: 26px;
    letter-spacing: -.6px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.page-title p, .kepala-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13.5px;
}

.kepala-aksi {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =====================================================================
   BUTTONS
   ===================================================================== */

.primary-button, .tombol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: white;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(23, 105, 224, .18);
    transition: all .2s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.primary-button:hover, .tombol:hover {
    background: #105dca;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(23, 105, 224, .25);
}

.primary-button:active, .tombol:active {
    transform: translateY(0);
}

.tombol-garis {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
}

.tombol-garis:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--blue);
}

.tombol-mengkudu {
    background: var(--red);
    box-shadow: 0 4px 12px rgba(225, 29, 72, .22);
}
.tombol-mengkudu:hover {
    background: #be123c;
}

.tombol-garis-mengkudu {
    background: white;
    color: var(--red);
    border: 1px solid #fecdd3;
}
.tombol-garis-mengkudu:hover {
    background: var(--red-bg);
}

.tombol-penuh {
    width: 100%;
}

.tombol-kecil {
    height: 34px;
    padding: 0 14px;
    font-size: 12.5px;
}

/* =====================================================================
   CARDS
   ===================================================================== */

.card, .bagian {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 38, 83, .03);
    padding: 26px 28px;
}

.card-header, .bagian-kepala {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title, .bagian-judul {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
}

.card-header .card-title,
.bagian-kepala .bagian-judul {
    margin-bottom: 0;
}

.card-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: var(--blue-light);
    border-radius: 9px;
    font-size: 16px;
}

.view-all, .bagian-taut {
    color: var(--blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.view-all:hover, .bagian-taut:hover {
    text-decoration: underline;
}

/* =====================================================================
   DASHBOARD OVERVIEW & STATS
   ===================================================================== */

.overview {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stock-card {
    position: relative;
    min-height: 236px;
    padding: 32px 30px;
    overflow: hidden;
    border-left: 5px solid var(--blue);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 12px;
}

.stock-card::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    right: -80px;
    bottom: -90px;
    background: var(--blue-light);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.stock-top {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.stock-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 16px;
    font-size: 32px;
}

.stock-number {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--text);
    line-height: 1.05;
}

.stock-label {
    margin-top: 5px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.stock-description {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
}

.trend {
    margin-left: auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: var(--blue-light);
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
}

.side-stats {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
}

.mini-stat {
    padding: 22px 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mini-stat.warning {
    background: var(--orange-bg);
    border: 1px solid #fde68a;
}

.mini-stat.success {
    background: var(--green-bg);
    border: 1px solid #bbf7d0;
}

.mini-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mini-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .85);
    font-size: 18px;
}

.mini-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.mini-label {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.mini-links {
    margin-top: 10px;
    padding-left: 54px;
}

.mini-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    color: #1d4ed8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.mini-links a:hover {
    text-decoration: underline;
}

/* =====================================================================
   TWO COLUMN & STATUS LIST
   ===================================================================== */

.two-column, .kisi-dua {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.kisi-detail {
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
    gap: 24px;
    align-items: start;
}

.tabel-mini {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    margin-bottom: 20px;
}

.tabel-mini th {
    padding: 12px 16px;
    font-size: 13px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.tabel-mini td {
    padding: 13px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.tabel-mini tr:last-child td {
    border-bottom: 0;
}

.panel {
    padding: 24px;
    min-height: 280px;
}

.status-list {
    border-top: 1px solid var(--border);
}

.status-row {
    display: grid;
    grid-template-columns: 1fr 45px 55px;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13.5px;
}

.status-name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-transform: capitalize;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.orange { background: var(--orange); }
.status-dot.blue   { background: var(--blue); }
.status-dot.green  { background: var(--green); }
.status-dot.red    { background: var(--red); }

.status-count {
    text-align: center;
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

.status-link {
    color: var(--blue);
    text-decoration: none;
    text-align: right;
    font-weight: 500;
    font-size: 13px;
}
.status-link:hover {
    text-decoration: underline;
}

/* =====================================================================
   TABLES
   ===================================================================== */

.table-wrapper, .tabel-wadah {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
}

table, .tabel {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

th, .tabel th {
    padding: 12px 14px;
    background: #f8fafc;
    color: #475569;
    text-align: left;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td, .tabel td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-light);
    color: #1e293b;
    vertical-align: middle;
}

tbody tr:last-child td, .tabel tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td, .tabel tbody tr:hover td {
    background: #f8fafc;
}

.angka, th.angka, td.angka {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.kolom-kecil {
    width: 1%;
    white-space: nowrap;
}

.kolom-aksi {
    text-align: right;
    white-space: nowrap;
}

.kolom-aksi a, .kolom-aksi button, .kolom-aksi form {
    display: inline-block;
    margin-left: 12px;
}

.kolom-aksi > :first-child {
    margin-left: 0;
}

.tautan {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
}
.tautan:hover {
    text-decoration: underline;
}

.tautan-hapus, .js-hapus-baris {
    background: none;
    border: 0;
    padding: 0;
    color: var(--red);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
}
.tautan-hapus:hover, .js-hapus-baris:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge, .status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.green, .status-sukses {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.blue, .status-nila {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.orange, .status-tunda {
    background: #fef3c7;
    color: #b45309;
}

.status-badge.red, .status-mengkudu {
    background: #ffe4e6;
    color: #be123c;
}

.status-redup {
    background: #f1f5f9;
    color: var(--muted);
}

/* Thumbnail images */
.foto-kecil {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 7px;
    vertical-align: middle;
    display: inline-block;
    border: 1px solid var(--border);
}

/* Tombol pembesar gambar: menampung foto-kecil/pratinjau agar bisa diklik */
.foto-tombol {
    display: inline-grid;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    line-height: 0;
    border-radius: 8px;
    vertical-align: middle;
    margin-right: 10px;
    transition: box-shadow .15s ease;
}

/* Pratinjau foto di form: dibatasi agar tidak meluber keluar kartu */
.foto-pratinjau {
    display: block;
    max-width: min(360px, 100%);
    max-height: 240px;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Gambar di dalam modal pembesar: selalu muat di layar */
#dialog-bukti-img {
    display: block;
    max-width: 92vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    margin: 0 auto;
}

.foto-tombol:hover {
    box-shadow: 0 0 0 3px rgba(52, 125, 224, .35);
}

.foto-pratinjau-wadah .foto-tombol {
    max-width: 100%;
}

.foto-inisial {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: var(--blue-light);
    color: var(--blue);
    font-size: 14px;
    font-weight: 700;
    border-radius: 7px;
    vertical-align: middle;
}

.teks-redup {
    color: var(--muted);
}

/* Bukti pembayaran: tampil sebagai thumbnail kecil (bukan ukuran
   penuh). Klik gambar untuk membuka berkas aslinya di tab baru. */
.bukti {
    display: block;
    max-width: 220px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: zoom-in;
    box-shadow: 0 1px 3px rgb(15 23 42 / .08);
}

/* Tombol pembuka thumbnail bukti (modal ukuran penuh). */
.bukti-tombol {
    padding: 0;
    border: 0;
    background: none;
    display: block;
    cursor: zoom-in;
}

/* Modal bukti pembayaran dideklarasikan setelah blok .dialog dasar
   (lihat bawah) agar lebar modal tidak tertimpa max-width 540 px. */
.teks-perhatian {
    color: var(--orange);
    font-weight: 600;
}

/* =====================================================================
   BOTTOM GRID & INFO BOX
   ===================================================================== */

.bottom-grid, .kisi-tak-rata {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 20px;
    margin-bottom: 24px;
}

.purchase-panel, .info-panel {
    padding: 24px;
}

.buyer {
    color: #1769c7;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
}
.buyer:hover {
    text-decoration: underline;
}

.money {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 13.5px;
}

.info-box {
    padding: 20px;
    background: #eef6ff;
    border: 1px solid #dcecff;
    border-radius: 11px;
    margin-bottom: 14px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #1e4f8a;
}

.info-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: white;
    background: var(--blue);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.info-text {
    margin-top: 10px;
    padding-left: 36px;
    color: #4b5d78;
    font-size: 13px;
    line-height: 1.7;
}

.info-date {
    margin-top: 12px;
    padding-left: 36px;
    color: #6e84a3;
    font-size: 12px;
    font-weight: 500;
}

/* =====================================================================
   TOOLBAR / FILTERS
   ===================================================================== */

.alat {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.alat input, .alat select {
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    transition: all .15s ease;
}

.alat input:focus, .alat select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .1);
    outline: none;
}

.alat-cari {
    width: 320px;
    max-width: 100%;
}

/* =====================================================================
   FORMS (form-kisi, form-satu, medan)
   ===================================================================== */

.form-kisi {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 28px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--bayang-xs);
    padding: 28px;
    margin-bottom: 24px;
}

.form-satu {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--bayang-xs);
    padding: 28px;
    margin-bottom: 24px;
    max-width: 720px;
}

.medan {
    margin-bottom: 18px;
}

.medan label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #162644;
}

.medan input, .medan select, .medan textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.medan input {
    height: 44px;
}

.medan textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.6;
}

.medan input:focus, .medan select:focus, .medan textarea:focus {
    border-color: #4d8ce6;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .1);
    outline: none;
}

.medan-galat {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--red);
}

.medan-bantu {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.kolom-penuh {
    grid-column: 1 / -1;
}

.form-aksi {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.aksi-baris {
    margin: 16px 0 20px;
}

/* Ringkasan Biaya / Summary Box */
.ringkasan {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;
    margin: 20px 0 0;
    max-width: 100%;
}

.ringkasan-baris {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0;
    font-size: 14px;
}

.ringkasan-baris + .ringkasan-baris {
    border-top: 1px solid var(--border);
}

.ringkasan-baris b {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 14px;
}

.ringkasan-total {
    border-top: 2px solid var(--text) !important;
    margin-top: 6px;
    padding-top: 12px;
}

.ringkasan-total span {
    font-weight: 700;
}

.ringkasan-total b {
    font-size: 17px;
    color: var(--blue);
}

/* =====================================================================
   FLASH NOTIFICATIONS
   ===================================================================== */

.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    padding: 14px 18px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid;
    animation: flashMasuk .25s ease-out;
}

.flash-ikon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.flash-sukses {
    color: #15803d;
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.flash-sukses .flash-ikon {
    background: #16a34a;
    color: white;
}

.flash-galat {
    color: #be123c;
    background: #fff1f2;
    border-color: #fecdd3;
}
.flash-galat .flash-ikon {
    background: #e11d48;
    color: white;
}

@keyframes flashMasuk {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   REPORT TABS & PRINT/SCREEN VISIBILITY
   ===================================================================== */

.tab-laporan {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 18px;
    margin-bottom: -1px;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: color .15s ease;
}

.tab:hover { color: var(--text); }

.tab.aktif {
    color: var(--blue);
    font-weight: 600;
    border-bottom-color: var(--blue);
}

/* Elemen hanya terlihat saat cetak (print); disembunyikan di layar. */
.cetak-saja { display: none; }

/* Elemen hanya terlihat di layar; disembunyikan saat cetak (diatur di print.css). */

/* =====================================================================
   PAGINATION
   ===================================================================== */

.paginasi {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 13px;
    color: var(--muted);
}

.paginasi-tautan {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.paginasi-tautan a {
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    color: var(--text);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 13px;
}

.paginasi-tautan a:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.paginasi-kini {
    padding: 6px 13px;
    border-radius: 7px;
    background: var(--blue);
    color: white;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

/* =====================================================================
   STEPPER & DETAILS
   ===================================================================== */

.langkah {
    display: flex;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--bayang-xs);
    margin-bottom: 24px;
    overflow-x: auto;
}

.langkah-item {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px 16px;
    position: relative;
    text-align: center;
}

.langkah-item + .langkah-item::before {
    content: '';
    position: absolute;
    top: 26px;
    left: calc(-50% + 22px);
    right: calc(50% + 22px);
    height: 2px;
    background: var(--border);
}

.langkah-titik {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    z-index: 1;
}

.langkah-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}

.langkah-selesai .langkah-titik {
    background: var(--green);
    border-color: var(--green);
}
.langkah-selesai + .langkah-item::before {
    background: var(--green);
}

.langkah-kini .langkah-titik {
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, .18);
}
.langkah-kini .langkah-label {
    color: var(--blue);
}

.daftar-rincian div {
    display: flex;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-light);
}

.daftar-rincian dt {
    width: 140px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

.daftar-rincian dd {
    margin: 0;
    font-size: 14.5px;
    color: var(--text);
    font-weight: 600;
}

.tindakan {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

/* Empty states */
.kosong {
    text-align: center;
    padding: 52px 24px;
    background: white;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin: 18px 0;
}

.kosong-utama {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.kosong-isi {
    margin: 0 auto 20px;
    font-size: 13.5px;
    color: var(--muted);
    max-width: 55ch;
    line-height: 1.6;
}

/* Dialog */
.dialog {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 32px;
    max-width: 540px;
    width: calc(100% - 32px);
    box-shadow: 0 20px 48px rgba(16, 38, 83, .22);
    margin: auto;
}

.dialog::backdrop {
    background: rgba(16, 38, 83, .45);
    backdrop-filter: blur(4px);
}

.dialog-judul {
    font-size: 17px;
    margin-bottom: 10px;
}

.dialog-isi {
    margin-bottom: 22px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.dialog-aksi {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ---- Modal pembesar bukti pembayaran (setelah .dialog dasar agar
   lebar modal tidak tertimpa max-width 540 px di atas) --------------- */

.dialog-bukti {
    padding: 12px 14px 14px;
    width: min(96vw, 1700px);
    max-width: 96vw;
    overflow: auto;
}

.dialog-bukti-kepala {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dialog-bukti .tombol-tutup {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    flex: none;
}

.dialog-bukti .tombol-tutup:hover {
    color: var(--red);
    border-color: var(--red);
}

/* Gambar dibatasi 100% lebar modal + 88vh tinggi layar: gambar
   landscape sekalipun tetap terkurung di dalam modal. */
.dialog-bukti img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* =====================================================================
   LOGIN PAGE STYLING
   ===================================================================== */

.login-body {
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--text);
    /* Latar foto kain tenun (latar belakang): berkas public/css/bg-login.jpg */
    background: url("bg-login.jpg") center center / cover no-repeat #f8fbff;
    overflow-x: hidden;
    position: relative;
}

.background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.shape {
    /* bentuk dekoratif dinonaktifkan: latar kini memakai foto tenun */
    display: none;
    position: absolute;
    background: linear-gradient(135deg, rgba(52, 125, 224, .18), rgba(52, 125, 224, .04));
    transform: rotate(45deg);
    border-radius: 35px;
}

.shape-left {
    width: 390px;
    height: 120px;
    left: -180px;
    bottom: 80px;
}

.shape-left-2 {
    width: 270px;
    height: 95px;
    left: -105px;
    bottom: 20px;
    opacity: .65;
}

.shape-right {
    width: 380px;
    height: 125px;
    right: -185px;
    top: 125px;
    opacity: .55;
}

.shape-right-2 {
    width: 270px;
    height: 90px;
    right: -115px;
    top: 275px;
    opacity: .35;
}

.brand-top {
    position: absolute;
    top: 34px;
    left: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 10;
}

.brand-top .brand-logo {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(145deg, #2d7be5, #1252b8);
    border-radius: 9px;
    font-size: 25px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(23, 105, 224, .18);
    border: none;
}

.brand-top .brand-name {
    font-size: 21px;
    font-weight: 700;
    color: var(--blue-dark);
    letter-spacing: -.4px;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 90px 20px 40px;
    position: relative;
    z-index: 5;
}

.login-card {
    width: 100%;
    max-width: 560px;
    padding: 44px 50px 40px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(225, 232, 241, .95);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(27, 57, 92, .12), 0 4px 16px rgba(27, 57, 92, .04);
}

.login-header {
    text-align: center;
}

.main-logo {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    color: white;
    background: linear-gradient(145deg, #2879e5, #1255bd);
    border-radius: 18px;
    font-size: 38px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(23, 105, 224, .20);
}

.login-header h1 {
    color: var(--blue-dark);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -.8px;
    font-weight: 700;
}

.address {
    max-width: 440px;
    margin: 16px auto 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 9px;
    color: #6a809f;
    font-size: 13px;
    line-height: 1.7;
    text-align: left;
}

.location-icon {
    flex-shrink: 0;
    color: #64748b;
    font-size: 16px;
}

.divider {
    height: 1px;
    margin: 28px 0 26px;
    background: #e2e8f0;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    color: #162644;
    font-size: 14px;
    font-weight: 650;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 52px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: white;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.input-icon {
    width: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #64748b;
    font-size: 18px;
    flex-shrink: 0;
}

.input-wrapper input {
    width: 100%;
    height: 100%;
    padding: 0 14px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e293b;
    font-size: 14px;
    font-family: inherit;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.password-toggle {
    margin-right: 14px;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
}
.password-toggle:hover {
    color: var(--blue);
}

.login-button {
    width: 100%;
    height: 52px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 7px 20px rgba(37, 99, 235, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .30);
}

.login-button:active {
    transform: translateY(0);
}

.arrow {
    font-size: 20px;
    line-height: 1;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 26px;
    padding: 16px 18px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    color: #3b597d;
}

.notice-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: white;
    background: #2563eb;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.notice-text {
    font-size: 12.5px;
    line-height: 1.65;
}

/* =====================================================================
   RESPONSIVE DESIGN
   ===================================================================== */

@media (max-width: 1100px) {
    .sidebar {
        width: 230px;
    }
    .main, .utama {
        width: calc(100% - 230px);
        margin-left: 230px;
    }
    .content, .konten {
        padding: 24px;
    }
    .overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 850px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open, .sidebar.terbuka {
        transform: translateX(0);
        box-shadow: 0 0 28px rgba(11, 29, 61, .35);
    }
    .lapis-drawer:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(16, 38, 83, .55);
        z-index: 45;
        backdrop-filter: blur(2px);
    }
    .main, .utama {
        width: 100%;
        margin-left: 0;
    }
    .menu-button, .tombol-menu {
        display: block;
        margin-right: 15px;
    }
    .search {
        flex: 1;
        max-width: 380px;
    }
    .search-submit {
        display: none;
    }
    .two-column, .bottom-grid, .kisi-dua, .kisi-tak-rata, .kisi-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .brand-top {
        position: relative;
        top: auto;
        left: auto;
        justify-content: center;
        padding-top: 30px;
    }
    .page {
        padding-top: 30px;
    }
    .login-card {
        max-width: 520px;
        padding: 36px 28px 32px;
    }
}

@media (max-width: 600px) {
    .content, .konten {
        padding: 16px;
    }
    .topbar, .bilah-atas {
        padding: 0 16px;
    }
    .search {
        display: none;
    }
    .bilah-tanggal {
        display: none;
    }
    /* Nama pengguna ditampilkan agar jelas siapa yang masuk (dipersingkat otomatis) */
    .top-username {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12.5px;
    }
    /* Tabel di layar sempit: sel disiplin, geser ke samping bila sempit, tidak dipenciutkan tidak rapi */
    .tabel {
        min-width: 600px;
    }
    th, .tabel th {
        padding: 8px 10px;
        font-size: 11.5px;
    }
    td, .tabel td {
        padding: 8px 10px;
        font-size: 12.5px;
        white-space: nowrap;
    }
    td.sel-produk, .tabel td.sel-produk {
        white-space: normal;
    }
    .kolom-aksi a, .kolom-aksi .tombol {
        white-space: nowrap;
    }
    .page-header, .kepala {
        align-items: flex-start;
        gap: 15px;
        flex-direction: column;
    }
    .page-title h1, .kepala h1 {
        font-size: 22px;
    }
    .primary-button, .tombol {
        padding: 0 14px;
        height: 38px;
    }
    .stock-card {
        padding: 24px 20px;
    }
    .stock-number {
        font-size: 36px;
    }
    .login-card {
        padding: 30px 20px 25px;
        border-radius: 14px;
    }
    .login-header h1 {
        font-size: 26px;
    }
    .main-logo {
        width: 66px;
        height: 66px;
    }
    .shape-left, .shape-left-2, .shape-right, .shape-right-2 {
        opacity: .35;
    }
}

/* ===== Rapi kolom nama (ikon + nama) di semua daftar: selalu sejajar ===== */
td.sel-produk {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sel-produk .foto-tombol,
.sel-produk .foto-inisial {
    flex: 0 0 auto;
    margin-right: 0;
}

.sel-produk a {
    line-height: 1.35;
}

/* ===== Layar sempit: menu & tombol Keluar selalu terjangkau ===== */
@media (max-width: 850px) {
    .brand, .merek {
        height: 62px;
        padding: 0 16px;
    }
    .brand-logo {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    .brand-text strong {
        font-size: 14.5px;
    }
    .brand-text span {
        font-size: 10px;
    }
    .nav-title {
        margin: 8px 0 4px;
    }
    .nav-item, .menu-taut {
        height: 40px;
        margin-bottom: 2px;
        font-size: 13.5px;
    }
    /* Kotak Keluar: tampil setelah menu terakhir, tidak tergantung panjang layar */
    .sidebar-user {
        margin-top: 12px;
        padding: 12px 16px 18px;
    }
    .user-box .avatar {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    .user-info strong {
        font-size: 13.5px;
    }
    .user-info span {
        font-size: 11px;
    }
    .sidebar-versi {
        display: none;
    }
}

/* ===== Form kisi: satu kolom di layar sempit, medan selalu sejajar ===== */
@media (max-width: 850px) {
    .form-kisi {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 16px;
    }
    /* margin lama tidak ikut menambah jarak berantakan di dalam kisi */
    .form-kisi .medan {
        margin-bottom: 0;
    }
}

/* Ikon SVG di avatar (Keluar) dipastikan terpusat & tajam */
.user-box .avatar svg {
    display: block;
}
