/* ======================================================================
   We Know IT Ltd — POS System CSS
   Bootstrap 5 companion stylesheet.
   Covers POS register app + admin back office.
   Primary: #025add | Accent: #f97316 | Dark-mode aware
   ====================================================================== */

/* ------------------------------------------------------------------
   1. CSS Custom Properties
   ------------------------------------------------------------------ */
:root {
    --color-primary: #025add;
    --color-primary-hover: #0148b3;
    --color-primary-light: #e8f0fe;
    --color-primary-rgb: 2, 90, 221;

    --color-accent: #f97316;
    --color-accent-hover: #ea670c;
    --color-accent-light: #fff5eb;

    --color-success: #16a34a;
    --color-success-light: #f0fdf4;
    --color-danger: #dc2626;
    --color-danger-light: #fef2f2;
    --color-warning: #eab308;
    --color-warning-light: #fefce8;
    --color-info: #0ea5e9;
    --color-info-light: #f0f9ff;

    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-heading: #0f172a;

    --color-bg: #f8fafc;
    --color-bg-card: #ffffff;
    --color-bg-sidebar: #0f172a;
    --color-bg-input: #ffffff;
    --color-border: #e2e8f0;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, .07), 0 2px 4px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, .1), 0 4px 6px rgba(0, 0, 0, .05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, .1), 0 8px 10px rgba(0, 0, 0, .04);

    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;

    --sidebar-width: 250px;
    --header-height: 56px;
    --pos-header-height: 48px;
}

/* ------------------------------------------------------------------
   2. Dark Mode
   ------------------------------------------------------------------ */
body.dark {
    --color-primary-light: #1a2744;
    --color-accent-light: #2d2013;
    --color-success-light: #14291d;
    --color-danger-light: #2d1616;
    --color-warning-light: #2d2a10;
    --color-info-light: #122936;

    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-heading: #f1f5f9;

    --color-bg: #0f172a;
    --color-bg-card: #1e293b;
    --color-bg-sidebar: #020617;
    --color-bg-input: #1e293b;
    --color-border: #334155;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .2);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, .4), 0 4px 6px rgba(0, 0, 0, .2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, .5), 0 8px 10px rgba(0, 0, 0, .3);
}

/* ------------------------------------------------------------------
   3. Base / Reset
   ------------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Source+Code+Pro:wght@400;600;700&display=swap');

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--color-text);
    background-color: var(--color-bg);
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    font-weight: 600;
    line-height: 1.25;
    margin-top: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-hover);
}

.font-mono {
    font-family: 'Source Code Pro', ui-monospace, monospace;
}

/* ------------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    line-height: 1.5;
    white-space: nowrap;
    user-select: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
}

.btn-accent {
    background-color: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.btn-accent:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #fff;
}

.btn-success {
    background-color: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}
.btn-success:hover {
    background-color: #15803d;
    border-color: #15803d;
    color: #fff;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}
.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-outline:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    background-color: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: var(--radius);
}

.btn-icon.btn-sm {
    width: 1.75rem;
    height: 1.75rem;
}

/* ------------------------------------------------------------------
   5. Badges
   ------------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.4;
    white-space: nowrap;
}

.badge-completed,
.badge-success,
.badge-paid {
    background-color: var(--color-success-light);
    color: var(--color-success);
}

.badge-refunded,
.badge-danger,
.badge-failed {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
}

.badge-voided,
.badge-closed,
.badge-inactive {
    background-color: #f1f5f9;
    color: #64748b;
}
body.dark .badge-voided,
body.dark .badge-closed,
body.dark .badge-inactive {
    background-color: #334155;
    color: #94a3b8;
}

.badge-open,
.badge-info,
.badge-active {
    background-color: var(--color-info-light);
    color: var(--color-info);
}

.badge-low,
.badge-warning,
.badge-pending,
.badge-partial {
    background-color: var(--color-warning-light);
    color: #a16207;
}
body.dark .badge-low,
body.dark .badge-warning,
body.dark .badge-pending,
body.dark .badge-partial {
    color: var(--color-warning);
}

.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

/* ------------------------------------------------------------------
   6. Cards
   ------------------------------------------------------------------ */
.card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-header h3,
.card-header h4 {
    margin-bottom: 0;
    font-size: 1rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

/* ------------------------------------------------------------------
   7. Tables
   ------------------------------------------------------------------ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background-color: var(--color-bg);
}
body.dark .data-table thead {
    background-color: var(--color-bg-sidebar);
}

.data-table th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: left;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1px solid var(--color-border);
    cursor: default;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable::after {
    content: '\2195';
    margin-left: 0.375rem;
    opacity: 0.3;
    font-size: 0.7rem;
}

.data-table th.sortable.asc::after {
    content: '\2191';
    opacity: 0.8;
}

.data-table th.sortable.desc::after {
    content: '\2193';
    opacity: 0.8;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition);
}

.data-table tbody tr:hover {
    background-color: rgba(var(--color-primary-rgb), 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .text-right {
    text-align: right;
}

.data-table .text-center {
    text-align: center;
}

/* ------------------------------------------------------------------
   8. Form Inputs
   ------------------------------------------------------------------ */
.form-control,
.form-select {
    background-color: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-heading);
}

.form-group {
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.input-group .form-control:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

/* ------------------------------------------------------------------
   9. Toast / Notification
   ------------------------------------------------------------------ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: toastSlideIn 0.3s ease forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.removing {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
}

.toast-body {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    font-size: 1.125rem;
}

.toast-success { border-left: 3px solid var(--color-success); }
.toast-danger  { border-left: 3px solid var(--color-danger); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-info    { border-left: 3px solid var(--color-info); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ------------------------------------------------------------------
   10. Modal Enhancements
   ------------------------------------------------------------------ */
.modal-backdrop.show {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-heading);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ------------------------------------------------------------------
   11. Pagination
   ------------------------------------------------------------------ */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.pagination .page-link:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* ------------------------------------------------------------------
   12. Tab Navigation
   ------------------------------------------------------------------ */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-nav button,
.tab-nav a {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    text-decoration: none;
}

.tab-nav button:hover,
.tab-nav a:hover {
    color: var(--color-primary);
}

.tab-nav button.active,
.tab-nav a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* ------------------------------------------------------------------
   13. Filter Bar
   ------------------------------------------------------------------ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
    max-width: 220px;
    font-size: 0.8125rem;
}

.filter-bar .search-input {
    flex: 1;
    min-width: 200px;
}

/* ------------------------------------------------------------------
   14. Empty State
   ------------------------------------------------------------------ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--color-text-muted);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    max-width: 320px;
    margin-bottom: 1.25rem;
}

/* ==================================================================
   ADMIN BACK OFFICE
   ================================================================== */

/* ------------------------------------------------------------------
   15. Admin Layout
   ------------------------------------------------------------------ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ------------------------------------------------------------------
   16. Admin Sidebar
   ------------------------------------------------------------------ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--color-bg-sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-slow);
}

.sidebar-logo {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo img {
    height: 32px;
    width: auto;
}

.sidebar-logo span {
    font-weight: 700;
    font-size: 1rem;
    color: #f1f5f9;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-section-title {
    padding: 1rem 1.25rem 0.375rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    margin-top: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 0;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

.sidebar-nav a i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    color: #f1f5f9;
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav a.active {
    color: #ffffff;
    background-color: rgba(var(--color-primary-rgb), 0.25);
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--color-primary);
    border-radius: 0 2px 2px 0;
}

.sidebar-nav .badge {
    margin-left: auto;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background-color: rgba(var(--color-primary-rgb), 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #e8f0fe;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: #64748b;
}

/* ------------------------------------------------------------------
   17. Admin Main Content
   ------------------------------------------------------------------ */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-height);
    box-shadow: var(--shadow-sm);
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0;
}

.admin-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.admin-breadcrumbs a {
    color: var(--color-text-muted);
}

.admin-breadcrumbs a:hover {
    color: var(--color-primary);
}

.admin-breadcrumbs .separator {
    opacity: 0.5;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ------------------------------------------------------------------
   18. Stat Cards
   ------------------------------------------------------------------ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
}

.stat-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card-icon.primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}
.stat-card-icon.success {
    background-color: var(--color-success-light);
    color: var(--color-success);
}
.stat-card-icon.accent {
    background-color: var(--color-accent-light);
    color: var(--color-accent);
}
.stat-card-icon.danger {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
}
.stat-card-icon.info {
    background-color: var(--color-info-light);
    color: var(--color-info);
}

.stat-card-body {
    flex: 1;
}

.stat-card-value {
    font-family: 'Source Code Pro', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.125rem;
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.375rem;
}

.stat-card-trend.up {
    color: var(--color-success);
}

.stat-card-trend.down {
    color: var(--color-danger);
}

/* ------------------------------------------------------------------
   19. CSS Bar Chart
   ------------------------------------------------------------------ */
.chart-bar {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.chart-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-bar-label {
    width: 100px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-track {
    flex: 1;
    height: 1.5rem;
    background-color: var(--color-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: var(--radius-sm);
    transition: width 0.6s ease;
    min-width: 2px;
}

.chart-bar-fill.accent { background-color: var(--color-accent); }
.chart-bar-fill.success { background-color: var(--color-success); }
.chart-bar-fill.info { background-color: var(--color-info); }

.chart-bar-value {
    width: 60px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Source Code Pro', monospace;
    color: var(--color-heading);
    flex-shrink: 0;
}

/* ------------------------------------------------------------------
   20. Permission Matrix
   ------------------------------------------------------------------ */
.permission-matrix {
    overflow-x: auto;
}

.permission-matrix table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.permission-matrix th {
    padding: 0.625rem 0.5rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.permission-matrix th:first-child {
    text-align: left;
}

.permission-matrix td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    vertical-align: middle;
}

.permission-matrix td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--color-heading);
    white-space: nowrap;
}

.permission-matrix input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.permission-matrix tbody tr:hover {
    background-color: rgba(var(--color-primary-rgb), 0.04);
}

/* ==================================================================
   POS REGISTER
   ================================================================== */

/* ------------------------------------------------------------------
   21. POS Layout
   ------------------------------------------------------------------ */
.pos-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--color-bg);
}

.pos-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ------------------------------------------------------------------
   22. POS Header
   ------------------------------------------------------------------ */
.pos-header {
    height: var(--pos-header-height);
    background-color: var(--color-bg-sidebar);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    flex-shrink: 0;
    z-index: 100;
}

.pos-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pos-header-logo {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #fff;
    white-space: nowrap;
}

.pos-header-store {
    font-size: 0.8125rem;
    color: #94a3b8;
}

.pos-header-center {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.8125rem;
    color: #94a3b8;
}

.pos-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pos-header-clock {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.pos-header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #cbd5e1;
}

.pos-header-shift {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.625rem;
    background-color: rgba(22, 163, 74, 0.2);
    color: #4ade80;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.pos-header-shift::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #4ade80;
}

/* ------------------------------------------------------------------
   23. POS Products Panel
   ------------------------------------------------------------------ */
.pos-products-panel {
    flex: 6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--color-border);
}

.pos-search-bar {
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-card);
    flex-shrink: 0;
}

.pos-search-bar .search-input-wrapper {
    flex: 1;
    position: relative;
}

.pos-search-bar .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1rem;
}

.pos-search-bar input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 0.9375rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.pos-search-bar input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
    background-color: var(--color-bg-card);
}

.pos-search-bar input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* ------------------------------------------------------------------
   24. POS Category Bar
   ------------------------------------------------------------------ */
.pos-category-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    overflow-x: auto;
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pos-category-bar::-webkit-scrollbar {
    display: none;
}

.pos-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background-color: var(--color-bg-card);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.pos-category-btn:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.pos-category-btn.active {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ------------------------------------------------------------------
   25. POS Product Grid
   ------------------------------------------------------------------ */
.pos-product-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    align-content: start;
}

.pos-product-tile {
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    background-color: var(--color-bg-card);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    position: relative;
}

.pos-product-tile:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--color-primary-rgb), 0.3);
}

.pos-product-tile.active,
.pos-product-tile:active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

.pos-product-tile .tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
}

.pos-product-tile .tile-name {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-product-tile .tile-price {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.9;
}

.pos-product-tile .tile-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
}

.pos-product-tile .tile-badge.out {
    background: #dc2626;
}

.pos-product-tile .tile-badge.low {
    background: #eab308;
    color: #000;
}

.pos-product-tile .tile-fav {
    position: absolute; top: 6px; left: 6px; font-size: 1rem; cursor: pointer; color: #fbbf24; text-shadow: 0 1px 2px rgba(0,0,0,0.3); z-index: 2;
}

.pos-product-tile-image {
    flex: 1;
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 2rem;
    overflow: hidden;
}

.pos-product-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-product-tile-info {
    padding: 0.5rem;
    background-color: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
}

.pos-product-tile-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-heading);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-product-tile-price {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 0.125rem;
}

.pos-product-tile-stock {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.pos-product-tile-stock.low {
    background-color: var(--color-warning-light);
    color: #a16207;
}

.pos-product-tile-stock.out {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
}

/* ------------------------------------------------------------------
   26. POS Cart Panel
   ------------------------------------------------------------------ */
.pos-cart-panel {
    flex: 4;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-card);
    overflow: hidden;
}

/* ------------------------------------------------------------------
   27. POS Customer Bar
   ------------------------------------------------------------------ */
.pos-customer-bar {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color var(--transition);
    flex-shrink: 0;
}

.pos-customer-bar:hover {
    background-color: var(--color-primary-light);
}

.pos-customer-bar-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.pos-customer-bar-info {
    flex: 1;
    overflow: hidden;
}

.pos-customer-bar-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-customer-bar-detail {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.pos-customer-bar-action {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ------------------------------------------------------------------
   28. POS Cart
   ------------------------------------------------------------------ */
.pos-cart {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--color-border);
    transition: background-color var(--transition);
}

.pos-cart-item:hover {
    background-color: rgba(var(--color-primary-rgb), 0.03);
}

.pos-cart-item-info {
    flex: 1;
    overflow: hidden;
}

.pos-cart-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-cart-item-sku {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.pos-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.pos-cart-item-qty button {
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
}

.pos-cart-item-qty button:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.pos-cart-item-qty button:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pos-cart-item-qty button:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.pos-cart-item-qty span {
    min-width: 2rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    background-color: var(--color-bg-card);
}

.pos-cart-item-price {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-heading);
    text-align: right;
    min-width: 70px;
    flex-shrink: 0;
}

.pos-cart-item-remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    opacity: 0.5;
    transition: all var(--transition);
    flex-shrink: 0;
}

.pos-cart-item-remove:hover {
    opacity: 1;
    color: var(--color-danger);
}

/* ------------------------------------------------------------------
   29. POS Cart Summary
   ------------------------------------------------------------------ */
.pos-cart-summary {
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

.pos-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.pos-cart-summary-row span:last-child {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    color: var(--color-text);
}

.pos-cart-summary-row.discount {
    color: var(--color-success);
}

.pos-cart-summary-row.discount span:last-child {
    color: var(--color-success);
}

.pos-cart-summary-row.total {
    padding-top: 0.5rem;
    margin-top: 0.375rem;
    border-top: 2px solid var(--color-border);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-heading);
}

.pos-cart-summary-row.total span:last-child {
    font-size: 1.25rem;
    color: var(--color-heading);
}

/* ------------------------------------------------------------------
   30. POS Action Bar
   ------------------------------------------------------------------ */
.pos-action-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

.pos-action-bar .btn {
    flex: 1;
    font-size: 0.8125rem;
    padding: 0.5rem;
}

/* ------------------------------------------------------------------
   31. POS Pay Button
   ------------------------------------------------------------------ */
.pos-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: calc(100% - 2rem);
    margin: 0.5rem 1rem 0.75rem;
    padding: 0.875rem;
    background-color: var(--color-success);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.pos-pay-btn:hover {
    background-color: #15803d;
    box-shadow: var(--shadow-md);
}

.pos-pay-btn:active {
    transform: scale(0.98);
}

.pos-pay-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.pos-pay-btn .amount {
    font-family: 'Source Code Pro', monospace;
    font-size: 1.25rem;
}

/* ------------------------------------------------------------------
   32. POS Payment Modal
   ------------------------------------------------------------------ */
.pos-payment-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.pos-payment-modal-content {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease;
}

.pos-payment-modal-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-payment-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.pos-payment-modal-body {
    padding: 1.5rem;
}

.pos-payment-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------------
   33. POS Tender Display
   ------------------------------------------------------------------ */
.pos-tender-display {
    text-align: center;
    padding: 1rem 0 1.5rem;
}

.pos-tender-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.pos-tender-amount {
    font-family: 'Source Code Pro', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.1;
}

.pos-tender-change {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.pos-tender-change .amount {
    font-family: 'Source Code Pro', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-success);
    display: block;
    margin-top: 0.25rem;
}

/* ------------------------------------------------------------------
   34. POS Numpad
   ------------------------------------------------------------------ */
.pos-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.pos-numpad .key {
    height: 3.5rem;
    min-width: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Source Code Pro', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    background-color: var(--color-bg);
    color: var(--color-heading);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
}

.pos-numpad .key:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
}

.pos-numpad .key:active {
    transform: scale(0.95);
    background-color: var(--color-primary);
    color: #fff;
}

.pos-numpad .key.clear {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
    border-color: transparent;
}

.pos-numpad .key.clear:hover {
    background-color: var(--color-danger);
    color: #fff;
}

.pos-numpad .key.enter {
    background-color: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

.pos-numpad .key.enter:hover {
    background-color: #15803d;
}

/* ------------------------------------------------------------------
   35. POS Quick Amount Buttons
   ------------------------------------------------------------------ */
.pos-quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.pos-quick-amount {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    padding: 0.625rem 0.75rem;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
}

.pos-quick-amount:hover {
    background-color: var(--color-accent);
    color: #fff;
}

.pos-quick-amount:active {
    transform: scale(0.97);
}

/* ------------------------------------------------------------------
   36. POS PIN Pad / Login
   ------------------------------------------------------------------ */
.pos-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 1.5rem;
}

.pos-login-card {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.pos-login-logo {
    margin-bottom: 1.5rem;
}

.pos-login-logo img {
    width: 64px;
    height: 64px;
}

.pos-login-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 0.25rem;
}

.pos-login-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.pos-pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 280px;
    margin: 0 auto;
}

.pos-pin-pad .key {
    width: 100%;
    height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Source Code Pro', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    background-color: var(--color-bg);
    color: var(--color-heading);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
}

.pos-pin-pad .key:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
}

.pos-pin-pad .key:active {
    transform: scale(0.95);
    background-color: var(--color-primary);
    color: #fff;
}

.pos-pin-display {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pos-pin-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    transition: all var(--transition);
}

.pos-pin-dot.filled {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ------------------------------------------------------------------
   37. POS Store / Register Select
   ------------------------------------------------------------------ */
.pos-store-select {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 2rem;
}

.pos-store-select-inner {
    max-width: 720px;
    width: 100%;
    text-align: center;
}

.pos-store-select-title {
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pos-store-select-subtitle {
    color: #94a3b8;
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

.pos-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.pos-store-card {
    background-color: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.pos-store-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
    transform: translateY(-2px);
}

.pos-store-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 0.75rem;
}

.pos-store-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 0.25rem;
}

.pos-store-card-detail {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ------------------------------------------------------------------
   38. POS Shift Dialog
   ------------------------------------------------------------------ */
.pos-shift-dialog {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.pos-shift-dialog-content {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    animation: scaleIn 0.2s ease;
}

.pos-shift-dialog h3 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pos-shift-field {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.pos-shift-field-label {
    color: var(--color-text-muted);
}

.pos-shift-field-value {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    color: var(--color-heading);
}

/* ------------------------------------------------------------------
   39. POS Receipt Preview
   ------------------------------------------------------------------ */
.pos-receipt-preview {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem;
    background-color: #fff;
    color: #000;
    border: 1px dashed #ccc;
    border-radius: var(--radius);
}

.pos-receipt-preview .receipt-header {
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #aaa;
}

.pos-receipt-preview .receipt-header .store-name {
    font-size: 1rem;
    font-weight: 700;
}

.pos-receipt-preview .receipt-line {
    display: flex;
    justify-content: space-between;
}

.pos-receipt-preview .receipt-divider {
    border: none;
    border-top: 1px dashed #aaa;
    margin: 0.5rem 0;
}

.pos-receipt-preview .receipt-total {
    font-size: 0.9375rem;
    font-weight: 700;
}

.pos-receipt-preview .receipt-footer {
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #aaa;
    font-size: 0.6875rem;
    color: #666;
}

/* ------------------------------------------------------------------
   40. POS Held Tickets
   ------------------------------------------------------------------ */
.pos-held-tickets {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.pos-held-tickets-panel {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.2s ease;
}

.pos-held-tickets-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-held-tickets-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.pos-held-ticket {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color var(--transition);
}

.pos-held-ticket:hover {
    background-color: rgba(var(--color-primary-rgb), 0.04);
}

.pos-held-ticket-info {
    flex: 1;
}

.pos-held-ticket-ref {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-heading);
}

.pos-held-ticket-detail {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.pos-held-ticket-amount {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    color: var(--color-heading);
}

.pos-held-ticket-time {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* ==================================================================
   PRINT STYLES
   ================================================================== */

/* ------------------------------------------------------------------
   41. Print Receipt
   ------------------------------------------------------------------ */
@media print {
    body * {
        visibility: hidden !important;
    }

    .pos-receipt-preview,
    .pos-receipt-preview * {
        visibility: visible !important;
    }

    .pos-receipt-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 2mm;
    }

    @page {
        size: 80mm auto;
        margin: 0;
    }
}

/* ==================================================================
   RESPONSIVE
   ================================================================== */

/* ------------------------------------------------------------------
   42. Tablet (max-width: 1024px)
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    /* Admin sidebar collapses */
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    /* Sidebar overlay when open */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1035;
        background-color: rgba(0, 0, 0, 0.4);
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* POS layout stacks */
    .pos-body {
        flex-direction: column;
    }

    .pos-products-panel {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .pos-cart-panel {
        flex: none;
        height: 45vh;
        border-top: 1px solid var(--color-border);
    }

    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    /* Stat cards */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ------------------------------------------------------------------
   43. Mobile (max-width: 768px)
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .admin-content {
        padding: 1rem;
    }

    .admin-header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }

    .admin-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* POS full-width panels */
    .pos-products-panel {
        min-height: 50vh;
    }

    .pos-cart-panel {
        height: auto;
        min-height: 50vh;
    }

    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .pos-product-tile-info {
        padding: 0.375rem;
    }

    .pos-product-tile-name {
        font-size: 0.6875rem;
    }

    .pos-product-tile-price {
        font-size: 0.75rem;
    }

    .pos-action-bar {
        flex-wrap: wrap;
    }

    .pos-action-bar .btn {
        flex: 1 1 calc(50% - 0.25rem);
    }

    /* Stat cards single column */
    .stat-grid {
        grid-template-columns: 1fr;
    }

    /* Filter bar stacks */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control,
    .filter-bar .form-select {
        max-width: none;
    }

    .filter-bar .search-input {
        min-width: 0;
    }

    /* Tab nav scroll */
    .tab-nav {
        gap: 0;
    }

    .tab-nav button,
    .tab-nav a {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }

    /* Payment modal full screen on mobile */
    .pos-payment-modal-content {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    /* Numpad bigger touch targets */
    .pos-numpad .key {
        height: 3.75rem;
    }

    .pos-pin-pad .key {
        height: 4rem;
    }
}

/* ------------------------------------------------------------------
   44. Small Mobile (max-width: 480px)
   ------------------------------------------------------------------ */
@media (max-width: 480px) {
    .pos-header {
        padding: 0 0.75rem;
        font-size: 0.8125rem;
    }

    .pos-header-center {
        display: none;
    }

    .pos-search-bar {
        padding: 0.5rem 0.75rem;
    }

    .pos-category-bar {
        padding: 0.5rem 0.75rem;
    }

    .pos-cart-item {
        padding: 0.5rem 0.75rem;
    }

    .pos-cart-summary {
        padding: 0.5rem 0.75rem;
    }

    .pos-pay-btn {
        margin: 0.5rem 0.75rem;
        width: calc(100% - 1.5rem);
    }

    .pos-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ------------------------------------------------------------------
   45. Utility Classes
   ------------------------------------------------------------------ */
.text-primary   { color: var(--color-primary) !important; }
.text-accent    { color: var(--color-accent) !important; }
.text-success   { color: var(--color-success) !important; }
.text-danger    { color: var(--color-danger) !important; }
.text-warning   { color: var(--color-warning) !important; }
.text-info      { color: var(--color-info) !important; }
.text-muted     { color: var(--color-text-muted) !important; }

.bg-primary-light { background-color: var(--color-primary-light) !important; }
.bg-accent-light  { background-color: var(--color-accent-light) !important; }
.bg-success-light { background-color: var(--color-success-light) !important; }
.bg-danger-light  { background-color: var(--color-danger-light) !important; }
.bg-warning-light { background-color: var(--color-warning-light) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded    { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow    { box-shadow: var(--shadow) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading spinner */
.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
}

.spinner-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.25);
}

body.dark ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
}

body.dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.25);
}
