/* Reset / Base */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; background: #f5f5f5; color: #222; }

/* App wrapper */
.app-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.app-header {
    background: #fff;
    color: #222;
    padding: 0 24px;
    height: 52px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.header-left { display: flex; flex-direction: row; align-items: center; gap: 12px; flex-shrink: 0; }
.header-title { font-size: 18px; font-weight: 700; letter-spacing: 0.4px; color: #1c1c1c; white-space: nowrap; }
.header-subscriber { font-size: 15px; font-weight: 500; color: #555; border-left: 1px solid #ccc; padding-left: 12px; white-space: nowrap; }
.header-right { display: flex; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 4px; margin-left: auto; }

/* Main */
.app-main { flex: 1; width: 100%; margin: 24px 0; padding: 0 24px; }

/* Panel */
.panel { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 24px; margin-bottom: 24px; }
.panel h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #6F3AF2; }

/* Language dropdown */
.lang-dropdown { position: relative; margin-right: 12px; user-select: none; }
.lang-dropdown__trigger { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; background: #fff; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; font-size: 13px; color: #333; height: 30px; min-width: 130px; transition: border-color 0.15s; }
.lang-dropdown__trigger:hover, .lang-dropdown--open .lang-dropdown__trigger { border-color: #0066cc; }
.lang-dropdown__flag { width: 24px; height: 18px; border-radius: 2px; flex-shrink: 0; }
.lang-dropdown__label { flex: 1; text-align: left; }
.lang-dropdown__caret { font-size: 10px; color: #888; }
.lang-dropdown__menu { position: absolute; top: calc(100% + 4px); right: 0; background: #fff; border: 1px solid #ccc; border-radius: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 200; min-width: 140px; overflow: hidden; }
.lang-dropdown__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px; background: none; border: none; cursor: pointer; font-size: 13px; color: #333; }
.lang-dropdown__item:hover { background: #f0f4ff; }
.lang-dropdown__item--active { background: #e6eeff; font-weight: 600; }

/* Data grid — horizontal scroll only when table is wider than viewport */
.table-scroll-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; margin-top: 8px; }
.data-grid thead tr { background: #fff; color: #1c1c1c; }
.data-grid thead th { padding: 10px 8px; text-align: left; font-weight: 600; white-space: nowrap; position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 2px solid #ddd; }
.data-grid tbody tr.grid-row { cursor: pointer; border-bottom: 1px solid #eee; }
.data-grid tbody tr.grid-row:hover { background: #f0f6ff; }
.data-grid td { padding: 8px; vertical-align: middle; }
.cell-center { text-align: center; }

/* Status badges */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.status-in-stock { background: #d1e7dd; color: #0a3622; }
.status-limited-stock { background: #fff3cd; color: #856404; }
.status-out-of-stock { background: #f8d7da; color: #842029; }

/* Handbook button */
.handbook-btn { background: none; border: none; padding: 0; margin-right: 15px; cursor: pointer; color: #444; display: inline-flex; align-items: center; line-height: 1; }
.handbook-btn svg, .handbook-btn .b-icon, .handbook-btn i { width: 18px; height: 18px; font-size: 18px; }
.handbook-btn:hover { color: #000; }

/* Handbook modal */
.handbook-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.handbook-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    width: min(680px, 94vw);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.handbook-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}
.handbook-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1c1c1c;
}
.handbook-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
}
.handbook-modal-close:hover { color: #000; }
.handbook-modal-body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
}
.handbook-modal-body section { margin-bottom: 20px; }
.handbook-modal-body section:last-child { margin-bottom: 0; }
.handbook-modal-body h2 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: #6F3AF2; }

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
