body { background: #f4f5f7; }
.rowlink { cursor: pointer; }
.thumb {
    width: 48px; height: 48px; object-fit: cover;
    border-radius: 6px; border: 1px solid #ddd; background: #fff;
}
.thumb-empty {
    display: flex; align-items: center; justify-content: center;
    color: #bbb; font-weight: bold;
}
.bigphoto {
    max-width: 100%; max-height: 220px; object-fit: contain;
    border-radius: 8px; border: 1px solid #ddd; background: #fff;
}
.bigphoto-sm {
    /* whole image always visible (never cropped), 20% bigger */
    width: 132px; height: 132px; object-fit: contain;
    border-radius: 8px; border: 1px solid #ddd; background: #fff;
}
.bigphoto-empty {
    display: flex; align-items: center; justify-content: center;
    color: #bbb; width: 160px; height: 160px; margin: 0 auto;
    border: 1px dashed #ccc; border-radius: 8px;
}
.gst-bad { border-color: #dc3545; color: #dc3545; font-weight: 600; }
.row-del td { text-decoration: line-through; opacity: .55; }
.row-del td:last-child { text-decoration: none; opacity: 1; }

/* ---- fixed sidebar: open by default, collapses to icon rail ---- */
.app-wrap { min-height: calc(100vh - 58px); }
.sidebar {
    width: 210px; min-width: 210px; background: #212529;
    transition: width .15s, min-width .15s;
}
.sidebar .nav-link {
    color: #cfd3d7; display: flex; align-items: center; gap: 12px;
    padding: 10px 18px; white-space: nowrap; border-radius: 0;
}
.sidebar .nav-link i { font-size: 1.15rem; width: 22px; text-align: center; }
.sidebar .nav-link:hover { background: #343a40; color: #fff; }
.sidebar .nav-link.active { background: #0d6efd; color: #fff; }
body.sb-collapsed .sidebar { width: 58px; min-width: 58px; }
body.sb-collapsed .sidebar .lbl { display: none; }
.main-area { min-width: 0; }

/* ---- keep top bar and sidebar fixed while the page scrolls ---- */
.topbar {
    position: sticky; top: 0; z-index: 1030; min-height: 58px;
}
.sidebar {
    position: sticky; top: 58px; align-self: flex-start;
    height: calc(100vh - 58px); overflow-y: auto;
}

/* ---- login screen ---- */
body.login-bg {
    background:
        radial-gradient(900px 500px at 85% -10%,
                        rgba(13,110,253,.35), transparent 60%),
        radial-gradient(700px 500px at -10% 110%,
                        rgba(111,66,193,.30), transparent 60%),
        linear-gradient(160deg, #151a26, #1b2234 55%, #12161f);
}
.login-wrap {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; padding: 24px 12px;
}
.login-card {
    width: 100%; max-width: 410px; border: 0; border-radius: 18px;
    overflow: hidden; box-shadow: 0 25px 60px rgba(0,0,0,.45);
}
.login-head { background: linear-gradient(135deg, #0d6efd, #6f42c1);
    padding: 30px 20px 24px; }
.login-logo {
    width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; color: #fff;
}
.login-card .input-group-text {
    background: #f6f7fb; border-right: 0; color: #8a93a6; }
.login-card .form-control { border-left: 0; }
.login-card .form-control:focus { box-shadow: none;
    border-color: #0d6efd; }
.login-card .input-group:focus-within .input-group-text {
    border-color: #0d6efd; color: #0d6efd; }
.login-btn { background: linear-gradient(135deg, #0d6efd, #6f42c1);
    border: 0; border-radius: 10px; font-weight: 600; }
.login-btn:hover { filter: brightness(1.1); }

/* ---- dashboard counter cards ---- */
a .statcard:hover { border-color: #0d6efd; }

/* ---- compact history table ---- */
.hist { font-size: .875rem; }
.hist th, .hist td { padding: .3rem .5rem; }
.hist .badge { font-size: .7em; }

/* ---- click-to-copy in the view page ---- */
.copyable { cursor: copy; border-radius: 4px; padding: 0 3px; }
.copyable:hover { background: #fff3cd; }
.copyable.copied { background: #b7eac6; }
