*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg-body: #fdf7ef; /* vanilla/cream */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(209, 213, 219, 0.9);
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.12);
    --accent-strong: #c2410c;
    --danger: #b91c1c;
    --success: #15803d;
    --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.12);
    --radius-lg: 18px;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background: var(--bg-body);
}

/* Background dekorasi tipis */
.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 0% 0%, rgba(248, 250, 252, 0.9), transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(254, 243, 199, 0.9), transparent 55%),
        radial-gradient(circle at 0% 100%, rgba(254, 226, 226, 0.9), transparent 55%);
    opacity: 0.7;
    z-index: -2;
}

body.landing-body,
.body-admin {
    min-height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Glass card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    padding: 18px 20px;
}

/* Logo & nav */
.logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: contain;
    background: #f9fafb;
    padding: 4px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.logo-title h1 {
    margin: 0;
    font-size: 22px;
    color: var(--accent-strong);
}
.logo-title p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Navigation */
.top-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.top-nav a {
    font-size: 13px;
    text-decoration: none;
    color: var(--text-main);
    padding: 7px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.18s ease;
}
.top-nav a:hover {
    background: #fff7ed;
    border-color: #fed7aa;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s, color 0.12s;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #fdba74);
    color: #111827;
    border-color: #f97316;
    box-shadow: 0 10px 24px rgba(248, 113, 22, 0.25);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(248, 113, 22, 0.3);
    background: linear-gradient(135deg, #ea580c, #fdba74);
}

.btn-secondary {
    background: #111827;
    color: #f9fafb;
    border-color: #111827;
}
.btn-secondary:hover {
    background: #020617;
}

.btn-outline {
    background: #ffffff;
    color: var(--text-main);
    border-color: #d1d5db;
}
.btn-outline:hover {
    background: #f9fafb;
}

.btn-primary.small,
.btn-secondary.small,
.btn-outline.small {
    padding: 6px 11px;
    font-size: 12px;
}

.btn-primary.full,
.btn-secondary.full,
.btn-outline.full {
    width: 100%;
}

.btn-small-link {
    font-size: 12px;
    color: var(--accent-strong);
    text-decoration: none;
}
.btn-small-link:hover {
    text-decoration: underline;
}

/* Landing layout */
.landing-header {
    margin-top: 18px;
    width: min(1100px, 100% - 32px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero {
    margin-top: 18px;
    width: min(1100px, 100% - 32px);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
}

.hero-text h2 {
    margin: 0 0 12px;
    font-size: 28px;
    color: var(--text-main);
}
.hero-text p {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--text-muted);
}
.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.hero-note {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.hero-visual {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.hero-chip {
    padding: 7px 12px;
    border-radius: 999px;
    background: #fef9c3;
    border: 1px solid #facc15;
    color: #854d0e;
    font-size: 12px;
}
.hero-jacket-card {
    width: 100%;
    max-width: 280px;
    border-radius: 18px;
    background: #0f172a;
    color: #f9fafb;
    padding: 16px 18px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.35);
    position: relative;
}
.hero-jacket-card .tag {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #bbf7d0;
    color: #14532d;
    font-weight: 600;
}
.hero-jacket-card h3 {
    margin: 10px 0 4px;
    font-size: 16px;
}
.hero-jacket-card p {
    margin: 0;
    font-size: 13px;
}

/* Sections */
.section {
    margin-top: 18px;
    width: min(1100px, 100% - 32px);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.section-header.small {
    flex-direction: column;
    align-items: flex-start;
}
.section-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-main);
}
.section-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Product cards - 5 columns */
.card-grid {
    display: grid;
    gap: 10px;
}
.card-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.product-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.product-image {
    border-radius: 10px;
    background: #e5e7eb;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.placeholder-img-text {
    color: #374151;
    font-weight: 700;
    font-size: 18px;
}
.product-card h3 {
    margin: 2px 0 2px;
    font-size: 13px;
    color: var(--text-main);
}
.product-meta {
    margin-top: 2px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    color: var(--text-muted);
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    font-size: 13px;
    color: var(--text-main);
}
.contact-grid h3 {
    margin: 0 0 6px;
    font-size: 14px;
}

/* Landing footer */
.landing-footer {
    margin: 18px auto 22px;
    width: min(1100px, 100% - 32px);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* Floating WhatsApp */
.floating-wa {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 16px 28px rgba(22, 163, 74, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f9fafb;
    font-weight: 700;
    text-decoration: none;
    z-index: 50;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.floating-wa span {
    font-size: 14px;
}
.floating-wa:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 20px 34px rgba(22, 163, 74, 0.45);
}

/* Auth */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    width: min(360px, 100% - 32px);
}
.auth-card h2 {
    margin: 0 0 6px;
    color: var(--text-main);
}
.auth-card p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-card label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-main);
}
.auth-card input {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-main);
}
.auth-card input:focus {
    outline: 2px solid #bfdbfe;
}
.back-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent-strong);
    text-decoration: none;
}
.back-link:hover {
    text-decoration: underline;
}
.hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Admin layout */
.app-header {
    margin: 16px auto 4px;
    width: min(1160px, 100% - 24px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    color: var(--text-main);
}
.app-header h1 {
    font-size: 18px;
}
.app-header p {
    font-size: 12px;
    color: var(--text-muted);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-main);
}

.app-main {
    margin: 0 auto 24px;
    width: min(1160px, 100% - 24px);
}

.app-footer {
    margin: 0 auto 18px;
    width: min(1160px, 100% - 24px);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* Dashboard grid */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
    gap: 16px;
    margin-top: 10px;
}
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.dashboard-side {
    align-self: flex-start;
}

/* Charts */
.chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: 12px;
}
.chart-grid.single {
    grid-template-columns: minmax(0, 1fr);
}
.chart-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px;
    border: 1px solid #e5e7eb;
}
.chart-card h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--text-main);
}

/* Forms */
.form-transaksi label,
.form-inventaris label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-main);
}
.form-transaksi input,
.form-transaksi select,
.form-transaksi textarea,
.form-inventaris input,
.form-inventaris select,
.form-inventaris textarea {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 7px 11px;
    font-size: 12px;
    color: var(--text-main);
    resize: vertical;
}
.form-transaksi textarea,
.form-inventaris textarea {
    border-radius: 14px;
}
.form-transaksi input:focus,
.form-transaksi select:focus,
.form-transaksi textarea:focus,
.form-inventaris input:focus,
.form-inventaris select:focus,
.form-inventaris textarea:focus {
    outline: 2px solid #bfdbfe;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* Produk rows di form transaksi */
.produk-section {
    margin: 10px 0 8px;
    padding: 8px 10px;
    border-radius: 14px;
    background: #fefce8;
    border: 1px solid #facc15;
}
.produk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.produk-header h3 {
    margin: 0;
    font-size: 13px;
    color: var(--text-main);
}
.produk-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.produk-row {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.3fr) minmax(0, 0.7fr) auto;
    gap: 6px;
}
.produk-row select,
.produk-row input {
    font-size: 11px;
}
.produk-harga {
    width: 100%;
}
.produk-qty {
    width: 100%;
}
.btn-remove-row {
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 14px;
    width: 28px;
    cursor: pointer;
}
.btn-remove-row:hover {
    background: #fecaca;
}

/* Tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--text-main);
}
thead {
    background: #f9fafb;
}
th, td {
    padding: 7px 9px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
th {
    font-weight: 600;
    font-size: 12px;
}
tbody tr:nth-child(even) {
    background: #f9fafb;
}

/* Alerts & stats */
.alert {
    margin-bottom: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid;
}
.alert-success {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}
.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 10px 0 12px;
}
.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
}
.stat-card .label {
    font-size: 11px;
    color: var(--text-muted);
}
.stat-card .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* Filter row */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.filter-row label {
    font-size: 12px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-row input,
.filter-row select {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-main);
}

/* Grid utility */
.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 10px;
}

/* Misc */
.hint.small {
    font-size: 11px;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 1100px) {
    .card-grid-5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 880px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }
    .app-header {
        grid-template-columns: 1fr;
        text-align: left;
        row-gap: 8px;
    }
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
    .chart-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .card-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .landing-header,
    .hero,
    .section,
    .landing-footer,
    .app-header,
    .app-main,
    .app-footer {
        width: 100%;
        margin-left: 12px;
        margin-right: 12px;
    }
    .card-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .produk-row {
        grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.4fr);
        grid-auto-rows: auto;
        grid-auto-flow: row;
    }
    .produk-harga,
    .produk-qty,
    .btn-remove-row {
        grid-column: span 1;
    }
}
