: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-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 216, 87, .50) 0 9%, transparent 24%),
        radial-gradient(circle at 86% 12%, rgba(255, 119, 80, .38) 0 8%, transparent 23%),
        radial-gradient(circle at 78% 82%, rgba(32, 191, 107, .34) 0 11%, transparent 27%),
        linear-gradient(135deg, #f7ffe8 0%, #e8f8ef 40%, #fff7dc 100%);
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    inset: -80px;
    z-index: 0;
    pointer-events: none;
}

.login-page::before {
    display: none;
}

.login-page::after {
    background:
        radial-gradient(circle, rgba(255,255,255,.58) 0 34%, transparent 36%) 8% 20% / 82px 82px no-repeat,
        radial-gradient(circle, rgba(255,255,255,.48) 0 34%, transparent 36%) 92% 72% / 96px 96px no-repeat,
        radial-gradient(circle, rgba(255,255,255,.40) 0 34%, transparent 36%) 22% 88% / 58px 58px no-repeat,
        linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,.14) 43% 48%, transparent 49% 100%);
    animation: lightSweep 9s ease-in-out infinite alternate;
}

.login-card {
    display: flex;
    width: 760px;
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 24px 70px rgba(24, 84, 39, .20);
    animation: loginCardIn .55s ease both;
}

/* KIRI */
.login-visual {
    width: 45%;
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 38% 36%, rgba(255,255,255,.95) 0 25%, transparent 26%),
        linear-gradient(160deg, #dcfce7 0%, #fff7c2 54%, #ffe1cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-visual::before {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(255,255,255,.48);
    box-shadow: 0 0 0 24px rgba(255,255,255,.18);
    animation: softPulse 3.8s ease-in-out infinite;
}

.login-visual img {
    width: 80%;
    max-width: 280px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 18px 22px rgba(27,94,32,.18));
}

/* KANAN */
.login-form {
    width: 55%;
    padding: 40px;
    background: #fff;
}

.login-form h1 {
    margin: 0;
    font-size: 24px;
    color: #14532d;
}

.login-form p {
    margin: 6px 0 24px;
    font-size: 14px;
    color: #58706a;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 6px;
    border: 1px solid #d8e6dc;
    font-size: 14px;
    background: #fbfffb;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #41a64d;
    box-shadow: 0 0 0 4px rgba(65,166,77,.14);
    transform: translateY(-1px);
}

.login-form button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #16803a, #ff7a1a);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(27,94,32,.22);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(27,94,32,.28);
    filter: saturate(1.08);
}

.login-footer {
    margin-top: 20px;
    font-size: 12px;
    color: #999;
}

@keyframes lightSweep {
    from { transform: translateX(-18px); opacity: .72; }
    to { transform: translateX(18px); opacity: 1; }
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes softPulse {
    0%, 100% { transform: scale(.94); opacity: .68; }
    50% { transform: scale(1.05); opacity: .9; }
}

@media (max-width: 820px) {
    .login-card {
        width: min(100%, 430px);
        flex-direction: column;
    }

    .login-visual,
    .login-form {
        width: 100%;
    }

    .login-visual {
        min-height: 180px;
    }

    .login-form {
        padding: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page::before,
    .login-page::after,
    .login-card,
    .login-visual::before,
    .login-visual img {
        animation: none;
    }
}

/* ===============================
   APP HEADER
================================ */

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 68px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1f4037, #2c7744);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    animation: headerFade .6s ease;
}

@keyframes headerFade {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-wrap {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrap img {
    max-width: 28px;
    max-height: 28px;
}

.brand-text {
    line-height: 1.1;
}

.company-name {
    font-size: 16px;
    font-weight: 700;
}

.company-sub {
    font-size: 11.5px;
    opacity: .85;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.15);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd200, #f7971e);
    color: #1f2937;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    opacity: .85;
    text-transform: uppercase;
}

/* ===============================
   SIDEBAR
================================ */

.sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 40px;
    width: 240px;
    background: linear-gradient(180deg,#ffffff,#f7f9fb);
    border-right: 1px solid #dbe5ef;
    padding: 12px 0;
    font-size: 14px;
    box-shadow: 4px 0 20px rgba(0,0,0,.06);
}

.sidebar-group {
    margin-bottom: 10px;
}

.sidebar-group-title {
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: #243447;
    font-weight: 600;
}

.sidebar-item.active,
.sidebar-submenu a.active {
    background: linear-gradient(135deg,#2ecc71,#27ae60);
    color: #fff;
    border-radius: 8px;
}

.sidebar-submenu {
    display: none;
    padding-left: 10px;
}

.sidebar-group.open .sidebar-submenu {
    display: block;
}

.sidebar-submenu a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #34495e;
    font-size: 13px;
}

/* ===============================
   CONTENT
================================ */

.content {
    margin-top: 0px;
    margin-left: 240px;
    margin-bottom: 40px;
    padding: 24px;
}

/* ===============================
   DASHBOARD / CARD
================================ */

.dashboard-hero {
    background: linear-gradient(135deg, #e8f5e9, #ffffff);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.dashboard-hero h1 {
    margin-top: 0;
}

.card {
    background: var(--card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

/* ===============================
   FOOTER
================================ */

.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: 260px;
}

/* ===============================
   FORM UTILITIES
================================ */

input[type="number"] {
    text-align: right;
}

.text-right {
    text-align: right;
}

.thumb {
    width: 100px;
}

/* SUPPLIER / CUSTOMER */

.supplier-wrap,
.customer-wrap {
    display: flex;
    gap: 10px;
}

.supplier-wrap input,
.customer-wrap input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f9fafb;
    font-weight: 600;
}

.btn-supplier,
.btn-customer {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-supplier:hover,
.btn-customer:hover {
    background: #0b5ed7;
}
