/* ==========================================================================
   POS TOKO — Unified Modern Retail POS Design System
   Applied globally without altering application workflow or markup structure.
   ========================================================================== */

:root {
    --pos-bg: #f1f5f9;
    --pos-bg-accent: #e8f1fb;
    --pos-surface: #ffffff;
    --pos-surface-soft: #f8fafc;
    --pos-ink: #0f172a;
    --pos-ink-2: #334155;
    --pos-muted: #64748b;
    --pos-line: #e2e8f0;
    --pos-line-strong: #cbd5e1;

    --pos-primary: #2563eb;
    --pos-primary-dark: #1d4ed8;
    --pos-primary-soft: #eff6ff;
    --pos-primary-ring: rgba(37, 99, 235, 0.16);

    --pos-success: #059669;
    --pos-success-soft: #ecfdf5;
    --pos-success-line: #a7f3d0;

    --pos-warning: #d97706;
    --pos-warning-soft: #fffbeb;
    --pos-warning-line: #fde68a;

    --pos-danger: #dc2626;
    --pos-danger-soft: #fef2f2;
    --pos-danger-line: #fecaca;

    --pos-radius: 14px;
    --pos-radius-sm: 9px;
    --pos-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --pos-shadow: 0 4px 16px rgba(15, 23, 42, 0.055), 0 1px 3px rgba(15, 23, 42, 0.04);
    --pos-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.09);

    --blue: #2563eb;
    --blue2: #3b82f6;
    --dark: #0f172a;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f1f5f9;
    --white: #ffffff;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    background: radial-gradient(circle at top right, #e0edff 0%, var(--pos-bg) 45%, #f8fafc 100%) fixed;
    color: var(--pos-ink);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* Headings & Text */
h1, h2, h3, h4 {
    color: var(--pos-ink);
    letter-spacing: -0.015em;
    font-weight: 700;
}

h1 {
    font-size: 1.65rem;
    line-height: 1.25;
}

h2 {
    font-size: 1.2rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.02rem;
}

.muted, .intro, .hint, .subtitle {
    color: var(--pos-muted) !important;
}

/* Sticky Unified Header / Topbar */
header.top, header.topbar, body > header, .pos-navbar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--pos-line) !important;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
    padding: 13px 26px !important;
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.pos-navbar-brand, header .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800 !important;
    font-size: 1.08rem !important;
    letter-spacing: -0.01em;
    color: var(--pos-ink) !important;
    text-decoration: none;
}

.pos-brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.pos-navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pos-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--pos-surface-soft);
    border: 1px solid var(--pos-line);
    border-radius: 999px;
    padding: 5px 12px 5px 6px;
    font-size: 12.5px;
    color: var(--pos-ink-2);
    font-weight: 600;
}

.pos-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--pos-primary-soft);
    color: var(--pos-primary);
    display: inline-grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}

.pos-role-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--pos-primary-soft);
    color: var(--pos-primary);
}

/* Containers */
.wrap, main.wrap, .container {
    max-width: 1320px;
}

/* Cards & Panels */
.panel, .box, .card, .stat, .metric, .action {
    background: var(--pos-surface);
    border: 1px solid var(--pos-line) !important;
    border-radius: var(--pos-radius) !important;
    box-shadow: var(--pos-shadow) !important;
}

.panel, .box {
    padding: 20px 22px;
}

a.card, a.action {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}

a.card:hover, a.action:hover {
    transform: translateY(-3px);
    border-color: #93c5fd !important;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.11) !important;
}

/* Inputs, Selects, Textareas */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select,
textarea {
    border: 1px solid var(--pos-line-strong) !important;
    border-radius: var(--pos-radius-sm) !important;
    background: #ffffff !important;
    color: var(--pos-ink) !important;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--pos-primary) !important;
    box-shadow: 0 0 0 3px var(--pos-primary-ring) !important;
}

input[type="file"] {
    font-size: 13px;
    color: var(--pos-ink-2);
    background: var(--pos-surface-soft);
    border: 1px dashed var(--pos-line-strong);
    border-radius: var(--pos-radius-sm);
    padding: 6px 10px;
}

label {
    color: var(--pos-ink-2);
    font-weight: 600;
}

/* Buttons */
.btn, button:not(.product-result):not(.customer-result):not(.pos-icon-btn):not(.pos-chip-btn) {
    border-radius: var(--pos-radius-sm) !important;
    font-family: inherit;
    font-weight: 600 !important;
    font-size: 13px;
    transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.btn {
    background: var(--pos-primary);
    color: #ffffff;
    border: 1px solid transparent;
    padding: 9px 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.18);
}

.btn:hover {
    background: var(--pos-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.btn:active {
    transform: translateY(0);
}

.btn.light, .light {
    background: var(--pos-primary-soft) !important;
    color: var(--pos-primary-dark) !important;
    border: 1px solid #dbeafe !important;
    box-shadow: none !important;
}

.btn.light:hover, .light:hover {
    background: #dbeafe !important;
}

.btn.secondary, .secondary {
    background: #ffffff !important;
    color: var(--pos-ink-2) !important;
    border: 1px solid var(--pos-line-strong) !important;
    box-shadow: var(--pos-shadow-sm) !important;
}

.btn.secondary:hover, .secondary:hover {
    background: var(--pos-surface-soft) !important;
    border-color: #94a3b8 !important;
}

.btn.hold, .hold {
    background: var(--pos-warning) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

.btn.hold:hover, .hold:hover {
    background: #b45309 !important;
}

.btn.success, .btn-success {
    background: var(--pos-success) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

.btn.success:hover, .btn-success:hover {
    background: #047857 !important;
}

.btn.danger, .btn.cancel, .danger, .cancel {
    background: var(--pos-danger-soft) !important;
    color: var(--pos-danger) !important;
    border: 1px solid var(--pos-danger-line) !important;
    box-shadow: none !important;
}

.btn.danger:hover, .btn.cancel:hover, .danger:hover, .cancel:hover {
    background: var(--pos-danger) !important;
    color: #ffffff !important;
    border-color: var(--pos-danger) !important;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 11px 12px !important;
    border-top: 1px solid var(--pos-line);
    border-bottom: 1px solid var(--pos-line) !important;
}

table thead th:first-child {
    border-top-left-radius: 10px;
}

table thead th:last-child {
    border-top-right-radius: 10px;
}

table tbody td {
    padding: 11px 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--pos-ink-2);
    font-size: 13px;
    vertical-align: middle;
}

table tbody tr:hover td {
    background: #f8fbff;
}

table tbody tr:last-child td {
    border-bottom: 0 !important;
}

/* Badges & Pills */
.tag, .status, .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tag:not(.off), .status:not(.inactive) {
    background: var(--pos-success-soft);
    color: var(--pos-success);
    border: 1px solid var(--pos-success-line);
}

.tag.off, .status.inactive {
    background: var(--pos-danger-soft) !important;
    color: var(--pos-danger) !important;
    border: 1px solid var(--pos-danger-line);
}

/* Alerts */
.alert, .success, .ok {
    border-radius: 12px !important;
    font-size: 13.5px;
}

.success {
    background: var(--pos-success-soft) !important;
    color: #065f46 !important;
    border: 1px solid var(--pos-success-line) !important;
    padding: 12px 16px !important;
}

.err, .error, .errors {
    background: var(--pos-danger-soft);
    color: #991b1b;
    border: 1px solid var(--pos-danger-line);
    border-radius: 12px;
    padding: 12px 16px;
}

/* ==========================================================================
   Fix Laravel Default Tailwind Pagination (prevents giant unstyled SVG arrows)
   ========================================================================== */
nav[role="navigation"] {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--pos-muted);
}

nav[role="navigation"] svg {
    width: 16px !important;
    height: 16px !important;
    display: inline-block;
    vertical-align: middle;
}

nav[role="navigation"] > div:first-child {
    display: none;
}

nav[role="navigation"] > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

nav[role="navigation"] p {
    margin: 0;
    font-size: 12.5px;
    color: var(--pos-muted);
}

nav[role="navigation"] span.relative,
nav[role="navigation"] a.relative {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--pos-line);
    background: #ffffff;
    color: var(--pos-ink-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 12.5px;
    margin: 0 2px;
    transition: all 0.14s ease;
}

nav[role="navigation"] a.relative:hover {
    background: var(--pos-primary-soft);
    border-color: #93c5fd;
    color: var(--pos-primary-dark);
}

nav[role="navigation"] span[aria-current="page"] > span {
    background: var(--pos-primary) !important;
    border-color: var(--pos-primary) !important;
    color: #ffffff !important;
}

nav[role="navigation"] span[aria-disabled="true"] > span {
    opacity: 0.45;
    cursor: not-allowed;
}

nav[role="navigation"] .inline-flex {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

@media (max-width: 640px) {
    header.top, header.topbar, body > header, .pos-navbar {
        padding: 11px 14px !important;
    }
    .panel, .box {
        padding: 15px 14px;
    }
    h1 {
        font-size: 1.38rem;
    }
    nav[role="navigation"] > div:first-child {
        display: flex;
        justify-content: space-between;
        width: 100%;
        gap: 8px;
    }
    nav[role="navigation"] > div:last-child {
        display: none;
    }
}

/* ==========================================================================
   Print Preservation — Never interfere with thermal/A4 printouts
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
    }
    header.top, header.topbar, body > header, .pos-navbar, .no-print, .filters, nav[role="navigation"] {
        display: none !important;
    }
    .panel, .box, .card, .stat, .metric {
        box-shadow: none !important;
        border-color: #cbd5e1 !important;
    }
}
