* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
}

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

.sidebar {
    width: 240px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    padding: 0 20px 20px;
    border-bottom: 1px solid #1e293b;
}

.sidebar .brand .brand-name {
    color: #e2e8f0;
}

.sidebar .brand .brand-name span {
    color: #38bdf8;
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    background: #fff;
    padding: 2px;
}

.sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #1e293b;
    color: #38bdf8;
    border-left: 3px solid #38bdf8;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar .user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #38bdf8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.topbar .user-info .name {
    font-weight: 600;
}

.topbar .user-info .role {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content {
    padding: 24px;
    flex: 1;
}

h2 {
    margin-bottom: 16px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card .label {
    font-size: 13px;
    color: #64748b;
}

.card .value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}

.card .value.blue   { color: #0284c7; }
.card .value.green  { color: #16a34a; }
.card .value.amber  { color: #d97706; }
.card .value.violet { color: #7c3aed; }

.panel {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.panel h3 {
    margin-bottom: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

th {
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.empty {
    text-align: center;
    color: #94a3b8;
    padding: 24px;
}

.btn {
    display: inline-block;
    background: #0284c7;
    color: #fff;
    padding: 9px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #0369a1;
}

.btn.secondary {
    background: #334155;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.admin       { background: #dbeafe; color: #1d4ed8; }
.badge.supervisor  { background: #fef3c7; color: #b45309; }
.badge.staff       { background: #dcfce7; color: #15803d; }
.badge.cash        { background: #dcfce7; color: #15803d; }
.badge.qris        { background: #fce7f3; color: #be185d; }
.badge.debit       { background: #ede9fe; color: #6d28d9; }
.badge.split       { background: #ffedd5; color: #c2410c; }

.actions a {
    margin-right: 8px;
}

.flex-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.flex-head h2 {
    margin-bottom: 0;
}

.muted {
    color: #94a3b8;
}

.danger-text {
    color: #dc2626;
    font-weight: 700;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn.danger {
    background: #dc2626;
}

.btn.danger:hover {
    background: #b91c1c;
}

.td-actions a,
.td-actions form {
    margin-right: 6px;
}

.role-select {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* ==== Laporan ==== */
.report-filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.report-filters .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.report-filter-action {
    margin-left: auto;
}

@media (max-width: 700px) {
    .report-filter-action {
        margin-left: 0;
    }
}

@media print {
    .report-filters {
        display: none;
    }
}

.print-report {
    max-width: 800px;
    margin: 24px auto;
    padding: 24px;
    font-size: 13px;
}

.print-head {
    text-align: center;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.print-head .brand-line {
    font-size: 24px;
    font-weight: 800;
}

.print-head .brand-line span {
    color: #0284c7;
}

.print-head .store {
    font-size: 15px;
    font-weight: 600;
}

.print-head .periode {
    font-size: 13px;
    color: #475569;
}

.print-sum {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.print-sum > div {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.print-sum span {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.print-sum b {
    font-size: 15px;
}

.print-report h3 {
    margin: 18px 0 8px;
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #0c4a6e 60%, #0284c7 100%);
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
}

.auth-card.privasi-card {
    max-width: 760px;
    text-align: left;
}

.auth-card .brand {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.auth-card .brand span {
    color: #0284c7;
}

.auth-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border 0.2s, box-shadow 0.2s;
}

.form-group select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-group input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.form-group .form-hint {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

.logo-preview img {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    display: block;
    margin-bottom: 10px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.btn.block {
    width: 100%;
    text-align: center;
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin-top: 18px;
}

.auth-footer a {
    color: #0284c7;
    font-weight: 600;
    text-decoration: none;
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 18px;
}

.alert.error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #0f172a 0%, #0c4a6e 60%, #0284c7 100%);
    color: #fff;
    text-align: center;
}

.hero .brand {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 8px;
}

.hero .brand span {
    color: #38bdf8;
}

.hero .tagline {
    font-size: 16px;
    color: #bae6fd;
    max-width: 480px;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 24px;
    width: 240px;
    backdrop-filter: blur(4px);
}

.hero-card h3 {
    margin-bottom: 8px;
}

.hero-card p {
    font-size: 13px;
    color: #bae6fd;
    margin-bottom: 16px;
}

.hero-card .btn {
    width: 100%;
    text-align: center;
}

.hero-card .btn.outline {
    background: transparent;
    border: 1px solid #38bdf8;
}

/* ==== Halaman Kasir ==== */
.kasir-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .kasir-grid {
        grid-template-columns: 1fr;
    }
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.search-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.cart-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 16px;
    position: sticky;
    top: 16px;
}

.cart-panel h3 {
    margin-bottom: 12px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.cart-item:last-of-type {
    border-bottom: none;
}

.cart-item .info {
    flex: 1;
    min-width: 0;
}

.cart-item .info .nama {
    font-weight: 600;
    font-size: 14px;
}

.cart-item .info .detail {
    font-size: 12px;
    color: #64748b;
}

.qty-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn.icon {
    padding: 4px 10px;
    font-size: 13px;
    min-width: 30px;
}

.qty-ctrl .qty {
    min-width: 28px;
    text-align: center;
    font-weight: 600;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    margin: 14px 0;
}

.cart-panel .btn.block {
    width: 100%;
}

.produk-qty {
    width: 56px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
}

.payment-box {
    margin: 12px 0;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.payment-box h4 {
    font-size: 13px;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 8px;
}

.pm-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pm-option {
    flex: 1;
    min-width: 70px;
    text-align: center;
    padding: 8px 4px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    background: #fff;
    transition: border 0.15s, color 0.15s;
}

.pm-option:hover {
    border-color: #94a3b8;
}

.pm-option.active {
    border-color: #0284c7;
    color: #0284c7;
    background: #f0f9ff;
}

.pm-option input {
    display: none;
}

.pm-panel {
    padding: 10px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

.split-row {
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: #f8fafc;
}

.split-row-main {
    display: flex;
    gap: 6px;
    align-items: center;
}

.split-row select,
.split-row input {
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.split-row select {
    flex: 0 0 90px;
}

.split-row .amt {
    flex: 1;
    min-width: 0;
}

.split-row .btn-ref {
    flex-shrink: 0;
    white-space: nowrap;
}

.split-row .icon {
    flex-shrink: 0;
}

.split-ref-wrap {
    display: none;
    margin-top: 8px;
}

.split-ref-wrap .ref {
    width: 100%;
}

.split-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.split-info b {
    color: #0f172a;
}

.pm-cash-change {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

/* ==== Struk / Receipt ==== */
.receipt {
    max-width: 420px;
    margin: 24px auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.receipt .head {
    text-align: center;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.receipt .head .brand-line {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.receipt .head .brand-line span {
    color: #0284c7;
}

.receipt .head .store {
    font-size: 14px;
    color: #334155;
}

.receipt .meta {
    font-size: 13px;
    color: #475569;
    margin-bottom: 12px;
    line-height: 1.7;
}

.receipt .meta .baris {
    display: flex;
    justify-content: space-between;
}

.receipt table {
    font-size: 13px;
}

.receipt .grand {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 16px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 10px;
    margin-top: 6px;
}

.receipt .footer {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    margin-top: 16px;
}

.no-print {
    text-align: center;
    margin-bottom: 16px;
}

/* ==== Responsif ==== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table {
    min-width: 520px;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    background: #1e293b;
    border-radius: 2px;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.sidebar-backdrop {
    display: none;
}

.topbar-title {
    font-weight: 600;
}

@media (max-width: 900px) {
    .dashboard {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 260px;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 30px rgba(15, 23, 42, 0.45);
    }

    .brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-right: 12px;
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease;
        z-index: 250;
    }

    .sidebar-backdrop.open {
        opacity: 1;
        visibility: visible;
    }

    .hamburger {
        display: inline-flex;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .topbar {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 10px 12px;
        gap: 8px;
    }

    .content {
        padding: 16px 12px;
    }

    .panel {
        padding: 14px;
    }

    .topbar .user-info {
        display: none;
    }

    .topbar .avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    th, td {
        padding: 8px 8px;
        font-size: 13px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .card .value {
        font-size: 22px;
    }

    .btn {
        padding: 9px 12px;
        font-size: 13px;
    }

    .pm-options {
        flex-wrap: wrap;
    }

    .split-row .amt {
        flex: 1;
    }
}

@media print {
    .no-print {
        display: none;
    }
    body {
        background: #fff;
    }
    .receipt {
        box-shadow: none;
        margin: 0 auto;
        border-radius: 0;
    }
}