/* ============================================
   SHARPTRACK DESIGN SYSTEM
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── THEME VARIABLES ── */
:root {
    --primary: #0a4d33;
    --primary-dark: #083b27;
    --primary-light: #edf5ef;
    --primary-ghost: rgba(10, 77, 51, 0.08);

    --bg: #f0ebe0;
    --bg-secondary: #e8e3d8;
    --card-bg: #ffffff;
    --border: #e8e3d8;
    --border-light: #f0ebe0;

    --text: #1a2e26;
    --text-secondary: #3d5a4e;
    --muted: #7a8880;

    --orange: #e07b2a;
    --orange-bg: #fdf3ea;
    --red: #e53935;
    --red-bg: #fdecea;
    --green: #2e9e5b;
    --green-bg: #e8f5e9;
    --blue: #1976d2;
    --blue-bg: #e3f2fd;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-primary: 0 4px 16px rgba(10, 77, 51, 0.2);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    --font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
    --primary: #25a060;
    --primary-dark: #1d8a50;
    --primary-light: #1a3328;
    --primary-ghost: rgba(37, 160, 96, 0.1);

    --bg: #0f1410;
    --bg-secondary: #1a201c;
    --card-bg: #1e2a24;
    --border: #2d3a34;
    --border-light: #253028;

    --text: #e8efe9;
    --text-secondary: #b0c4b8;
    --muted: #7a9486;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-primary: 0 4px 16px rgba(37, 160, 96, 0.15);
}

/* ── RESET & BASE ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ── TYPOGRAPHY ── */
h1 { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.2; }
h2 { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.3; }
h3 { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.4; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-primary { color: var(--primary); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; letter-spacing: 0.5px; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

.animate-fadeUp { animation: fadeUp 0.4s ease both; }
.animate-fadeIn { animation: fadeIn 0.3s ease both; }
.animate-slideDown { animation: slideDown 0.3s ease both; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }

.btn-ghost {
    background: transparent;
    color: var(--primary);
}
.btn-ghost:hover:not(:disabled) { background: var(--primary-ghost); }

.btn-danger {
    background: var(--red);
    color: white;
}
.btn-danger:hover:not(:disabled) { background: #c62828; }

.btn-block { width: 100%; }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-md); }
.btn-lg { padding: 16px 28px; font-size: 16px; }

/* Button loading spinner */
.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-outline .spinner {
    border-color: rgba(10, 77, 51, 0.2);
    border-top-color: var(--primary);
}

/* ── INPUTS ── */
.input-group { margin-bottom: 16px; }

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 13px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: var(--card-bg);
}

.input-wrapper input::placeholder { color: var(--muted); opacity: 0.7; }

.input-wrapper .icon-left {
    position: absolute;
    left: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.input-wrapper .icon-right {
    position: absolute;
    right: 14px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    transition: opacity var(--transition-fast);
}
.input-wrapper .icon-right:hover { opacity: 0.7; }

.input-error { border-color: var(--red) !important; }
.input-error-msg { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.input-error-msg.visible { display: block; }

input[inputmode="numeric"] { letter-spacing: 4px; font-weight: 600; }
input[inputmode="numeric"]::placeholder { letter-spacing: normal; font-weight: 400; }

/* ── CARDS ── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border);
}

.card-flat {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
}

/* ── STAT CARDS ── */
.stat-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.stat-icon.green { background: var(--primary-light); color: var(--primary); }
.stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }

.stat-card .label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.stat-card .value { font-size: 20px; font-weight: 800; color: var(--primary); }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.stat-card .sub.up { color: var(--green); }
.stat-card .sub.down { color: var(--red); }
.stat-card.alert .value { color: var(--orange); }
.stat-card.alert .sub { color: var(--orange); font-weight: 600; }

/* ── NAVBAR ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo { display: flex; align-items: center; gap: 8px; }
.nav-logo img { height: 48px; width: auto; object-fit: contain; mix-blend-mode: multiply; }

[data-theme="dark"] .nav-logo img { filter: brightness(1.5); mix-blend-mode: normal; }

.hamburger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border-radius: 6px;
    transition: transform var(--transition-fast);
    background: none;
    border: none;
}
.hamburger:active { transform: scale(0.95); }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; display: block; }

.bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), color var(--transition-fast);
}
.bell-btn:active { transform: scale(0.95); }

.bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--red);
    color: white;
    font-size: 9px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}
.bell-badge.hidden { display: none; }

/* ── BOTTOM NAV ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    border: none;
    background: none;
    padding: 4px 0;
    transition: transform var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
    min-width: 0;
    text-align: center;
}
.nav-item.active { color: var(--primary); }
.nav-item:active { transform: scale(0.95); }
.nav-item svg { width: 22px; height: 22px; }

.nav-item-fab-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fab {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    position: relative;
    bottom: 14px;
    box-shadow: var(--shadow-primary);
    color: white;
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}
.fab:active { transform: scale(0.95); }
.fab svg { width: 24px; height: 24px; stroke: white; }

/* ── SECTION ── */
.section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.view-all {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: color var(--transition-fast);
}
.view-all:hover { color: var(--primary-dark); }

/* ── CONTENT AREA ── */
.content { padding: 4px 20px 0; }
.page-body { padding-bottom: 90px; }

/* ── SVG ICONS ── */
svg.icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

svg.icon-sm { width: 18px; height: 18px; }
svg.icon-lg { width: 28px; height: 28px; }

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 100%;
    max-width: 440px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease both;
    pointer-events: auto;
    position: relative;
}

.toast.removing { animation: toastOut 0.25s ease both; }

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.toast-success .toast-icon { background: var(--green-bg); color: var(--green); }
.toast.toast-error .toast-icon { background: var(--red-bg); color: var(--red); }
.toast.toast-warning .toast-icon { background: var(--orange-bg); color: var(--orange); }
.toast.toast-info .toast-icon { background: var(--blue-bg); color: var(--blue); }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 14px; font-weight: 700; color: var(--text); }
.toast-message { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }

/* ── NOTIFICATION PANEL ── */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 500;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}
.notif-overlay.open { opacity: 1; pointer-events: auto; }

.notif-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg);
    z-index: 501;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notif-panel.open { right: 0; }

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

.notif-panel-header h2 { font-size: 18px; font-weight: 800; }

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.notif-item:hover { background: var(--primary-ghost); }
.notif-item.unread { border-left: 3px solid var(--primary); }

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-item.success .notif-item-icon { background: var(--green-bg); color: var(--green); }
.notif-item.error .notif-item-icon { background: var(--red-bg); color: var(--red); }
.notif-item.warning .notif-item-icon { background: var(--orange-bg); color: var(--orange); }
.notif-item.info .notif-item-icon { background: var(--blue-bg); color: var(--blue); }

.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-item-msg { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ── SKELETON LOADERS ── */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-heading { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 80px; border-radius: var(--radius-lg); margin-bottom: 12px; }
.skeleton-circle { border-radius: var(--radius-full); }
.skeleton-stat { height: 90px; border-radius: var(--radius-lg); }

/* ── EMPTY STATES ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 16px;
}

.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 260px; }
.empty-state .btn { margin-top: 16px; }

/* ── LIST ITEMS ── */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

.list-item-img {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.list-item-info { flex: 1; min-width: 0; }
.list-item-info .name { font-size: 14px; font-weight: 600; color: var(--text); }
.list-item-info .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.list-item-meta { text-align: right; flex-shrink: 0; }
.list-item-meta .amount { font-size: 14px; font-weight: 700; color: var(--text); }
.list-item-meta .time { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── MODAL/OVERLAY ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 900;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px 32px;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* ── SEARCH BAR ── */
.search-row { display: flex; gap: 8px; margin-bottom: 16px; }

.search-wrap {
    flex: 1;
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    width: 18px;
    height: 18px;
}

.search-wrap input {
    width: 100%;
    padding: 10px 10px 10px 34px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition-fast);
}
.search-wrap input:focus { border-color: var(--primary); }

.category-select {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-family);
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    cursor: pointer;
}
.category-select:focus { border-color: var(--primary); }

/* ── PAGE LOADING ── */
.page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.page-loader .spinner-lg {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── UTILITY ── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ── COMMAND PALETTE & GLOBAL SEARCH MODAL ── */
.cmd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    animation: fadeIn 0.2s ease both;
}

.cmd-overlay.hidden {
    display: none !important;
}

.cmd-modal {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.cmd-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.cmd-search-icon {
    color: var(--muted);
    flex-shrink: 0;
}

#cmd-search-input,
#global-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 15px;
    font-family: var(--font-family);
    color: var(--text);
    outline: none;
}

.cmd-close-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
}
.cmd-close-btn:hover {
    color: var(--text);
    background: var(--primary-ghost);
}

.cmd-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.cmd-category-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px 6px;
}

.cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.cmd-item:hover,
.cmd-item.selected {
    background: var(--primary-ghost);
}

.cmd-item-info {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.cmd-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.cmd-item-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-item-shortcut {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.cmd-item-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.cmd-item-badge.success { background: var(--green-bg); color: var(--green); }
.cmd-item-badge.danger { background: var(--red-bg); color: var(--red); }
.cmd-item-badge.info { background: var(--blue-bg); color: var(--blue); }

.cmd-no-results,
.search-intro {
    padding: 32px 16px;
    text-align: center;
}

.cmd-no-results h3,
.search-intro h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.cmd-no-results p,
.search-intro p {
    font-size: 13px;
    color: var(--muted);
    max-width: 280px;
    margin: 0 auto;
}

.search-intro-icon {
    width: 54px;
    height: 54px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.cmd-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
    background: var(--bg-secondary);
}

.cmd-footer kbd {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: inherit;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* ── SEARCH HISTORY ── */
.search-history-container {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--primary-light);
}

.search-history-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.search-history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-history-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 4px 8px 4px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-history-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.search-history-tag-del {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
}
.search-history-tag-del:hover {
    color: var(--red);
    background: var(--red-bg);
}

/* ── AVATAR MENU DROPDOWN ── */
.avatar-menu-container {
    position: relative;
}

.avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    border: 2px solid var(--border);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.avatar-btn:active {
    transform: scale(0.95);
}

.avatar-initials {
    line-height: 1;
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    animation: slideDown 0.2s ease both;
}

.avatar-dropdown.hidden {
    display: none !important;
}

.avatar-dropdown-user {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--primary-light);
}

.avatar-large {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-user-info {
    min-width: 0;
}

.avatar-user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-user-store {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.avatar-dropdown-divider {
    height: 1px;
    background: var(--border);
}

.avatar-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: none;
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.avatar-dropdown-item:hover {
    background: var(--primary-ghost);
    color: var(--primary);
}

.avatar-dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: color var(--transition-fast);
}

.avatar-dropdown-item:hover svg {
    color: var(--primary);
}

.avatar-dropdown-item.text-red:hover {
    background: var(--red-bg);
    color: var(--red);
}
.avatar-dropdown-item.text-red:hover svg {
    color: var(--red);
}

/* ── KEYBOARD SHORTCUTS GUIDE MODAL ── */
.shortcut-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease both;
}

.shortcut-modal-overlay.hidden {
    display: none !important;
}

.shortcut-modal {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.shortcut-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.shortcut-modal-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.shortcut-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}
.shortcut-close:hover {
    color: var(--text);
}

.shortcut-modal-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-divider {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    margin-bottom: 2px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
}

.shortcut-desc {
    color: var(--text-secondary);
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shortcut-keys kbd {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* ── ANALYTICS CHART ── */
.chart-container {
    padding: 16px 8px 8px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    padding-top: 20px;
    position: relative;
    border-bottom: 1.5px solid var(--border);
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
}

.chart-bar-tooltip {
    position: absolute;
    bottom: calc(100% + 4px);
    background: var(--text);
    color: var(--card-bg);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.chart-bar-wrapper:hover .chart-bar-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.chart-bar {
    width: 60%;
    max-width: 24px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-bar-wrapper:hover .chart-bar {
    opacity: 0.85;
}

.chart-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
}

/* ── ACHIEVEMENTS GRID ── */
.achievements-section {
    margin-bottom: 24px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 4px 0;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.achievement-badge-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all var(--transition-normal);
    filter: grayscale(100%);
    opacity: 0.4;
}

.achievement-badge.unlocked .achievement-badge-icon {
    background: var(--primary-light);
    border-color: var(--primary);
    filter: grayscale(0%);
    opacity: 1;
    box-shadow: var(--shadow-sm);
    transform: scale(1.05);
}

.achievement-badge-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.achievement-badge.unlocked .achievement-badge-title {
    color: var(--text);
}

/* Achievement tooltip */
.achievement-badge .tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    background: var(--text);
    color: var(--card-bg);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: 50;
    width: 160px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.achievement-badge:hover .tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* ── WHAT'S NEW CHANGELOG ── */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
}

.changelog-item {
    border-left: 2px solid var(--primary);
    padding-left: 12px;
}

.changelog-item h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.changelog-item p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.changelog-date {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── FEEDBACK FORM ── */
.feedback-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
}

.feedback-textarea:focus {
    border-color: var(--primary);
}

.feedback-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.feedback-option {
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.feedback-option.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ── MULTI-STEP CREATION WIZARD ── */
.active-step {
    display: block !important;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.25s ease both;
}

.step-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
}

.step-progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border-light);
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--border);
    transition: all var(--transition-fast);
}

.step-progress-item.active .step-num {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.step-progress-item.completed .step-num {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-progress-item.active .step-label {
    color: var(--primary);
}

.step-progress-item.completed .step-label {
    color: var(--green);
}

/* ── UPLOAD ZONE ── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-ghost);
}

.upload-zone-content h3 {
    font-size: 15px;
    font-weight: 700;
    margin-top: 8px;
}

/* ── CROP WORKAREA ── */
.crop-container {
    max-height: 240px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-container img {
    max-width: 100%;
    max-height: 240px;
    display: block;
}

.crop-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-md);
}

.crop-preview-area {
    text-align: center;
}

.cropped-image-preview-container {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    margin: 0 auto;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cropped-image-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

/* ── CAMERA OVERLAY ── */
.camera-capture-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.camera-capture-modal {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.camera-capture-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.camera-viewport-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-guide-ring {
    position: absolute;
    width: 75%;
    height: 75%;
    border: 2.5px dashed white;
    border-radius: var(--radius-md);
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}

.camera-actions {
    display: flex;
    padding: 16px;
    gap: 12px;
    background: var(--bg-secondary);
}

.camera-actions button {
    flex: 1;
}

/* ── BARCODE SCANNER ── */
#barcode-scanner-viewport {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0 auto 12px;
    background: #000;
    border: 2px solid var(--border);
}

.lookup-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    animation: fadeIn 0.2s ease both;
}

.lookup-status-card.error {
    background: var(--red-bg);
    border-color: var(--red);
}

.lookup-status-card.success {
    background: var(--green-bg);
    border-color: var(--green);
}

.lookup-status-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.lookup-status-details {
    flex: 1;
    min-width: 0;
}

.lookup-status-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}

.lookup-status-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── REVIEW & SAVE ── */
.review-img-thumb {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    object-fit: cover;
    background: var(--bg-secondary);
    display: block;
}




