/* ============================================================
   Billio - Custom Styling
   Palet: hangat, kreatif, tegas (untuk kreator & freelancer)
   ============================================================ */

:root {
    --ink: #17151a;
    --paper: #faf7f2;
    --card: #ffffff;
    --accent: #ff5a36;      /* oranye terakota - energik, kreatif */
    --accent-dark: #e2461f;
    --accent-soft: #ffe7de;
    --teal: #0f7a70;        /* aksen kedua - uang/kepercayaan */
    --teal-soft: #dff3f0;
    --muted: #756f6a;
    --border: #ece6de;
    --sidebar-bg: #1c1a22;
    --sidebar-text: #cfcad6;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--paper);
    color: var(--ink);
    margin: 0;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 26px 24px;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
}
.brand-icon {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

.sidebar-nav { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.15s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.sidebar-nav a i { font-size: 1.05rem; width: 20px; }

.sidebar-footer { padding: 18px; border-top: 1px solid rgba(255,255,255,0.08); }
.logout-link { color: #d99; text-decoration: none; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.logout-link:hover { color: #fff; }
.plan-badge-link { color: #cfc9d6; text-decoration: none; font-size: 0.84rem; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.plan-badge-link:hover { color: #fff; }

/* ---------- Main ---------- */
.main-content { margin-left: 250px; flex: 1; min-width: 0; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 32px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.3rem; font-weight: 800; }
.btn-hamburger { border: none; background: none; font-size: 1.4rem; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.user-name { font-weight: 700; font-size: 0.88rem; line-height: 1.2; }
.user-business { font-size: 0.76rem; color: var(--muted); }

.page-content { padding: 28px 32px 60px; }

/* ---------- Cards ---------- */
.card-custom {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 22px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.stat-card .stat-label { color: var(--muted); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; margin-top: 6px; }
.stat-card .stat-icon {
    position: absolute; right: 16px; top: 16px;
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.stat-icon.orange { background: var(--accent-soft); color: var(--accent-dark); }
.stat-icon.teal { background: var(--teal-soft); color: var(--teal); }
.stat-icon.dark { background: #eee; color: #333; }

/* ---------- Buttons ---------- */
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline-accent { border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.btn-outline-accent:hover { background: var(--accent); color: #fff; }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.btn-teal:hover { background: #0b6058; border-color: #0b6058; color: #fff; }

/* ---------- Tables ---------- */
.table-custom { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.table-custom table { margin-bottom: 0; }
.table-custom thead th {
    background: #f5f1ea; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--muted); font-weight: 700; border-bottom: none; padding: 13px 16px;
}
.table-custom tbody td { padding: 13px 16px; vertical-align: middle; border-color: var(--border); font-size: 0.9rem; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: 0.86rem; }
.form-control, .form-select {
    border-radius: 9px; border: 1px solid var(--border); padding: 9px 12px; font-size: 0.9rem;
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Login page ---------- */
.auth-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1c1a22 0%, #2a2532 100%);
    padding: 20px;
}
.auth-card {
    background: #fff; border-radius: 20px; padding: 40px; width: 100%; max-width: 420px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-weight: 800; font-size: 1.3rem; }
.auth-logo .brand-icon { width: 38px; height: 38px; }

/* ---------- Invoice print view ---------- */
.invoice-paper {
    background: #fff; max-width: 800px; margin: 0 auto; padding: 50px;
    border-radius: var(--radius); border: 1px solid var(--border);
}
.invoice-paper .inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 40px; }
.invoice-paper .inv-title { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.invoice-paper table.items { width: 100%; border-collapse: collapse; margin: 24px 0; }
.invoice-paper table.items th { text-align: left; font-size: 0.75rem; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 8px 6px; }
.invoice-paper table.items td { padding: 10px 6px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.invoice-paper .inv-total-box { margin-left: auto; width: 280px; }
.invoice-paper .inv-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; }
.invoice-paper .inv-total-row.grand { font-size: 1.2rem; font-weight: 800; border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 12px; }

@media print {
    .no-print { display: none !important; }
    .sidebar, .topbar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .invoice-paper { border: none; box-shadow: none; }
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

.badge { font-weight: 600; padding: 6px 10px; border-radius: 7px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 2.5rem; opacity: 0.4; margin-bottom: 12px; display: block; }

/* ---------- Papan Proyek (Kanban) ---------- */
.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
}
.kanban-col {
    background: #f2ede4;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 12px;
    flex: 0 0 275px;
    min-width: 275px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.kanban-col.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.kanban-col-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.kanban-col-title { font-weight: 700; font-size: 0.86rem; }
.kanban-col-count {
    background: #fff; border-radius: 20px; padding: 1px 9px; font-size: 0.75rem; font-weight: 700; color: var(--muted);
    border: 1px solid var(--border);
}
.kanban-col-total { font-size: 0.76rem; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.kanban-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.kanban-empty { text-align: center; color: var(--muted); font-size: 0.78rem; padding: 18px 8px; border: 1px dashed var(--border); border-radius: 10px; }
.kanban-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
    cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.35; }
.kanban-card-title { font-weight: 700; font-size: 0.88rem; line-height: 1.25; }
.kanban-deadline { font-size: 0.74rem; }

@media (max-width: 575px) {
    .kanban-col { flex: 0 0 240px; min-width: 240px; }
}
