/* ═══════════════════════════════════════════════════════════
   AZ Kitchen Solutions — Design System
   Shared tokens + component styles across all templates
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
    /* Primary */
    --primary: #4F6BF0;
    --primary-hover: #3B54D4;
    --primary-light: #EEF1FE;
    --primary-border: #B8C4F8;
    --primary-dark: #1E293B;

    /* Neutral */
    --bg: #F8F9FC;
    --card-bg: #FFFFFF;
    --sidebar-bg: #F1F3F9;
    --text: #334155;
    --text-muted: #94A3B8;
    --text-heading: #0F172A;
    --border: #E2E8F0;
    --border-light: #F1F5F9;

    /* Semantic */
    --success: #10B981;
    --success-light: #ECFDF5;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --danger: #EF4444;
    --danger-light: #FEF2F2;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.app-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-lg);
    height: 56px;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.app-logo:hover { text-decoration: none; }
.app-logo svg { width: 28px; height: 28px; }
.app-nav {
    display: flex;
    gap: var(--space-xs);
    margin-left: auto;
}
.app-nav a {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
}
.app-nav a:hover {
    color: var(--text);
    background: var(--sidebar-bg);
    text-decoration: none;
}
.app-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}
.app-user {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}
.card + .card { margin-top: var(--space-md); }
.card h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: var(--space-md);
}
.card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: var(--space-md);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn-secondary { background: white; color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: #CBD5E1; background: var(--sidebar-bg); }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 10px 16px; }
.btn-ghost:hover { color: var(--text); background: var(--sidebar-bg); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid #FCA5A5; }
.btn-danger:hover { background: var(--danger-light); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

/* ── Forms ── */
.form-row { display: flex; gap: 14px; margin-bottom: 14px; }
.form-group { flex: 1; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,107,240,0.1);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-neutral { background: var(--sidebar-bg); color: var(--text-muted); }

/* ── Status Badges ── */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.status-generated { background: #DBEAFE; color: #1D4ED8; }
.status-sent { background: #FEF3C7; color: #92400E; }
.status-approved { background: #D1FAE5; color: #065F46; }
.status-archived { background: #F3F4F6; color: #6B7280; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.data-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table tbody tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }

/* ── Toggle Switch ── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    bottom: 3px;
    left: 3px;
    transition: 0.2s;
    box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--border-light); }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    font-family: inherit;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

/* ── Error / Warning Boxes ── */
.error-box { background: var(--danger-light); border: 1px solid #FECACA; border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; color: #DC2626; font-size: 14px; }
.error-box h3 { color: #DC2626; margin-bottom: 8px; }
.error-box ul { margin-left: 20px; color: #991B1B; }
.warning-box { background: var(--warning-light); border: 1px solid #FDE68A; border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; }
.warning-box h3 { color: #D97706; margin-bottom: 8px; font-size: 14px; }
.warning-box ul { margin-left: 20px; color: #92400E; }

/* ── Breadcrumb ── */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: var(--space-md); }
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text); }

/* ── Utilities ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hide-mobile { }
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}
