/**
 * ZOET B2B Portal - Standalone Styles
 * 
 * Clean, modern B2B interface.
 * No dependencies on MyraDesk CSS.
 */

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
    /* Brand colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    
    /* Neutrals */
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-focus: #3b82f6;
    
    /* Status colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Spacing */
    --space-xs: 3px;
    --space-sm: 6px;
    --space-md: 10px;
    --space-lg: 14px;
    --space-xl: 20px;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 5px;
    --radius-lg: 8px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container--narrow {
    max-width: 600px;
}

.container--wide {
    max-width: 1400px;
}

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

.app-sidebar {
    width: 200px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.app-content {
    flex: 1;
    padding: var(--space-lg);
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar-logo {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

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

.sidebar-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text);
    font-weight: 500;
    transition: background 0.15s;
}

.nav-link:hover {
    background: var(--bg);
    text-decoration: none;
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card__header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card__title {
    font-size: 0.875rem;
    font-weight: 600;
}

.card__body {
    padding: 12px;
}

.card__footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-label--required::after {
    content: ' *';
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.875rem;
    line-height: 1.4;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-input:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled),
.form-textarea:hover:not(:focus):not(:disabled) {
    border-color: var(--text-muted);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: var(--bg);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Custom select arrow */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.form-input--sm {
    padding: 6px 10px;
    font-size: 0.8125rem;
}

.form-input--error {
    border-color: var(--danger);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
}

/* Inline form groups */
.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row > .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row > .form-group--sm {
    flex: 0 0 100px;
}

/* Stacked form layout */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-stack .form-group {
    margin-bottom: 0;
}

/* Two column form grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

.form-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-grid .form-group--full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .form-grid,
    .form-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* Variant row styling */
.variant-row {
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
}

.variant-row:last-child {
    margin-bottom: 0;
}

/* File input styling */
.form-file-input {
    position: relative;
}

.form-file-input input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.form-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: #f9fafb;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: all 0.15s;
    cursor: pointer;
}

.form-file-label:hover {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

.form-file-input.has-file .form-file-label {
    border-color: var(--success);
    background: #ecfdf5;
    color: var(--success);
}

/* Checkbox/Radio styling */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    transition: background-color 0.15s;
}

.form-check:hover {
    background: var(--bg);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Form actions (submit buttons) */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

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

.btn--secondary {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.btn--secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn--danger {
    background: var(--danger);
    color: white;
}

.btn--danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn--ghost {
    background: transparent;
    color: var(--text);
}

.btn--ghost:hover:not(:disabled) {
    background: var(--bg);
}

.btn--sm {
    padding: 3px 8px;
    font-size: 0.6875rem;
}

.btn--lg {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn--block {
    width: 100%;
}

/* =====================================================
   TABLES
   ===================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table--striped tbody tr:nth-child(even) {
    background: var(--bg);
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge--success {
    background: #d1fae5;
    color: #065f46;
}

.badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge--info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge--muted {
    background: var(--border);
    color: var(--text-muted);
}

/* =====================================================
   ALERTS / FLASH MESSAGES
   ===================================================== */
.alert {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-size: 0.75rem;
}

.alert--success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert--error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert--warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert--info {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    margin: var(--space-md);
}

.login-card .card__header {
    text-align: center;
    padding: var(--space-xl);
}

.login-card .card__title {
    font-size: 1.5rem;
}

/* =====================================================
   ORDER FORM
   ===================================================== */
.order-line {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 8px;
    position: relative;
}

.order-line__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.order-line__number {
    font-weight: 600;
    color: var(--text-muted);
}

.order-line__remove {
    color: var(--danger);
    cursor: pointer;
    padding: var(--space-xs);
}

.order-line__remove:hover {
    background: var(--border);
    border-radius: var(--radius-sm);
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.hidden { display: none; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .app-sidebar {
        display: none;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row > .form-group--sm {
        flex: 1;
    }
}
/* =====================================================
   ADMIN PANEL STYLES
   ===================================================== */

/* Catalog-style item lists (for products, stickers, cards, etc.) */
.catalog-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catalog-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.catalog-item:hover {
    border-color: #d1d5db;
}

.catalog-item--selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.catalog-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
}

.catalog-item--selected .catalog-item__header {
    background: #eff6ff;
    border-bottom-color: #bfdbfe;
}

.catalog-item__checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
}

.catalog-item__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.catalog-item__info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.catalog-item__image {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #f3f4f6;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.catalog-item__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.25rem;
}

.catalog-item__details {
    flex: 1;
    min-width: 0;
}

.catalog-item__title {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-item__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.catalog-item__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.catalog-item__body,
.catalog-item__options {
    padding: 16px;
    background: #fff;
}

.catalog-item__section {
    margin-bottom: 16px;
}

.catalog-item__section:last-child {
    margin-bottom: 0;
}

.catalog-item__section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    margin-bottom: 8px;
}

.catalog-item__row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.catalog-item__row label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.catalog-item__row input[type="number"] {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Chips (tags/options selectors) */
.catalog-item__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    transition: all 0.15s;
    position: relative;
}

.chip-label:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.chip-label:has(input[type="checkbox"]:checked) {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.chip-label input[type="checkbox"],
.chip-label input[type="radio"]:not(.default-radio) {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

.chip-label .text-muted {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Default selection radio buttons */
.default-radio {
    width: 12px !important;
    height: 12px !important;
    margin-left: 4px;
    accent-color: #059669;
    cursor: pointer;
}

.default-radio:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.chip-label:has(.default-radio:checked)::after {
    content: "★";
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
    color: #059669;
    background: #ecfdf5;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Checkbox grid (for multi-select items) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: #f9fafb;
}

.checkbox-item:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state__text {
    margin-bottom: 16px;
}

/* Small badge variant */
.badge--sm {
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* Inline form in card header */
.card__header-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card__header-form .form-input,
.card__header-form .form-select {
    padding: 6px 10px;
    font-size: 0.8125rem;
}

/* Code styling */
code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8125rem;
    color: #0f172a;
}