:root {
    --primary: #1b5e20;
    --accent: #ef6c00;
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #263238;
    --muted: #607d8b;
    --border: #e0e0e0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ===== LOGIN ===== */
.login-wrap {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 360px;
    background: var(--card);
    padding: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.login-box h1 {
    margin: 0 0 6px;
    font-size: 22px;
    color: var(--primary);
    text-align: center;
}

.login-box p {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

button {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

/* ===== HEADER ===== */
.header {
    height: 56px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 600;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #fff;
    border-right: 1px solid var(--border);
}

.sidebar a {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--accent);
    color: #fff;
}

/* ===== CONTENT ===== */
.content {
    margin-left: 220px;
    margin-top: 56px;
    padding: 20px;
}

/* ===== CARD ===== */
.card {
    background: var(--card);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
/* ===== LOGIN POLISHED ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
}

.login-card {
    display: flex;
    width: 760px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

/* KIRI - GAMBAR */
.login-visual {
    width: 45%;
    background: linear-gradient(180deg, #e8f5e9, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-visual img {
    width: 80%;
    max-width: 280px;
}

/* KANAN - FORM */
.login-form {
    width: 55%;
    padding: 40px;
}

.login-form h1 {
    margin: 0;
    font-size: 24px;
    color: var(--primary);
}

.login-form p {
    margin: 6px 0 24px;
    font-size: 14px;
    color: var(--muted);
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 14px;
}

.login-form button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.login-form button:hover {
    opacity: 0.95;
}

.login-footer {
    margin-top: 20px;
    font-size: 12px;
    color: #999;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .login-card {
        flex-direction: column;
        width: 90%;
    }

    .login-visual {
        width: 100%;
        padding: 20px;
    }

    .login-form {
        width: 100%;
    }
}
/* ===== HEADER ===== */
.app-header {
    height: 64px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 38px;
    margin-right: 12px;
}

.company-name {
    font-size: 16px;
    font-weight: 700;
}

.company-sub {
    font-size: 12px;
    opacity: .85;
}

.header-right {
    text-align: right;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    opacity: .85;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #fff;
    border-right: 1px solid var(--border);
}

.sidebar a {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
}

.sidebar a.active,
.sidebar a:hover {
    background: var(--accent);
    color: #fff;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

/* ===== CONTENT ===== */
.content {
    margin-left: 220px;
    margin-top: 64px;
    padding: 24px;
}

/* ===== DASHBOARD ===== */
.dashboard-hero {
    background: linear-gradient(135deg, #e8f5e9, #ffffff);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.dash-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
}

.dash-title {
    font-weight: 700;
    color: var(--primary);
}

.dash-desc {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

/* ===== FOOTER ===== */
.app-footer {
    margin-left: 220px;
    padding: 14px 24px;
    font-size: 12px;
    color: #777;
    border-top: 1px solid var(--border);
    background: #fff;
}
/* ===== HEADER ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #1b5e20;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 40px; /* tinggi footer */
    width: 220px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
}

.sidebar a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
}

.sidebar a.active,
.sidebar a:hover {
    background: #ef6c00;
    color: #fff;
}

.sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

/* ===== CONTENT ===== */
.content {
    margin-top: 64px;
    margin-left: 220px;
    margin-bottom: 40px; /* footer */
    padding: 24px;
}

/* ===== FOOTER FIXED ===== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #777;
    display: flex;
    align-items: center;
    padding-left: 240px; /* lewat sidebar */
}
/* ===== SIDEBAR BASE ===== */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 40px;
    width: 260px;
    background: #eef5fc;
    border-right: 1px solid #dbe5ef;
    padding: 12px 0;
    font-size: 14px;
}

/* ===== GROUP ===== */
.sidebar-group {
    margin-bottom: 10px;
}

.sidebar-group.green {
    background: #e7f6ed;
}

.sidebar-group.orange {
    background: #fff0e4;
}

/* ===== GROUP TITLE ===== */
.sidebar-group-title {
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #2b3a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* ===== MAIN ITEM ===== */
.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: #243447;
    font-weight: 600;
}

.sidebar-item .icon {
    width: 32px;
    height: 32px;
    background: #dce6f1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.sidebar-item.active {
    background: #ffffff;
    border-left: 4px solid #1b5e20;
}

/* ===== SUBMENU ===== */
.sidebar-submenu {
    display: none;
    padding-left: 22px;
}

.sidebar-submenu a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #34495e;
    font-size: 13px;
    position: relative;
}

.sidebar-submenu a::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #999;
}

.sidebar-submenu a.danger {
    color: #c62828;
}

/* ===== OPEN STATE ===== */
.sidebar-group.open .sidebar-submenu {
    display: block;
}

.sidebar-group.open .arrow {
    transform: rotate(90deg);
}

/* ===== HOVER ===== */
.sidebar-item:hover,
.sidebar-submenu a:hover {
    background: rgba(255,255,255,0.6);
}
.app-layout {
    display: flex;
}

.sidebar {
    width: 240px;
}

.card-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
}

.card-form label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

.card-form input,
.card-form textarea {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
}

.btn-primary {
    margin-top: 15px;
    padding: 10px 16px;
    background: #1e7f34;
    color: white;
    border: none;
    cursor: pointer;
}
.sidebar-submenu {
    display: none;
    padding-left: 10px;
}

.sidebar-group.open .sidebar-submenu {
    display: block;
}

.sidebar-group-title {
    cursor: pointer;
    user-select: none;
}

.sidebar-group-title .arrow {
    float: right;
    transition: transform .2s;
}

.sidebar-group.open .arrow {
    transform: rotate(90deg);
}
/* ===============================
   GLOBAL NUMBER ALIGNMENT
================================ */

/* Semua angka & rupiah rata kanan */
.text-right{
    text-align:right;
}

/* Input angka (qty, harga, total, dll) */
input[type="number"],
input.number,
input.qty,
input.harga,
input.rupiah{
    text-align:right;
}

/* Table cell angka */
td.number,
td.qty,
td.harga,
td.rupiah{
    text-align:right;
    font-variant-numeric: tabular-nums;
}

/* Biar angka enak dibaca (monospace look) */
td.harga,
td.rupiah,
input[type="number"]{
    font-feature-settings: "tnum";
}
