/* =========================
   RESET DASAR
========================= */

*{
box-sizing:border-box;
}

html,body{
margin:0;
padding:0;
min-height:100%;
}

body{
background:#f2f2f2;
font-family:'Inter', Arial, Helvetica, sans-serif;
font-size:14px;
color:#222;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
}

/* =========================
   HEADER GLOBAL
========================= */

.topbar{
position:fixed;
top:0;
left:0;
width:100%;
background:#0d6efd;
z-index:9999;
border-bottom:2px solid #084298;
box-shadow:0 2px 6px rgba(0,0,0,0.15);
font-family:'Inter', Arial, sans-serif;
font-size:15px;
line-height:1;
}

.header-scroll{
overflow-x:auto;
overflow-y:hidden;
white-space:nowrap;
-webkit-overflow-scrolling:touch;
}

.header-scroll::-webkit-scrollbar{
display:none;
}

.menu-header{
display:inline-flex;
align-items:center;
gap:16px;
padding:8px 12px;
flex-wrap:nowrap;
min-width:max-content;
}

.menu-header a{
color:#fff;
text-decoration:none;
font-size:15px;
font-weight:600;
padding:6px 10px;
border-radius:6px;
white-space:nowrap;
flex-shrink:0;
}

.menu-header a:hover{
background:rgba(255,255,255,0.15);
}

.menu-icon{
width:34px;
height:34px;
display:inline-flex;
align-items:center;
justify-content:center;
border-radius:8px;
}

.menu-logout{
background:#dc3545;
color:#fff;
}

.menu-logout:hover{
background:#bb2d3b;
}

/* =========================
   LINK GLOBAL
========================= */

a{
color:#0d6efd;
text-decoration:none;
}

a:hover{
text-decoration:underline;
}

/* =========================
   CONTAINER HALAMAN
========================= */

:root{
--header-height:56px;
}

.container{
max-width:1100px;
margin:auto;
padding:16px;
padding-top:calc(var(--header-height) + 16px);
}

/* =========================
   TABLE GLOBAL
========================= */

table{
border-collapse:collapse;
background:#fff;
font-size:14px;
}

th,td{
border:1px solid #ddd;
padding:6px 8px;
}

th{
background:#f3f3f3;
font-weight:600;
}

/* =========================
   BUTTON GLOBAL
========================= */

button{
cursor:pointer;
font-family:inherit;
}

.btn{
display:inline-block;
padding:6px 14px;
border-radius:6px;
border:none;
font-size:14px;
font-weight:600;
}

.btn-primary{
background:#0d6efd;
color:#fff;
}

.btn-primary:hover{
background:#0b5ed7;
}

/* =========================
   MOBILE
========================= */

@media (max-width:768px){

:root{
--header-height:52px;
}

.container{
padding:12px;
padding-top:calc(var(--header-height) + 12px);
}

.menu-header{
gap:12px;
padding:6px 10px;
}

.menu-header a{
font-size:14px;
padding:5px 8px;
}

}

/* =========================
   FOOTER
========================= */

.footer{
text-align:center;
padding:14px;
font-size:12px;
color:#666;
}

/* =========================
   MODE APP (PWA)
========================= */

body.mode-app{
background:#e8f5ff;
}

body.mode-app .topbar{
padding-top:env(safe-area-inset-top);
}

.mode-app .container{
    padding-top: calc(var(--header-height) + env(safe-area-inset-top) + 12px);
}

/* ==================================================
   LOGIN PAGE – TERISOLASI
================================================== */

body.login-page{
margin:0;
height:100vh;
overflow:hidden;
background:#f4f6f9;
font-family:'Inter', Arial, sans-serif;
display:flex;
align-items:center;
justify-content:center;
}

.login-wrapper{
width:100%;
display:flex;
align-items:center;
justify-content:center;
padding:16px;
}

.login-card{
width:100%;
max-width:380px;
background:#ffffff;
border-radius:18px;
padding:26px 22px;
box-shadow:0 12px 32px rgba(0,0,0,0.12);
}

.login-title{
text-align:center;
color:#0d6efd;
margin-bottom:4px;
font-size:26px;
font-weight:700;
}

.login-desc{
text-align:center;
color:#666;
margin-bottom:22px;
font-size:15px;
}

.login-error{
background:#fdecea;
color:#b3261e;
padding:10px;
border-radius:10px;
font-size:14px;
margin-bottom:14px;
text-align:center;
}

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

.form-group label{
display:block;
font-size:14px;
font-weight:600;
margin-bottom:6px;
}

.form-group input{
width:100%;
padding:12px 14px;
font-size:16px;
border-radius:12px;
border:1.8px solid #ccc;
}

.btn-login{
width:100%;
padding:14px;
font-size:17px;
font-weight:700;
border:none;
border-radius:14px;
background:#0d6efd;
color:#fff;
cursor:pointer;
}

.login-page input::placeholder{
color:#b5b5b5;
opacity:1;
}

/* =========================
   STOK AREA
========================= */

.stok-area{
max-width:420px;
margin:auto;
}

.stok-area table{
border-collapse:collapse;
font-size:14px;
}

.stok-area td,
.stok-area th{
padding:4px 6px;
}

.table-buku{
width:max-content;
min-width:100%;
}

.area-buku{
overflow-x:auto;
}

.table-buku{
font-size:13px;
}

.table-buku th,
.table-buku td{
white-space:nowrap;
}

/* =========================
   TABEL BUKU PROFESIONAL
========================= */

.table-buku{
font-family:'Roboto Condensed', Arial, sans-serif;
font-size:14px;
border-collapse:collapse;
}

/* header tabel */
.table-buku th{
background:#f1f3f5;
font-weight:700;
text-align:center;
padding:6px 8px;
}

/* isi tabel */
.table-buku td{
padding:5px 8px;
white-space:nowrap;
}

/* teks kiri */
.table-buku td{
text-align:left;
}

/* angka rata kanan */
.table-buku td.text-right{
text-align:right;
font-variant-numeric:tabular-nums;
}

/* porsi di tengah */
.table-buku td.text-center{
text-align:center;
}

/* kolom saldo lebih tebal */
.table-buku td.saldo{
font-weight:500;
}

/* garis tabel lebih halus */
.table-buku th,
.table-buku td{
border:1px solid #d9d9d9;
}

/* hover baris */
.table-buku tr:hover{
background:#f8fbff;
}

/* transaksi hari ini */
.highlight-hari-ini{
background:#fff7cc !important;
}

/* baris tambah hutang */
.row-tambah{
background:#fff8f8;
}

/* baris bayar hutang */
.row-kurang{
background:#f8fbff;
}

.table-buku{
overflow-x:auto;
}

/* FONT KHUSUS TABEL BUKU */

.table-buku{
font-family:'Roboto Condensed', Arial, sans-serif;
font-size:14px;
}

.table-buku td.text-right{
font-variant-numeric:tabular-nums;
}

/* ===============================
   HILANGKAN GARIS SAAT LINK DITEKAN
=============================== */

a,
a:link,
a:visited,
a:hover,
a:active{
    text-decoration:none;
}

a:focus,
button:focus{
    outline:none;
}

/* Android tap highlight */
a,
button,
.btn{
    -webkit-tap-highlight-color: transparent;
}