/* ============================================================
   LAUNDRY SYSTEM v2 - STYLESHEET UTAMA
   Vibe: modern, clean, profesional, soft & dynamic
   ============================================================ */

:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --border: #e9edec;
    --text: #232b2e;
    --text-muted: #6b7278;
    --primary: #3b7cf3;
    --primary-dark: #2f6adb;
    --primary-soft: #e8f0fe;
    --success: #1c9a5b;
    --success-soft: #e6f7ee;
    --warning: #b98900;
    --warning-soft: #fef6e0;
    --danger: #d84b3e;
    --danger-soft: #fdeceb;
    --gray-soft: #f1f2f3;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
    --sidebar-w: 240px;
}

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

body {
    margin: 0;
    font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--primary-dark); }
h1,h2,h3,h4 { font-weight: 600; color: #1b2126; margin-top: 0; letter-spacing: -0.01em; }
p { color: var(--text-muted); margin: 0 0 12px; }

/* ---------- APP SHELL: SIDEBAR + KONTEN ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 40;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 22px 18px;
    font-weight: 700; font-size: 1.05rem;
}
.brand-mark { font-size: 1.4rem; }

.sidebar-nav { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500; font-size: 0.92rem;
    transition: background-color .2s ease, color .2s ease;
}
.nav-item:hover { background: var(--gray-soft); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.nav-logout:hover { background: var(--danger-soft); color: var(--danger); }

.main-area { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- TOPBAR ---------- */
.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 1.2rem; margin: 0; flex: 1; }
.hamburger { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text); }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.role-chip {
    background: var(--primary-soft); color: var(--primary-dark);
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px; letter-spacing: .03em;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.user-name { font-size: 0.88rem; font-weight: 500; color: var(--text); }

.content { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- CARD ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    margin-bottom: 24px;
}
.card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; color: #333a40; }

/* Grid widget beranda */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.widget {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.widget:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.widget-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.widget-value { font-size: 1.7rem; font-weight: 700; color: #1b2126; }
.widget-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.widget-accent-blue   { border-left: 3px solid var(--primary); }
.widget-accent-green  { border-left: 3px solid var(--success); }
.widget-accent-yellow { border-left: 3px solid var(--warning); }
.widget-accent-red    { border-left: 3px solid var(--danger); }

/* ---------- CTA BESAR (member beranda) ---------- */
.cta-banner {
    background: linear-gradient(135deg, #3b7cf3, #6aa0ff);
    color: #fff;
    border-radius: var(--radius);
    padding: 28px 26px;
    margin-bottom: 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    flex-wrap: wrap;
}
.cta-banner h2 { color: #fff; margin-bottom: 6px; }
.cta-banner p { color: rgba(255,255,255,0.88); margin-bottom: 0; }
.cta-banner .btn { background: #fff; color: var(--primary-dark); font-weight: 700; }
.cta-banner .btn:hover { background: #f1f5ff; }

/* ---------- TABEL MODERN ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}
th, td { padding: 14px 18px; text-align: left; border: none; }
thead th {
    background: #fafbfb; color: var(--text-muted);
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid #f0f2f1; transition: background-color .2s ease; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f7faff; }
td { font-size: 0.9rem; color: #3a4046; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.table-wrap table { box-shadow: none; margin-bottom: 0; }

/* ---------- BADGE STATUS ---------- */
.badge {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    font-size: 0.74rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.badge-blue   { background: var(--primary-soft); color: var(--primary-dark); }
.badge-yellow { background: var(--warning-soft); color: var(--warning); }
.badge-green  { background: var(--success-soft); color: var(--success); }
.badge-red    { background: var(--danger-soft); color: var(--danger); }
.badge-gray   { background: var(--gray-soft); color: var(--text-muted); }

/* ---------- FORM ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
label { display: block; font-size: 0.85rem; font-weight: 500; color: #4a5157; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="search"],
select, textarea {
    width: 100%; padding: 10px 14px; font-size: 0.92rem; font-family: inherit; color: var(--text);
    background: #fbfcfc; border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 3px rgba(59,124,243,0.12);
}
input::placeholder, textarea::placeholder { color: #a7adb1; }
input[type="checkbox"], input[type="radio"] { width: auto; margin-right: 8px; accent-color: var(--primary); vertical-align: middle; }

.radio-card-group { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.radio-card {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 16px; cursor: pointer; flex: 1; min-width: 180px;
    transition: border-color .2s ease, background-color .2s ease;
}
.radio-card:hover { background: #fafbfc; }
.radio-card input { margin-right: 8px; }

/* ---------- BUTTON ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; font-family: inherit; font-size: 0.88rem; font-weight: 600;
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(59,124,243,.25); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #167f4a; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b53a2f; color: #fff; }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--gray-soft); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }
button, input[type="submit"] { font-family: inherit; }

.action-links a { font-size: 0.85rem; font-weight: 500; margin-right: 10px; }
.action-links a.link-danger { color: var(--danger); }

/* ---------- ALERT ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; margin-bottom: 16px; }
.alert-error   { background: var(--danger-soft);  color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }

/* ---------- TIMELINE (tracking pelanggan) ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    position: relative; padding: 0 0 26px 34px; border-left: 2px solid var(--border);
    margin-left: 8px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ''; position: absolute; left: -7px; top: 0;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--gray-soft); border: 2px solid var(--surface);
}
.timeline li.done::before { background: var(--success); }
.timeline li.current::before { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-title { font-weight: 600; font-size: 0.92rem; color: #1b2126; }
.timeline-time { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.timeline-note { font-size: 0.84rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- PROGRESS STEPS (status horizontal ringkas) ---------- */
.steps { display: flex; align-items: center; margin: 6px 0 22px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; }
.step-dot {
    width: 26px; height: 26px; border-radius: 50%; background: var(--gray-soft);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.step.done .step-dot { background: var(--success); color: #fff; }
.step.current .step-dot { background: var(--primary); color: #fff; }
.step-label { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }
.step.done .step-label, .step.current .step-label { color: var(--text); font-weight: 600; }
.step-line { width: 28px; height: 2px; background: var(--border); margin: 0 6px; }
.step-line.done { background: var(--success); }

/* ---------- CHART BAR (vanilla, tanpa library) ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar {
    width: 100%; max-width: 26px; background: var(--primary-soft); border-radius: 4px 4px 0 0;
    transition: background-color .2s ease;
    position: relative;
}
.chart-bar:hover { background: var(--primary); }
.chart-bar-label { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }

.kpi-compare { display: flex; align-items: baseline; gap: 10px; }
.kpi-growth-up { color: var(--success); font-weight: 700; font-size: 0.85rem; }
.kpi-growth-down { color: var(--danger); font-weight: 700; font-size: 0.85rem; }

/* ---------- EMPTY STATE ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }

/* ---------- SEARCH BAR ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar input, .search-bar select { max-width: 280px; }

/* ---------- LABEL / NOTA CETAK ---------- */
.print-label {
    max-width: 380px; margin: 30px auto; background: #fff; padding: 24px;
    border: 1px dashed #c9cfce; border-radius: var(--radius);
}
.print-label h2 { text-align: center; margin-bottom: 4px; }
.print-label .barcode-wrap { text-align: center; margin: 16px 0; }
.print-only-actions { text-align: center; margin: 16px 0; }
@media print {
    .sidebar, .topbar, .print-only-actions { display: none !important; }
    .main-area { margin-left: 0 !important; }
    body { background: #fff; }
    .print-label { border: none; margin: 0; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
    .main-area { margin-left: 0; }
    .hamburger { display: block; }
    .content { padding: 18px; }
    .user-name { display: none; }
}

@media (max-width: 600px) {
    .table-wrap table, table { min-width: 560px; }
    .cta-banner { flex-direction: column; align-items: flex-start; }
}
