/* ==========================================================================
   Spectra POS - Master Admin & Dashboard Stylesheet
   File: app/assets/css/style.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET & BASE
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary, sans-serif);
    background: var(--color-bg-app, #f8fafc);
    background-attachment: fixed;
    color: var(--color-text-primary, #0f172a);
    min-height: 100vh;
    display: flex;
    transition: background 0.25s ease, color 0.25s ease;
}

/* --------------------------------------------------------------------------
   2. MASTER ADMIN SIDEBAR
   -------------------------------------------------------------------------- */
.admin-sidebar {
    width: 270px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg, var(--color-bg-surface, #ffffff));
    backdrop-filter: var(--glass-blur, none);
    -webkit-backdrop-filter: var(--glass-blur, none);
    border-right: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}

.sidebar-brand {
    height: 65px;
    padding: 0 16px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.06));
    transition: padding 0.25s ease;
}

.brand-name {
    font-family: var(--font-secondary, sans-serif);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

/* Toggle button next to SpectraPOS brand */
.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--color-text-muted, #94a3b8);
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.05));
    color: var(--color-text-primary, #0f172a);
    border-color: var(--color-border, rgba(0, 0, 0, 0.08));
}

.sidebar-toggle-btn .material-symbols-outlined {
    font-size: 20px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
}

/* Sidebar scrollbar: see THEMED SCROLLBARS (global, follows the theme palette) */

/* Group Headings */
.nav-group {
    margin-bottom: 20px;
    transition: margin-bottom 0.2s ease;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted, #94a3b8);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}

.nav-group-title .group-icon,
.nav-group-title .material-symbols-outlined {
    font-size: 15px;
    opacity: 0.8;
}

.nav-group-divider {
    display: none;
}

/* Navigation Links */
.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    margin: 2px 0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text-secondary, #475569);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-item-link:hover {
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.04));
    color: var(--color-text-primary, #0f172a);
    transform: translateX(2px);
}

.nav-item-link.active {
    background: var(--nav-item-active-bg, var(--color-primary-light, rgba(13, 148, 136, 0.12)));
    color: var(--nav-item-active-text, var(--color-primary, #0d9488));
    font-weight: 700;
    box-shadow: var(--nav-item-active-shadow, none);
}

.nav-item-link .material-symbols-outlined {
    font-size: 20px;
    transition: transform 0.15s ease;
}

.nav-item-link:hover .material-symbols-outlined {
    transform: scale(1.1);
}

/* Sidebar Footer / User Profile */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.06));
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.02));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary-light, #e0f2fe);
    color: var(--color-primary, #0284c7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.user-info {
    font-size: 12px;
    line-height: 1.3;
}

.user-name {
    font-weight: 700;
    color: var(--color-text-primary);
}

.user-role-badge {
    color: var(--color-text-muted);
    text-transform: capitalize;
}

/* --------------------------------------------------------------------------
   3. ADMIN MAIN CANVAS & TOPBAR
   -------------------------------------------------------------------------- */
.admin-layout-wrapper {
    margin-left: 270px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-topbar {
    height: 65px;
    background: var(--topbar-bg, var(--color-bg-surface, #ffffff));
    backdrop-filter: var(--glass-blur, blur(16px));
    -webkit-backdrop-filter: var(--glass-blur, blur(16px));
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header-title {
    font-family: var(--font-secondary, sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: capitalize;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Quick Search Input */
.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    border-radius: var(--radius-pill, 9999px);
    padding: 6px 14px;
    width: 210px;
    transition: all 0.2s ease;
}

.topbar-search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light, rgba(0, 242, 254, 0.15));
    width: 250px;
}

.topbar-search .search-icon {
    font-size: 18px;
    color: var(--color-text-muted);
}

.topbar-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-primary);
    font-size: 13px;
    font-family: inherit;
    width: 100%;
}

.topbar-search-input::placeholder {
    color: var(--color-text-muted);
}

/* Icon Actions Group */
.topbar-icon-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--color-text-secondary);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.05));
    color: var(--color-text-primary);
    border-color: var(--color-border, rgba(0, 0, 0, 0.08));
}

.topbar-icon-btn .material-symbols-outlined {
    font-size: 20px;
}

/* Red alert badge dot for notifications */
.topbar-badge-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-danger, #ef4444);
    box-shadow: 0 0 0 2px var(--color-bg-surface);
}

/* Live clock: server time in the store timezone (assets/js/clock.js) */
.topbar-clock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface-elevated, #ffffff);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.topbar-clock-date {
    color: var(--color-text-muted);
}

.topbar-clock-time {
    font-family: var(--font-mono, monospace);
    font-variant-numeric: tabular-nums;   /* digits keep the same width: no jitter each second */
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
    min-width: 8ch;
}

.admin-main-canvas {
    padding: 30px;
    flex: 1;
}

/* --------------------------------------------------------------------------
   4. RTL (RIGHT-TO-LEFT) SUPPORT (Arabic & RTL Languages)
   -------------------------------------------------------------------------- */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .admin-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}

html[dir="rtl"] .admin-layout-wrapper {
    margin-left: 0;
    margin-right: 270px;
}

html[dir="rtl"] .nav-item-link:hover {
    transform: translateX(-2px);
}

/* RTL Collapsed Sidebar */
html[dir="rtl"][data-sidebar="collapsed"] .admin-layout-wrapper {
    margin-left: 0;
    margin-right: 72px;
}

/* --------------------------------------------------------------------------
   5. DASHBOARD MODULE WIDGETS & CARDS
   5. COLLAPSED SIDEBAR (Icon-Rail Mode, 72px width)
   -------------------------------------------------------------------------- */
html[data-sidebar="collapsed"] .admin-sidebar {
    width: 72px;
}

html[data-sidebar="collapsed"] .admin-layout-wrapper {
    margin-left: 72px;
}

/* Brand header when collapsed */
html[data-sidebar="collapsed"] .sidebar-brand {
    padding: 0;
    justify-content: center;
}

html[data-sidebar="collapsed"] .brand-name {
    display: none;
}

html[data-sidebar="collapsed"] .sidebar-toggle-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
}

/* Nav Groups: replace group title text & icon with a clean 1px divider */
html[data-sidebar="collapsed"] .sidebar-nav {
    padding: 16px 8px;
}

html[data-sidebar="collapsed"] .nav-group {
    margin-bottom: 12px;
}

html[data-sidebar="collapsed"] .nav-group-title {
    padding: 0;
    margin: 8px 0;
    justify-content: center;
    min-height: auto;
}

html[data-sidebar="collapsed"] .nav-group-title .group-icon,
html[data-sidebar="collapsed"] .nav-group-title .material-symbols-outlined,
html[data-sidebar="collapsed"] .nav-group-title .group-text,
html[data-sidebar="collapsed"] .nav-group-title span {
    display: none;
}

html[data-sidebar="collapsed"] .nav-group-divider {
    display: block;
    width: 32px;
    height: 1px;
    background-color: var(--color-border-subtle, rgba(0, 0, 0, 0.08));
}

/* Nav items centered icon only */
html[data-sidebar="collapsed"] .nav-item-link {
    justify-content: center;
    padding: 10px 0;
    width: 44px;
    margin: 4px auto;
    position: relative;
}

html[data-sidebar="collapsed"] .nav-item-link .nav-item-text {
    display: none;
}

html[data-sidebar="collapsed"] .nav-item-link:hover {
    transform: none;
}

/* --------------------------------------------------------------------------
   Floating Tooltips on Hover (Mounted on <body>, fixed position)
   Pops on top of everything without causing horizontal scroll
   -------------------------------------------------------------------------- */
.sidebar-floating-tooltip {
    position: fixed;
    z-index: 100000;
    background: var(--color-bg-surface-elevated, #0f172a);
    color: var(--color-text-primary, #ffffff);
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
}

.sidebar-floating-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

/* Tooltip Little Arrow Pointer */
/*.sidebar-floating-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
}*/

/* LTR Arrow (points to left sidebar) */
html:not([dir="rtl"]) .sidebar-floating-tooltip::before {
    left: -5px;
    border-right-color: var(--color-text-primary, #0f172a);
}

/* RTL Arrow (points to right sidebar) */
html[dir="rtl"] .sidebar-floating-tooltip::before {
    right: -5px;
    border-left-color: var(--color-text-primary, #0f172a);
}

/* Collapsed Sidebar Footer */
html[data-sidebar="collapsed"] .sidebar-footer {
    padding: 12px 6px;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

html[data-sidebar="collapsed"] .user-info {
    display: none;
}

/* --------------------------------------------------------------------------
   6. DASHBOARD MODULE WIDGETS & CARDS
   -------------------------------------------------------------------------- */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-hero {
    background: var(--color-bg-surface, #ffffff);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.dashboard-hero-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-primary);
    letter-spacing: 0.08em;
}

.dashboard-hero-title {
    font-family: var(--font-secondary);
    font-size: 24px;
    font-weight: 800;
    margin: 8px 0 6px;
    color: var(--color-text-primary);
}

.dashboard-hero-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    max-width: 700px;
    line-height: 1.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.stat-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   14. PLACEHOLDER & UNDER CONSTRUCTION COMPONENTS
   -------------------------------------------------------------------------- */
.placeholder-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
}

.construction-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: 520px;
    margin: 0 auto;
}

.construction-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--color-bg-subtle, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.construction-icon {
    font-size: 34px;
    color: var(--color-primary);
}

.construction-title {
    font-family: var(--font-secondary, inherit);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-danger, #ef4444);
    margin: 0;
}

.construction-desc {
    color: var(--color-text-secondary, #64748b);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.construction-btn {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--color-primary, #0ea5e9);
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.construction-btn:hover {
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   15. AUTHENTICATION & LOGIN SCREEN
   -------------------------------------------------------------------------- */
.auth-page {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-app, #f1f5f9);
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    background: var(--color-bg-surface, #ffffff);
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 12px;
    padding: 35px 30px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.auth-header-title {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--color-text-primary, #0f172a);
    font-family: var(--font-secondary, inherit);
}

.auth-alert-error {
    background: #fee2e2;
    border: 1px solid #f87171;
    color: #b91c1c;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 18px;
    text-align: center;
}

.auth-form-group {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #334155);
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid var(--color-border, #94a3b8);
    background: var(--color-bg-surface, #ffffff);
    color: var(--color-text-primary, #0f172a);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
    border-color: var(--color-primary, #0f172a);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.auth-submit-btn {
    width: 100%;
    background: var(--color-primary, #0f172a);
    color: #ffffff;
    border: none;
    padding: 11px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.auth-submit-btn:hover {
    opacity: 0.92;
}

/* Sidebar Brand, Footer & Icon Utility Classes */
.sidebar-brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.sidebar-brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-logout-btn {
    color: var(--color-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    /* Rendered as a <button> inside a POST form: strip native button chrome */
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* Inline POST forms wrapping a single action button (delete, suspend, logout) */
.inline-form {
    display: inline-flex;
    margin: 0;
}

.sidebar-logout-btn:hover {
    color: var(--color-danger, #ef4444);
}

.icon-16 {
    font-size: 16px !important;
}

.icon-18 {
    font-size: 18px !important;
}

.icon-20 {
    font-size: 20px !important;
}

/* --------------------------------------------------------------------------
   8. ADMIN CRUD, TABLES, FORMS, BADGES & MODALS
   -------------------------------------------------------------------------- */

/* Flash Alerts */
.flash-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.flash-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success, #10b981);
    border-color: rgba(16, 185, 129, 0.2);
}

.flash-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger, #ef4444);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Toolbar & Search */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

/* Table Card */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
    font-size: 14px;
}

.data-table th {
    background: var(--color-bg-app);
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    text-align: start;
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.03);
}

/* Entry tables: rows people type into (Count, Stock in, Transfer, Waste, Made today).
   The <colgroup> fixes every column except the item name, which takes the rest: typing and
   live messages never move the columns. When the table's own box is narrow (phone, tablet,
   open sidebar), each row becomes a small card and its cells show their column name
   (td[data-label]). Markup: div.table-responsive.entry-wrap > table.data-table.entry-table */
.entry-wrap {
    container-type: inline-size;
}
.entry-table {
    table-layout: fixed;
}
.data-table.entry-table th,
.data-table.entry-table td {
    padding: 12px 16px;
    white-space: normal;
    overflow-wrap: anywhere;   /* a long name wraps inside its column */
    vertical-align: top;       /* rows line up on their boxes: text uses .entry-line */
}
.data-table.entry-table th {
    vertical-align: bottom;
}
/* Text on the same line as the boxes, centred on their 40px height */
.entry-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
}
.text-right > .entry-line {
    justify-content: flex-end;
}
.entry-table .entry-action .btn-icon {
    margin-top: 4px;
}
.entry-table .col-qty      { width: 130px; }   /* a readable amount: 1234.5 kg */
.entry-table .col-box      { width: 144px; }   /* a quantity box (its readable hint goes under it) */
.entry-table .col-box-unit { width: 190px; }   /* a quantity box + its unit */
.entry-table .col-unit     { width: 180px; }
.entry-table .col-cost     { width: 160px; }
.entry-table .col-live     { width: 250px; }   /* a live message: "2 kg more than expected" */
.entry-table .col-action   { width: 64px; }
.entry-table .col-name     { width: 34%; }     /* Made today: the name, then the boxes */

@container (max-width: 700px) {
    .data-table.entry-table,
    .entry-table tbody {
        display: block;
    }
    .entry-table thead {
        display: none;
    }
    .entry-table tr {
        position: relative;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px 16px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-border-subtle);
    }
    .entry-table tr:last-child {
        border-bottom: 0;
    }
    .data-table.entry-table td {
        display: block;
        padding: 0;
        border: 0;
        white-space: normal;
        text-align: start;
    }
    .entry-table td:first-child,
    .entry-table td:only-child,
    .entry-table td.entry-wide {
        grid-column: 1 / -1;
    }
    .entry-table td:first-child .entry-line {
        min-height: 0;   /* the name is the card's title */
    }
    .entry-table .text-right > .entry-line {
        justify-content: flex-start;   /* under its label */
    }
    .entry-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: var(--color-text-secondary);
    }
    /* the row's action button sits in the card's top corner, next to the name */
    .data-table.entry-table td.entry-action {
        position: absolute;
        top: 8px;
        inset-inline-end: 8px;
    }
    .entry-table tr:has(td.entry-action) td:first-child {
        padding-inline-end: 40px;
    }
}
/* Phones: two per line; a live message (td.entry-note) gets its own line, only once there is one */
@container (max-width: 440px) {
    .entry-table tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .entry-table td.entry-note {
        grid-column: 1 / -1;
    }
    .entry-table td.entry-note::before {
        display: none;
    }
    .entry-table td.entry-note .entry-line {
        min-height: 0;
    }
    .entry-table td.entry-note:has(> :empty) {
        display: none;
    }
}

/* User Avatar & Info */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.user-username {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-success, #10b981);
}

.status-badge.active::before {
    background: var(--color-success, #10b981);
}

.status-badge.inactive {
    background: rgba(148, 163, 184, 0.15);
    color: var(--color-text-muted, #94a3b8);
}

.status-badge.inactive::before {
    background: var(--color-text-muted, #94a3b8);
}

/* Per-user permission differing from the role default (allow/deny override) */
.perm-override-badge {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 6px;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge-admin {
    background: rgba(14, 165, 233, 0.12);
    color: var(--color-primary, #0ea5e9);
}

.role-badge-manager {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.role-badge-cashier {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning, #f59e0b);
}

.role-badge-waiter {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-success, #10b981);
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--color-bg-app);
    border: 1px solid var(--color-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

/* Action Buttons */

.action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
    font-family: inherit;
    box-sizing: border-box;
}

.btn-icon:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-bg-subtle);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-action-delete,
.btn-icon-danger {
    color: var(--color-text-muted);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
}

.btn-action-delete:hover,
.btn-icon-danger:hover {
    border-color: var(--color-danger) !important;
    color: var(--color-danger) !important;
    background: var(--color-danger-bg) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

.action-buttons .inline-form {
    margin: 0;
    padding: 0;
    display: inline-flex;
}

/* Modal Dialog */

/* Forms */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 991px) {
    .form-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .form-grid-2,
.form-grid-3 {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.form-label.required::after {
    content: ' *';
    color: var(--color-danger);
}

/* A label with a small link at its end ("Why?" … "Edit reasons") */
.form-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.form-label-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}
.form-label-link:hover {
    text-decoration: underline;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

textarea.form-input {
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.form-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-check-label {
    font-size: 14px;
    color: var(--color-text-primary);
    user-select: none;
}

/* Generic Utility Classes */
.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   9. ROLES & PERMISSIONS MATRIX STYLES
   -------------------------------------------------------------------------- */

.count-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--color-bg-app);
    border: 1px solid var(--color-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.permission-card {
    background: var(--color-bg-app);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.permission-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border-subtle);
}

.permission-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.permission-card-action {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.permission-card-action:hover {
    background: rgba(14, 165, 233, 0.1);
}

.permission-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.permission-item input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.permission-label-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.permission-label-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.permission-label-desc {
    font-size: 11px;
    color: var(--color-text-muted);
}

.lang-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px dashed var(--color-border);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.lang-expand-btn:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: var(--color-primary);
}

.multi-lang-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: var(--color-bg-app);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-top: 8px;
}

/* --------------------------------------------------------------------------
   10. SETTINGS TABS & CARDS
   -------------------------------------------------------------------------- */
.form-tabs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.form-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* List filter tabs (categories by family, tags & ingredients by type): wrap instead of
   scrolling, so every tab stays visible however many there are */
.filter-tabs-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 4px;
}

.form-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.form-tab-btn:hover {
    color: var(--color-text-primary);
    background: rgba(14, 165, 233, 0.05);
}

.form-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-bg-surface);
}

.form-section-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.form-section-title {
    font-family: var(--font-secondary, sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.choice-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.choice-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-card:hover {
    border-color: var(--color-primary);
}

.choice-card input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.choice-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.choice-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.choice-card-code {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   11. CATALOG, CATEGORIES & PRODUCT BADGES
   -------------------------------------------------------------------------- */

/* Category Semantic Colors */

/* Color Swatches Preset Picker */

/* --------------------------------------------------------------------------
   12. PRODUCT CATALOG, TABBED MODALS & BADGES
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   13. MODIFIER GROUPS & OPTION EDITOR
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   14. PRODUCT BUNDLES & COMBOS
   -------------------------------------------------------------------------- */

/* ==========================================================================
   ISOE-STYLE DECOUPLED ARCHITECTURE COMPONENT STYLES
   ========================================================================== */

/* 1. Top Return & Breadcrumbs Bar */
.top-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-return {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-return:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-primary);
    transform: translateX(-2px);
    color: var(--color-primary);
}

.breadcrumbs-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.breadcrumbs-strip a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.breadcrumbs-strip a:hover {
    color: var(--color-primary);
}

.breadcrumbs-strip .crumb-separator {
    color: var(--color-text-muted);
    font-size: 12px;
}

.breadcrumbs-current {
    color: var(--color-text-primary);
    font-weight: 700;
}

/* 2. Module Header */
.module-header {
    margin-bottom: 1.5rem;
}

.module-header.module-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.module-header-text {
    flex: 1;
    min-width: 260px;
}

.module-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.module-header p {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin: 0;
}

.module-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* 3. Module Body & Unified Resource Form Layouts */
.module-body,
.module-body > form,
.resource-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* 4. Normalized Actions Card */
.actions-card-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.actions-card-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.actions-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-right: 6px;
}

.btn-action-item,
.btn-action-primary,
.btn-action-secondary,
.btn-action-success,
.btn-action-danger,
.btn-action-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.25;
}

.btn-action-primary {
    background-color: var(--color-primary);
    color: var(--color-text-inverse) !important;
    border-color: var(--color-primary);
}

.btn-action-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.btn-action-secondary {
    background-color: var(--color-bg-subtle);
    color: var(--color-text-secondary) !important;
    border-color: var(--color-border);
}

.btn-action-secondary:hover {
    background-color: var(--color-bg-surface);
    border-color: var(--color-border-strong);
    color: var(--color-text-primary) !important;
}

.btn-action-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger) !important;
    border-color: var(--color-danger-border, #fca5a5);
}

.btn-action-danger:hover {
    background-color: var(--color-danger);
    color: var(--color-text-inverse) !important;
}

/* 5. Generic Card & Table Header Actions */
.card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-subtle);
    gap: 16px;
}

.table-header-actions h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

/* 6. Role Cell Typography */
.role-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-cell-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.role-cell-slug {
    font-size: 12px;
    color: var(--color-text-muted);
}

.card-body-padding {
    padding: 20px;
}

.permissions-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.flash-alert-info {
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid var(--color-primary);
    color: var(--color-text-primary);
    padding: 14px 18px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* ==========================================================================
   UTILITY CLASSES (spacing, typography, alignment)
   Logical properties: margins & alignment follow dir="rtl" automatically.
   ========================================================================== */
.mt-1 { margin-block-start: 4px; }

.mt-3 { margin-block-start: 12px; }

.mb-3 { margin-block-end: 12px; }

.text-xs { font-size: var(--font-size-xs, 0.75rem); }
.text-sm { font-size: var(--font-size-sm, 0.875rem); }
.text-muted { color: var(--color-text-muted); }
.text-dark { color: var(--color-text-primary); }
.text-primary { color: var(--color-primary); }
.font-medium { font-weight: var(--font-weight-medium, 500); }

.text-center { text-align: center; }
.text-right { text-align: end; }   /* "right" in LTR, mirrors to left in RTL */
.justify-end { justify-content: flex-end; }

/* ==========================================================================
   SHARED COMPONENT CLASSES (previously referenced without definitions)
   ========================================================================== */

/* Actions bar groups (inside .actions-card-bar) */
.actions-card-left { justify-content: flex-start; }
.actions-card-right { justify-content: flex-end; margin-inline-start: auto; }

/* Buttons placed in a card/table header (inside .table-header-actions) */
.header-action-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Row action buttons inside a data table cell */
.table-actions-btns {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

/* Inline error box (data table load failures) */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 20px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
}

.alert-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border-color: var(--color-danger);
}

/* Empty placeholder (no rows / module not built yet) */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm, 0.875rem);
}

.empty-state .material-symbols-outlined {
    font-size: 40px;
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* Data table links */
.row-link {
    color: var(--color-text-primary);
    text-decoration: none;
}

.row-link:hover {
    color: var(--color-primary);
}

.link-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-primary);
    text-decoration: none;
}

.link-with-icon:hover {
    text-decoration: underline;
}

/* ==========================================================================
   ERROR SCREEN (core/errors.php) - reuses the auth card layout
   ========================================================================== */
.error-page-ref {
    margin-block: 14px;
    font-family: var(--font-mono, monospace);
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-muted);
    text-align: center;
}

.error-page-details {
    max-height: 260px;
    overflow: auto;
    margin-block-end: 14px;
    padding: 12px;
    border-radius: 8px;
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
}

.error-page-back {
    display: block;
    text-align: center;
    text-decoration: none;
}

/* ==========================================================================
   DASHBOARD MODULE SHORTCUTS (modules/admin/dashboard.php)
   ========================================================================== */
.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
}

.dashboard-module-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--color-text-primary);
}

.dashboard-module-card:hover {
    border-color: var(--color-primary);
}

.dashboard-module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    font-size: 24px;
}

.dashboard-module-title {
    font-size: 15px;
    font-weight: 600;
}

/* Stack of boolean checkboxes inside a form row (form_renderer.php "checkboxes" type) */
.form-check-stack {
    justify-content: center;
    gap: 10px;
}

/* ==========================================================================
   CATALOG LISTS (families, categories, tags …) - core/helpers/catalog_ui.php
   ========================================================================== */
.catalog-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.catalog-cell-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.catalog-cell-name {
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-text-primary);
}

/* Colour tile showing the item's icon; colour comes from its tone class */
.catalog-swatch {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: var(--tone, #64748b);
    color: #ffffff;
}

.catalog-swatch .material-symbols-outlined {
    font-size: 20px;
}

a.form-tab-btn {
    text-decoration: none;
}

/* Colour palette tones: assets/css/tones.css (shared with the POS layout) */

/* Product photo in catalog lists (replaces the icon swatch when the item has one) */
.catalog-thumb {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex: none;
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.04));
}

/* Amount field with its currency inside (form_renderer type "money") */
.input-affix {
    position: relative;
    display: flex;
    align-items: center;
}
.input-affix .form-input {
    padding-inline-end: 64px;
}
.input-affix-text {
    position: absolute;
    inset-inline-end: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    pointer-events: none;
}

/* Grouped tick chips (form_renderer type "link_picker": tags, removable ingredients) */
.link-group {
    margin-top: 12px;
}
.link-group-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}
.link-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* Anchors the hidden checkbox inside the chip: without it, focusing the box scrolls the
   whole app shell (html/body are overflow:hidden) and the page shows blank */
.link-chip {
    position: relative;
}
.link-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.link-chip-body {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-surface);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.link-chip-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tone, #64748b);
    color: #ffffff;
}
.link-chip-icon .material-symbols-outlined {
    font-size: 15px;
}
.link-chip input:checked + .link-chip-body {
    border-color: var(--color-primary);
    background: var(--color-primary-light, rgba(13, 148, 136, 0.12));
    color: var(--color-primary);
    font-weight: 600;
}
.link-chip-note {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
}
.link-chip input:focus-visible + .link-chip-body {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Repeater (form_renderer type "repeater", assets/js/repeater.js): cards of fields, each
   card may hold a "line" repeater (one row of small fields per item) */
.repeater-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.repeater-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.repeater-row-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.repeater-card {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.02));
}
.repeater-line {
    align-items: flex-end;
}
.repeater-line > .repeater-row-fields {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 110px;
    align-items: end;
}
.repeater-line .form-check {
    min-height: 38px;
    align-items: center;
}
/* Column titles (Product, Extra charge) only above the first line, like a table header */
.repeater-items > .repeater-line ~ .repeater-line .form-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
/* A card's top line: its name + "main item" side by side */
.repeater-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
}
.repeater-add {
    align-self: flex-start;
}
@media (max-width: 640px) {
    .repeater-line > .repeater-row-fields,
    .repeater-head {
        grid-template-columns: 1fr;
    }
}

/* "+ Translations" (translatable fields) and "More options" (form_renderer type "details") */
.translatable-more,
.form-details {
    margin-top: 6px;
}
.translatable-more > summary,
.form-details > summary {
    cursor: pointer;
    width: fit-content;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    list-style: none;
}
.translatable-more > summary::-webkit-details-marker,
.form-details > summary::-webkit-details-marker {
    display: none;
}
.translatable-more[open] > .translatable-group,
.form-details-body {
    margin-top: 8px;
}

/* ==========================================================================
   STOCK (Inventory module: modules/inventory/*, assets/js/stock-lines.js, made-today.js)
   ========================================================================== */
.stock-kind {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
}
.stock-kind-product {
    background: var(--color-info-bg);
    color: var(--color-info);
}
.stock-kind-prepared {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}
/* How a product uses stock (Products list column) */
.stock-mode {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
}
.stock-mode-order   { background: var(--color-primary-light, rgba(13, 148, 136, 0.12)); color: var(--color-primary); }
.stock-mode-advance { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.stock-mode-ready   { background: var(--color-info-bg); color: var(--color-info); }
.stock-qty {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.stock-qty-negative {
    color: var(--color-danger);
}
.stock-status {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.stock-status-ok    { background: var(--color-success-bg); color: var(--color-success); }
.stock-status-low,
.stock-status-bring { background: var(--color-warning-bg); color: var(--color-warning); }
.stock-status-prep  { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.stock-status-order,
.stock-status-empty,
.stock-status-below { background: var(--color-danger-bg); color: var(--color-danger); }
.stock-search .form-input {
    width: min(260px, 100%);
}
.stock-summary {
    padding: 14px 18px;
    border-left: 3px solid var(--color-success);
}
.stock-summary ul {
    margin: 6px 0 0;
    padding-inline-start: 18px;
}
.stock-lines-top,
.stock-lines-bottom {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.module-body > form.stock-lines-top {
    flex-direction: row;   /* Count's place picker is a form of its own: keep it at the start */
}
.stock-lines-bottom {
    border-top: 1px solid var(--color-border);
}
.stock-lines-arrow {
    padding-bottom: 10px;
    color: var(--color-text-muted);
}
.stock-pick {
    position: relative;
    flex: 1;
    min-width: 240px;
}
.stock-pick > .material-symbols-outlined {
    position: absolute;
    inset-inline-start: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}
.stock-pick > .form-input {
    padding-inline-start: 38px;
}
.stock-pick-list {
    position: absolute;
    z-index: 20;
    inset-inline: 0;
    top: calc(100% + 4px);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}
.stock-pick-option {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 0;
    background: none;
    color: var(--color-text-primary);
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.stock-pick-option:hover,
.stock-pick-option.active {
    background: var(--color-primary-light, rgba(13, 148, 136, 0.12));
}
.stock-pick-create {
    color: var(--color-primary);
    font-weight: 600;
    border-top: 1px solid var(--color-border);
}
.stock-lines-place {
    width: 200px;
}
.stock-lines-note {
    flex: 1;
    min-width: 220px;
}
.stock-lines-table td {
    vertical-align: middle;
}
.stock-lines-sub,
.stock-block {
    display: block;
}
.stock-lines-qty {
    width: 110px;
    text-align: end;
    font-variant-numeric: tabular-nums;
}
.stock-lines-cost {
    width: 100%;
    text-align: end;
    font-variant-numeric: tabular-nums;
}

/* Stock page: "needs attention" cards (who has to act), then the list */
.stock-attention {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.stock-att {
    display: flex;
    flex-direction: column;
}
.stock-att-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}
.stock-att-head h3 {
    margin: 0;
    font-size: 15px;
}
.stock-att-icon {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    display: grid;
    place-items: center;
}
.stock-att-order .stock-att-icon { background: var(--color-danger-bg); color: var(--color-danger); }
.stock-att-bring .stock-att-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.stock-att-prep .stock-att-icon  { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.stock-att-count {
    margin-inline-start: auto;
    font-family: var(--font-secondary, sans-serif);
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.stock-att ul {
    list-style: none;
    margin: 0;
    padding: 6px 16px;
    flex: 1;
}
.stock-att li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--color-border);
    font-size: 13px;
}
.stock-att li:last-child {
    border-bottom: 0;
}
.stock-att li span:last-child {
    text-align: end;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}
.stock-att .stock-att-ok {
    justify-content: flex-start;
    gap: 6px;
    color: var(--color-success);
}
.stock-att .stock-att-more span:last-child,
.stock-att-more {
    color: var(--color-text-muted);
}
.stock-att-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--color-border);
}
.stock-row-child td {
    background: rgba(124, 58, 237, 0.04);
}
.stock-row-child td:first-child {
    padding-inline-start: 28px;
}
@container (max-width: 700px) {   /* entry table rows as cards: the whole card is tinted and indented */
    .entry-table tr.stock-row-child {
        background: rgba(124, 58, 237, 0.04);
        padding-inline-start: 28px;
    }
    .entry-table tr.stock-row-child td {
        background: none;
    }
    .entry-table tr.stock-row-child td:first-child {
        padding-inline-start: 0;
    }
}
.stock-child-mark {
    color: #7c3aed;
    font-size: 18px;
}
.stock-role {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
}
.stock-role-kitchen {
    background: var(--color-primary-light, rgba(13, 148, 136, 0.12));
    color: var(--color-primary);
}
.stock-warn {
    color: var(--color-warning);
    font-weight: 600;
}
.stock-doc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.stock-pager {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Quantity boxes: typed in the typing unit (Stock › Settings), readable hint below (quantity-hint.js) */
.qty-hint {
    display: block;
    min-height: 16px;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}
.qty-unit,
.stock-lines-unit {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.qty-unit {
    margin-inline-start: 6px;
}

/* Count, waste, cancel (inventory:005) */
.stock-row-cancelled td {
    opacity: 0.55;
}
.stock-row-cancelled td:last-child {
    opacity: 1;
}
.stock-cancel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.stock-cancel h3 {
    margin: 0;
}
.count-qty {
    width: 110px;
    text-align: end;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.count-diff {
    font-variant-numeric: tabular-nums;
}
.stock-ok {
    color: var(--color-success);
    font-weight: 600;
}

/* Waste reasons (inventory:006): the reason's colour and icon (History, Stock › Settings) */
.reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.reason-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px 2px 6px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tone);
    background: color-mix(in srgb, var(--tone) 12%, transparent);
}
.reason-chip .material-symbols-outlined {
    font-size: 16px;
}
.settings-reasons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Made today */
.made-inputs {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.made-qty {
    width: 110px;
    text-align: end;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.made-arrow {
    padding-bottom: 32px;   /* level with the boxes, above their readable hint */
    color: var(--color-text-muted);
}
.made-note {
    flex-basis: 100%;   /* its own line under the boxes: a longer note never moves them */
    color: var(--color-text-secondary);
}
.made-sub {
    display: block;
}

/* Photo field (form_renderer type "image") */
.image-field {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.image-field-preview {
    width: 160px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    flex: none;
    border: 1px solid var(--color-border);
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.04));
}
.image-field-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}
.image-field-empty .material-symbols-outlined {
    font-size: 36px;
}
.image-field-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 220px;
}

/* Empty slot the size of a .btn-icon, so row actions stay aligned when one is absent */
.btn-icon-placeholder {
    display: inline-block;
    width: 32px;
    height: 32px;
    flex: none;
}

/* ==========================================================================
   FORM FIELD TYPES: translatable · color_palette · icon_picker (form_renderer.php)
   ========================================================================== */
.translatable-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.translatable-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.translatable-row .form-input {
    flex: 1;
    min-width: 0;
}

.translatable-lang {
    flex: none;
    width: 38px;
    padding: 6px 0;
    border-radius: 6px;
    background: var(--color-bg-app);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.palette-grid,
.icon-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.palette-swatch {
    position: relative;
    cursor: pointer;
}

.palette-swatch input,
.icon-choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.palette-dot {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tone, #64748b);
    border: 3px solid var(--color-bg-surface);
    box-shadow: 0 0 0 1px var(--color-border);
    transition: box-shadow 0.15s ease;
}

.palette-swatch input:checked + .palette-dot {
    box-shadow: 0 0 0 2px var(--tone, #64748b);
}

.palette-swatch input:focus-visible + .palette-dot,
.icon-choice input:focus-visible + .material-symbols-outlined {
    outline: 2px solid var(--color-border-focus, var(--color-primary));
    outline-offset: 2px;
}

.icon-choice {
    position: relative;
    cursor: pointer;
}

.icon-choice .material-symbols-outlined {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface);
    color: var(--color-text-secondary);
    font-size: 22px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-choice:hover .material-symbols-outlined {
    border-color: var(--color-primary);
}

.icon-choice input:checked + .material-symbols-outlined {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-inverse, #ffffff);
}

/* ==========================================================================
   APP SHELL SCROLLING
   The window never scrolls: the top bar and sidebar stay fixed in size. Only the
   content area under the top bar scrolls, and it always reserves room for its
   scrollbar, so moving from a short page to a long one never shifts the layout.
   ========================================================================== */
html:has(body.app-shell),
body.app-shell {
    height: 100%;
    overflow: hidden;
}

body.app-shell .admin-layout-wrapper {
    height: 100vh;
    height: 100dvh;            /* mobile browsers: excludes the address bar */
    min-height: 0;
    overflow: hidden;
}

body.app-shell .admin-topbar {
    flex: none;               /* fixed height, never squeezed */
}

body.app-shell .admin-main-canvas {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;  /* room for the scrollbar is always kept: no shift */
    overscroll-behavior: contain;
}

/* ==========================================================================
   THEMED SCROLLBARS (every scrollable area: content, sidebar, tables, textareas)
   Colours come from the active theme, so they follow Ruby, Emerald, Navy … and dark mode.
   ========================================================================== */
:root {
    --scrollbar-size: 10px;
    --scrollbar-thumb: color-mix(in srgb, var(--color-primary, #64748b) 32%, transparent);
    --scrollbar-thumb-hover: color-mix(in srgb, var(--color-primary, #64748b) 60%, transparent);
    --scrollbar-track: transparent;
    /* Firefox & standard browsers (inherited by every scrollable element) */
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Chrome / Edge / Safari: richer styling via ::-webkit-scrollbar (rounded, slim, hover state).
   Recent Chromium ignores these when scrollbar-color is set, so reset it there. */
@supports selector(::-webkit-scrollbar) {
    :root {
        scrollbar-width: auto;
        scrollbar-color: auto;
    }

    ::-webkit-scrollbar {
        width: var(--scrollbar-size);
        height: var(--scrollbar-size);
    }

    ::-webkit-scrollbar-track {
        background: var(--scrollbar-track);
    }

    ::-webkit-scrollbar-thumb {
        background-color: var(--scrollbar-thumb);
        border-radius: 999px;
        border: 2px solid transparent;      /* slim thumb that floats inside the track */
        background-clip: padding-box;
    }

    ::-webkit-scrollbar-thumb:hover {
        background-color: var(--scrollbar-thumb-hover);
    }

    ::-webkit-scrollbar-corner {
        background: transparent;
    }

    .sidebar-nav::-webkit-scrollbar {
        width: 6px;                          /* the sidebar keeps a thinner bar */
    }
}

/* Devices (modules/admin/devices.php): registers paired with a code (rules/11 §8) */
.device-code-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; margin-bottom: 16px; border: 2px solid var(--color-primary); }
.device-code-card > .material-symbols-outlined { color: var(--color-primary); font-size: 32px; }
.device-code { font-family: var(--font-mono); font-size: 40px; font-weight: 700; letter-spacing: .12em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.module-body > form.device-add { display: flex; flex-direction: row; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px; }
.device-add .form-group { flex: 1 1 260px; margin: 0; }
.device-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.device-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.device-card-head { display: flex; gap: 12px; align-items: flex-start; }
.device-card-head > .material-symbols-outlined { font-size: 30px; color: var(--color-primary); }
.device-card-head p { margin: 2px 0 0; font-size: 13px; }
.device-badge { display: inline-block; margin-inline-start: 6px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--color-primary-light); color: var(--color-primary-active); }
.device-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: end; }
.device-settings .form-group { margin: 0; }
.device-check, .device-wide { grid-column: 1 / -1; }
.device-check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.device-check input { width: 18px; height: 18px; }
.device-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.device-settings .device-actions { grid-column: 1 / -1; }
.device-qr { width: 190px; height: 190px; flex: none; background: #ffffff; border-radius: 8px; padding: 6px; }   /* a QR code is black on white in every theme */
.device-qr svg { width: 100%; height: 100%; display: block; }
.auth-alt-link { display: block; text-align: center; margin-top: 18px; font-size: 14px; color: var(--color-primary); font-weight: 600; text-decoration: none; }
.auth-alt-link:hover { text-decoration: underline; }
/* Sales › Devices: trust the box (HTTPS, installable app; rules/11 §9) */
.device-trust { padding: 14px 18px; margin-bottom: 16px; }
.device-trust > summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.device-trust > summary::-webkit-details-marker { display: none; }
.device-trust > summary > .material-symbols-outlined { color: var(--color-primary); font-size: 28px; }
.device-trust > summary small { display: block; }
.device-trust-body { display: flex; gap: 16px; align-items: flex-start; margin: 14px 0 8px; }
.device-trust .device-qr { width: 150px; height: 150px; }
.device-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .device-code-card, .device-trust-body { flex-direction: column; } }

/* Sales › Printers (rules/11 §10): same cards as Devices */
.module-body > form.printer-form { padding: 16px 20px; margin-bottom: 16px; gap: 12px; }
.printer-form-title { font-size: 15px; }
.printer-fields { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr; gap: 10px 12px; align-items: end; }
.printer-fields .form-group { margin: 0; }
.device-card.is-off { opacity: .65; }
.printer-failed { color: var(--color-danger); }
.printer-virtual { margin-top: 12px; }
.printer-virtual code { font-family: var(--font-mono); font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--color-bg-subtle); overflow-wrap: anywhere; }
@media (max-width: 900px) { .printer-fields { grid-template-columns: 1fr 1fr; } }
