/* ============================================
   TreePOS POS - Global Styles
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #1A9EDA;
    --primary-dark: #1580B5;
    --primary-light: #E3F2FD;
    --accent: #FF6B35;
    --accent-dark: #E55A2B;
    --success: #4CAF50;
    --success-dark: #388E3C;
    --danger: #F44336;
    --danger-dark: #D32F2F;
    --warning: #FFC107;
    --warning-dark: #FFA000;
    --info: #2196F3;

    --bg: #F0F2F5;
    --bg-dark: #E1E4E8;
    --white: #FFFFFF;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --card-shadow-active: 0 1px 4px rgba(0, 0, 0, 0.1);

    --text: #212529;
    --text-secondary: #6C757D;
    --text-light: #ADB5BD;
    --text-inverse: #FFFFFF;

    --border: #DEE2E6;
    --border-light: #E9ECEF;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-btn: 8px;
    --radius-lg: 14px;
    --radius-pill: 50px;

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition: all 150ms ease;
    --transition-fast: all 100ms ease;
    --transition-slow: all 300ms ease;

    --topbar-h: 56px;
    --sidebar-w: 280px;
    --receipt-w: 350px;

    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 500;
    --z-modal: 510;
    --z-toast: 600;
    --z-tooltip: 700;
}

/* ---------- Reset / Normalize ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

small {
    font-size: 12px;
    color: var(--text-light);
}

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: 600; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 28px; }
.text-3xl { font-size: 36px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-btn);
    border: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
    min-height: 40px;
    cursor: pointer;
    text-align: center;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-inverse);
}
.btn-accent:hover:not(:disabled) {
    background: var(--accent-dark);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}
.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}

.btn-warning {
    background: var(--warning);
    color: var(--text);
}
.btn-warning:hover:not(:disabled) {
    background: var(--warning-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.btn-lg {
    min-height: 48px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
}

.btn-sm {
    min-height: 32px;
    padding: 6px 14px;
    font-size: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-btn);
}

.btn-icon.btn-lg {
    width: 48px;
    height: 48px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ---------- Card ---------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: var(--space-xl);
}

.card-footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ---------- Form Inputs ---------- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-control {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-btn);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 158, 218, 0.15);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control:disabled {
    background: var(--bg);
    cursor: not-allowed;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236C757D' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-control-lg {
    min-height: 52px;
    font-size: 16px;
    padding: 12px 16px;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: 44px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.form-row {
    display: flex;
    gap: var(--space-lg);
}
.form-row .form-group {
    flex: 1;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius-btn) 0 0 var(--radius-btn);
}

.input-group .btn {
    border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
}

/* ---------- Modal / Overlay ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: var(--transition-slow);
    z-index: var(--z-modal);
}

.modal-backdrop.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: var(--space-xl);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.modal-lg {
    max-width: 800px;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    transform: translateX(120%);
    transition: var(--transition-slow);
    border-left: 4px solid var(--primary);
}

.toast.show {
    transform: translateX(0);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--primary); }

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-radius: 50%;
    font-size: 16px;
    flex-shrink: 0;
    cursor: pointer;
}
.toast-close:hover {
    background: var(--bg);
    color: var(--text);
}

/* ---------- Tables ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    font-size: 14px;
}

.table tbody tr:hover {
    background: rgba(26, 158, 218, 0.04);
}

.table-striped tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

.table-striped tbody tr:hover {
    background: rgba(26, 158, 218, 0.04);
}

.table-compact th,
.table-compact td {
    padding: var(--space-sm) var(--space-md);
}

/* ---------- Loading Spinner ---------- */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    border-radius: inherit;
}

.loading-full {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    background: var(--bg);
    z-index: 999;
}

.loading-full .spinner {
    width: 48px;
    height: 48px;
}

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 var(--space-xl);
    gap: var(--space-lg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    z-index: var(--z-sticky);
    position: relative;
}

.topbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar-brand svg {
    width: 24px;
    height: 24px;
}

.topbar-spacer {
    flex: 1;
}

.topbar-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 14px;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-btn);
    transition: var(--transition);
    cursor: pointer;
}

.topbar-item:hover {
    background: var(--bg);
    color: var(--text);
}

.topbar-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    min-width: 75px;
    text-align: center;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

/* ---------- Sidebar Navigation ---------- */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-light);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-btn);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    min-height: 44px;
}

.sidebar-link:hover {
    background: var(--bg);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-link svg,
.sidebar-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-section {
    padding: var(--space-md) var(--space-lg) var(--space-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-light);
}

/* ---------- Badge / Tag ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    line-height: 1.6;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #E8F5E9; color: var(--success-dark); }
.badge-danger { background: #FFEBEE; color: var(--danger-dark); }
.badge-warning { background: #FFF8E1; color: var(--warning-dark); }
.badge-info { background: #E3F2FD; color: #1565C0; }
.badge-neutral { background: var(--bg); color: var(--text-secondary); }

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: var(--space-xs);
}

.badge-dot.online { background: var(--success); }
.badge-dot.offline { background: var(--danger); }

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ---------- Responsive Utilities ---------- */
.d-none { display: none; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }

.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.m-0 { margin: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fadeIn { animation: fadeIn 300ms ease; }
.animate-slideUp { animation: slideUp 300ms ease; }
.animate-slideDown { animation: slideDown 300ms ease; }
.animate-scaleIn { animation: scaleIn 200ms ease; }

/* ---------- Confirm Dialog ---------- */
.confirm-dialog {
    text-align: center;
    padding: var(--space-xl) 0;
}

.confirm-dialog .icon {
    font-size: 48px;
    margin-bottom: var(--space-lg);
}

.confirm-dialog h3 {
    margin-bottom: var(--space-sm);
}

.confirm-dialog p {
    color: var(--text-secondary);
}

/* ---------- Empty State ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    text-align: center;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* ---------- Divider ---------- */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-lg) 0;
}

/* ---------- Chip / Filter Button ---------- */
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    min-height: 36px;
    user-select: none;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

/* ---------- Search Box ---------- */
.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 16px;
    pointer-events: none;
}

.search-box .form-control {
    padding-left: 42px;
}

/* ---------- Fullscreen ---------- */
.fullscreen-app {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

/* ---------- Print ---------- */
@media print {
    .no-print { display: none !important; }
    body { background: white; overflow: visible; }
}

/* ---------- App Container ---------- */
#app {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ---------- View Container ---------- */
#view-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ---------- Real-Time Flash Animation ---------- */
@keyframes flash-new-item {
    0%   { background-color: rgba(26, 158, 218, 0.3); }
    25%  { background-color: rgba(26, 158, 218, 0.05); }
    50%  { background-color: rgba(26, 158, 218, 0.3); }
    75%  { background-color: rgba(26, 158, 218, 0.05); }
    100% { background-color: transparent; }
}
.flash-new {
    animation: flash-new-item 2s ease;
}

/* ---------- Live Indicator ---------- */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.live-indicator::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}
/* Ingredienti ordini web */
.order-items-list li { display:block; padding:6px 0; border-bottom:1px solid var(--border-light,#f0f0f0); }
.order-items-list li:last-child { border-bottom:none; }
.order-item-main { display:flex; justify-content:space-between; align-items:center; font-weight:500; }
.order-ingredienti { margin:4px 0 0 16px; }
.order-ingr-row { font-size:12px; color:var(--text-secondary,#888); line-height:1.6; }
.order-ingr-cat { font-weight:600; color:var(--text-primary,#555); text-transform:uppercase; font-size:11px; }
.order-ingr-val { font-weight:400; }
.btn-accent { background:linear-gradient(135deg,#FF6B35,#F7931A); color:#fff; border:none; font-weight:600; }
.btn-accent:hover { background:linear-gradient(135deg,#E55A2B,#E08015); }

/* Ordini Web badge blink */
@keyframes ordini-badge-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.15); }
}
@keyframes ordini-label-blink {
    0%, 100% { color: inherit; }
    50% { color: #e53935; }
}
.ordini-web-blinking { animation: ordini-label-blink 1.2s ease-in-out infinite; }
.ordini-badge-active { display: inline-block !important; animation: ordini-badge-blink 1s ease-in-out infinite; }
