/* ============================================
   POLLERIAWEB S.A.A. — DESIGN SYSTEM v2.0
   "Lucha & Brasa" — Warm gastronomic elegance
   Fonts: Syne (display) + Outfit (body)
   Iconos: SVG inline profesionales (zero deps)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Syne:wght@600;700;800&display=swap');

/* ═══════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════ */
:root {
    /* Brand colors — overridden per company via inline styles */
    --brand: #D94F3C;
    --brand-dark: #B8352A;
    --brand-light: rgba(217, 79, 60, 0.08);
    --brand-gradient: linear-gradient(135deg, #D94F3C 0%, #E8732A 100%);

    /* Neutrals — warm undertones */
    --bg-page: #FAFAF8;
    --bg-surface: #FFFFFF;
    --bg-elevated: #F5F4F0;
    --bg-muted: #EEEEE9;

    --text-primary: #1A1714;
    --text-secondary: #6B6258;
    --text-tertiary: #9E958B;
    --text-inverse: #FFFFFF;

    --border: #E5E0DA;
    --border-light: #EDEAE5;

    /* Semantic */
    --success: #16A34A;
    --success-bg: #F0FDF4;
    --success-text: #166534;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --warning-text: #92400E;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --danger-text: #991B1B;
    --info: #2563EB;
    --info-bg: #EFF6FF;
    --info-text: #1E40AF;

    /* Shadows — layered elevation */
    --shadow-1: 0 1px 2px rgba(26,23,20,.04), 0 1px 3px rgba(26,23,20,.03);
    --shadow-2: 0 2px 4px rgba(26,23,20,.04), 0 1px 6px rgba(26,23,20,.03);
    --shadow-3: 0 4px 8px rgba(26,23,20,.05), 0 2px 12px rgba(26,23,20,.03);
    --shadow-4: 0 8px 16px rgba(26,23,20,.06), 0 4px 24px rgba(26,23,20,.04);
    --shadow-brand: 0 4px 14px rgba(217,79,60,.25);
    --shadow-brand-lg: 0 8px 24px rgba(217,79,60,.3);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.8125rem;  /* 13px */
    --text-base: 0.9375rem;/* 15px */
    --text-lg: 1.0625rem;  /* 17px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */

    /* Transitions */
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════
   BASE RESET
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════ */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
h1 { font-size: var(--text-4xl); margin-bottom: var-space-3; }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }

.text-display {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -1px;
}

p { margin-bottom: var(--space-4); color: var(--text-secondary); }
small, .text-sm { font-size: var(--text-sm); color: var(--text-tertiary); }

/* ═══════════════════════════════════════════
   SVG ICON SYSTEM (inline sprites)
   ═══════════════════════════════════════════ */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }
.icon-2xl { width: 48px; height: 48px; }

/* Icon colors */
.icon-brand { color: var(--brand); }
.icon-success { color: var(--success); }
.icon-warning { color: var(--warning); }
.icon-danger { color: var(--danger); }

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Primary — brand gradient */
.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
    box-shadow: var(--shadow-brand-lg);
}

/* Secondary — solid neutral */
.btn-secondary {
    background: var(--bg-muted);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border); }

/* Outline */
.btn-outline {
    background: transparent;
    border: 2px solid var(--brand);
    color: var(--brand);
}
.btn-outline:hover {
    background: var(--brand-light);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

/* Sizes */
.btn-sm { padding: 6px 14px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: var(--text-lg); border-radius: var(--radius-lg); }
.btn-block { width: 100%; display: inline-flex; }

/* Icon button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-muted);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}
.btn-icon:hover { background: var(--border); color: var(--text-primary); }

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}
.card:hover {
    box-shadow: var(--shadow-3);
    transform: translateY(-2px);
}

.card-body { padding: var(--space-6); }
.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--bg-elevated);
}

/* ═══════════════════════════════════════════
   FORM INPUTS
   ═══════════════════════════════════════════ */
.form-input {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    outline: none;
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
    background: #fff;
}

/* Textarea */
.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239E958B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

label {
    display: block;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

/* ═══════════════════════════════════════════
   BADGES & TAGS
   ═══════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }

/* Status dot */
.badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════ */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: var(--text-base);
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #BBF7D0; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #FDE68A; }
.alert-info { background: var(--info-bg); color: var(--info-text); border: 1px solid #BFDBFE; }

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table-wrap {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

table.stripe-table {
    width: 100%;
    border-collapse: collapse;
}
table.stripe-table thead th {
    padding: 14px 16px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    text-align: left;
}
table.stripe-table tbody td {
    padding: 14px 16px;
    font-size: var(--text-base);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
table.stripe-table tbody tr:hover { background: rgba(217, 79, 60, 0.02); }
table.stripe-table tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade { animation: fade-in 0.3s ease; }
.animate-slide-up { animation: slide-up 0.5s var(--ease-out); }
.animate-scale-in { animation: scale-in 0.4s var(--ease-spring); }
.animate-fade-in-up { animation: fade-in-up 0.4s ease forwards; }

/* Stagger children */
.stagger-children > * { opacity: 0; animation: fade-in-up 0.4s ease forwards; }
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

.rounded-lg { border-radius: var(--radius-lg); }
.shadow-1 { box-shadow: var(--shadow-1); }
.shadow-2 { box-shadow: var(--shadow-2); }
.shadow-3 { box-shadow: var(--shadow-3); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1CCC5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B8AFA6; }

::selection { background: rgba(217, 79, 60, 0.15); color: var(--text-primary); }

/* ═══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS (mobile-first)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
}

/* ═══════ Responsive Tables ═══════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-modern td, .table-modern th { white-space: nowrap; }
@media (max-width: 768px) {
    .table-responsive table { font-size: 13px; }
    .table-responsive th, .table-responsive td { padding: 8px 10px; }
}
