/* =============================================
   WorkFood - Design System
   Brand colors from logo:
     Dark green:  #0D6142
     Mid green:   #00672F
     Light green: #68BD45
     Near black:  #231F20
   ============================================= */

:root {
    --wf-primary:        #0D6142;
    --wf-primary-dark:   #0a4e35;
    --wf-primary-light:  #EBF7F1;
    --wf-green-mid:      #00672F;
    --wf-green-light:    #68BD45;
    --wf-dark:           #231F20;
    --wf-gray-100:       #F8F9FA;
    --wf-gray-200:       #E9ECEF;
    --wf-gray-500:       #6C757D;
    --wf-gray-700:       #495057;
    --wf-text:           #231F20;
    --wf-border:         #DEE2E6;
    --wf-shadow:         0 2px 12px rgba(13, 97, 66, 0.08);
    --wf-shadow-lg:      0 8px 32px rgba(13, 97, 66, 0.14);
    --wf-radius:         12px;
    --wf-radius-sm:      8px;
    --wf-radius-lg:      20px;
    --wf-gradient:       linear-gradient(135deg, #00672F 0%, #68BD45 100%);
    --wf-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Base */
* { box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: var(--wf-font);
    color: var(--wf-text);
    background: #F5F6FA;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =============================================
   NAVBAR
   ============================================= */

.wf-navbar {
    background: white;
    border-bottom: 1px solid var(--wf-border);
    box-shadow: var(--wf-shadow);
    padding: 0.5rem 0;
}

.wf-navbar-logo {
    height: 42px;
    width: auto;
    display: block;
}

.wf-brand {
    padding: 0;
    line-height: 1;
}

.wf-brand:hover { opacity: 0.85; }

.wf-navbar .nav-link {
    color: var(--wf-gray-700) !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--wf-radius-sm);
    transition: all 0.2s;
}

.wf-navbar .nav-link:hover {
    color: var(--wf-primary) !important;
    background: var(--wf-primary-light);
}

.wf-user-name {
    color: var(--wf-gray-500) !important;
    font-size: 0.875rem;
    font-weight: 500;
    align-self: center;
}

.wf-logout {
    color: var(--wf-gray-700) !important;
    font-weight: 500;
    border-radius: var(--wf-radius-sm);
    transition: all 0.2s;
}

.wf-logout:hover {
    color: var(--wf-primary) !important;
    background: var(--wf-primary-light);
}

/* =============================================
   MAIN CONTENT
   ============================================= */

.wf-main {
    flex: 1;
    padding-bottom: 2rem;
}

.wf-main-login {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, #0a4e35 0%, #0D6142 40%, #00672F 70%, #68BD45 100%);
    min-height: 100vh;
    padding: 1.5rem;
}

/* =============================================
   FOOTER
   ============================================= */

.wf-footer {
    background: white;
    border-top: 1px solid var(--wf-border);
    padding: 1rem 0;
    color: var(--wf-gray-500);
    font-size: 0.8125rem;
}

/* =============================================
   LOGIN PAGE
   ============================================= */

.wf-login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 4rem);
}

.wf-login-card {
    background: white;
    border-radius: var(--wf-radius-lg);
    box-shadow: var(--wf-shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.wf-login-header {
    background: var(--wf-gradient);
    padding: 2.25rem 2rem 2rem;
    text-align: center;
}

.wf-login-logo {
    height: 64px;
    width: auto;
    /* SVG has dark green text — invert for white background gradient */
    filter: brightness(0) invert(1);
    margin-bottom: 0.75rem;
    display: inline-block;
}

.wf-login-subtitle {
    color: rgba(255,255,255,0.88);
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.25px;
}

.wf-login-body {
    padding: 2rem;
}

.wf-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--wf-gray-700);
    margin-bottom: 0.5rem;
}

.wf-input {
    border: 1.5px solid var(--wf-border);
    border-radius: var(--wf-radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.wf-input:focus {
    border-color: var(--wf-primary);
    box-shadow: 0 0 0 3px rgba(13, 97, 66, 0.15);
}

.wf-btn-eye {
    border: 1.5px solid var(--wf-border);
    border-left: none;
    background: white;
    color: var(--wf-gray-500);
    border-radius: 0 var(--wf-radius-sm) var(--wf-radius-sm) 0;
    transition: all 0.2s;
}

.wf-btn-eye:hover { color: var(--wf-primary); }

.wf-btn-login {
    background: var(--wf-gradient);
    color: white;
    border: none;
    border-radius: var(--wf-radius-sm);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    letter-spacing: 0.25px;
}

.wf-btn-login:hover {
    background: linear-gradient(135deg, #0a4e35 0%, #4d9432 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(13, 97, 66, 0.45);
}

/* =============================================
   HOME - COMPANY CARD
   ============================================= */

.wf-company-card {
    background: white;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    padding: 1.5rem;
    border-left: 4px solid var(--wf-primary);
}

.wf-company-avatar {
    width: 56px;
    height: 56px;
    background: var(--wf-primary-light);
    color: var(--wf-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.wf-company-name {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--wf-dark);
    margin: 0;
}

.wf-company-info {
    font-size: 0.875rem;
    color: var(--wf-gray-500);
    display: inline-flex;
    align-items: center;
}

.wf-btn-dir {
    background: var(--wf-primary-light);
    color: var(--wf-primary);
    border: 1px solid rgba(13, 97, 66, 0.2);
    border-radius: var(--wf-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.875rem;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

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

/* =============================================
   HOME - CALENDAR
   ============================================= */

.wf-calendar-card {
    background: white;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    overflow: hidden;
}

.wf-calendar-header {
    background: var(--wf-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.wf-calendar-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    text-transform: capitalize;
}

.wf-cal-nav {
    color: white;
    text-decoration: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    transition: background 0.2s;
    font-size: 0.9rem;
}

.wf-cal-nav:hover {
    background: rgba(255,255,255,0.35);
    color: white;
}

.wf-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    border-bottom: 1px solid var(--wf-border);
    background: var(--wf-gray-100);
}

.wf-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--wf-gray-700);
}

.wf-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wf-dot-available  { background: var(--wf-green-light); }
.wf-dot-order      { background: var(--wf-primary); }
.wf-dot-closed     { background: var(--wf-gray-500); }

.wf-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0.5rem 0.625rem 0.625rem;
    gap: 0.25rem;
}

.wf-day-header {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--wf-gray-500);
    padding: 0.3rem 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wf-day-cell {
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.15s;
    min-height: 40px;
    aspect-ratio: 1;
}

.wf-day-empty { background: transparent; }

.wf-day-past .wf-day-number {
    color: var(--wf-gray-500);
    opacity: 0.45;
}

.wf-day-today {
    background: var(--wf-primary-light);
    border: 2px solid var(--wf-primary);
}

.wf-day-available {
    background: #f0faf4;
    cursor: pointer;
}

.wf-day-available:hover {
    background: var(--wf-green-light);
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(104, 189, 69, 0.4);
}

.wf-day-available:hover .wf-day-number { color: white; }
.wf-day-available:hover .wf-order-new  { color: white; }

.wf-day-has-order {
    background: var(--wf-primary-light);
    cursor: pointer;
}

.wf-day-has-order:hover {
    background: var(--wf-primary);
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(13, 97, 66, 0.35);
}

.wf-day-has-order:hover .wf-day-number  { color: white; }
.wf-day-has-order:hover .wf-order-badge { background: rgba(255,255,255,0.25); color: white; }

.wf-day-closed {
    background: var(--wf-gray-200);
    cursor: pointer;
}

.wf-day-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    padding: 0.125rem;
    border-radius: 6px;
}

.wf-day-number {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    color: var(--wf-text);
}

.wf-order-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    background: var(--wf-primary);
    color: white;
    border-radius: 999px;
    padding: 1px 5px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
}

.wf-day-closed .wf-order-badge {
    background: var(--wf-gray-500);
}

.wf-order-new {
    font-size: 0.75rem;
    color: var(--wf-green-mid);
    margin-top: 1px;
}

/* Mobile calendar */
@media (max-width: 480px) {
    .wf-calendar-grid { padding: 0.375rem; gap: 0.2rem; }
    .wf-day-cell      { min-height: 36px; }
    .wf-day-number    { font-size: 0.75rem; }
    .wf-order-badge   { display: none; }
    .wf-legend        { gap: 0.5rem; padding: 0.4rem 0.75rem; }
}

/* =============================================
   PEDIDOS - ADD / EDIT
   ============================================= */

.wf-page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--wf-dark);
}

.wf-page-subtitle {
    font-size: 0.9375rem;
    color: var(--wf-gray-500);
}

.wf-btn-back {
    background: var(--wf-gray-100);
    color: var(--wf-gray-700);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    padding: 0;
}

.wf-btn-back:hover {
    background: var(--wf-primary-light);
    color: var(--wf-primary);
    border-color: var(--wf-primary);
}

.wf-platos-section {
    background: white;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    overflow: hidden;
}

.wf-section-header {
    background: var(--wf-gray-100);
    padding: 0.875rem 1.25rem;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--wf-primary);
    border-bottom: 1px solid var(--wf-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wf-platos-list { }

.wf-plato-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--wf-gray-100);
    gap: 1rem;
    transition: background 0.15s;
}

.wf-plato-row:last-child { border-bottom: none; }
.wf-plato-row:hover { background: var(--wf-gray-100); }

.wf-plato-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wf-plato-name {
    font-weight: 500;
    color: var(--wf-text);
    font-size: 0.9375rem;
}

.wf-plato-rubro {
    display: block;
    font-size: 0.8125rem;
    color: var(--wf-gray-500);
    margin-top: 2px;
}

.wf-plato-detail {
    color: var(--wf-gray-500);
    font-size: 0.875rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.15s;
}

.wf-plato-detail:hover { color: var(--wf-primary); }

.wf-cantidad-control {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.wf-qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--wf-border);
    background: white;
    color: var(--wf-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    font-size: 1rem;
}

.wf-qty-btn:hover {
    border-color: var(--wf-primary);
    color: var(--wf-primary);
    background: var(--wf-primary-light);
}

.wf-qty-input {
    width: 44px;
    text-align: center;
    border: 1.5px solid var(--wf-border);
    border-radius: var(--wf-radius-sm);
    padding: 0.25rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--wf-text);
    background: var(--wf-gray-100);
}

.wf-qty-input:focus {
    outline: none;
    border-color: var(--wf-primary);
    background: white;
}

.wf-qty-readonly {
    background: var(--wf-gray-100);
    cursor: default;
}

/* Remove number input arrows */
.wf-qty-input::-webkit-outer-spin-button,
.wf-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wf-qty-input[type=number] { -moz-appearance: textfield; }

/* =============================================
   PEDIDOS - OPEN (view only)
   ============================================= */

.wf-badge-closed {
    background: var(--wf-gray-500);
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
}

.wf-open-qty { flex-shrink: 0; }

.wf-qty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--wf-primary-light);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--wf-primary);
}

.wf-total-section {
    border-top: 2px solid var(--wf-border);
    padding: 1rem 1.25rem;
    background: var(--wf-gray-100);
}

.wf-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    color: var(--wf-gray-700);
    font-size: 0.9375rem;
}

.wf-total-final {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--wf-dark);
    border-top: 1px solid var(--wf-border);
    margin-top: 0.375rem;
    padding-top: 0.75rem;
}

/* =============================================
   MENU - DISH DETAIL
   ============================================= */

.wf-menu-card {
    background: white;
    border-radius: var(--wf-radius-lg);
    box-shadow: var(--wf-shadow-lg);
    overflow: hidden;
}

.wf-menu-image-wrapper {
    height: 280px;
    overflow: hidden;
}

.wf-menu-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wf-menu-image-placeholder {
    height: 180px;
    background: var(--wf-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    opacity: 0.8;
}

.wf-menu-body { padding: 1.5rem; }

.wf-menu-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--wf-green-mid);
    margin-bottom: 0.5rem;
}

.wf-menu-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--wf-dark);
    margin-bottom: 1rem;
}

.wf-menu-description h5 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--wf-gray-700);
    margin-bottom: 0.75rem;
}

.wf-menu-description p {
    color: var(--wf-gray-700);
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* =============================================
   BUTTONS
   ============================================= */

.wf-btn-primary {
    background: var(--wf-primary);
    color: white;
    border: none;
    border-radius: var(--wf-radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.wf-btn-primary:hover {
    background: var(--wf-primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 97, 66, 0.35);
}

.wf-btn-secondary {
    background: white;
    color: var(--wf-gray-700);
    border: 1.5px solid var(--wf-border);
    border-radius: var(--wf-radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.wf-btn-secondary:hover {
    background: var(--wf-gray-100);
    color: var(--wf-text);
    border-color: var(--wf-gray-500);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 576px) {
    .wf-company-card  { padding: 1rem; }
    .wf-company-name  { font-size: 1.125rem; }
    .wf-plato-row     { padding: 0.75rem 1rem; }
    .wf-section-header { padding: 0.75rem 1rem; }
}

/* =============================================
   PLATO CARD — imagen inline + detalle expandible
   ============================================= */

.wf-plato-card {
    border-bottom: 1px solid var(--wf-gray-100);
}
.wf-plato-card:last-child { border-bottom: none; }
.wf-plato-card .wf-plato-row {
    border-bottom: none;
}
.wf-plato-card .wf-plato-row:hover { background: transparent; }
.wf-plato-card:hover { background: var(--wf-gray-100); }

.wf-plato-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
}

.wf-plato-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.wf-plato-thumb-static {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.wf-thumb-placeholder {
    width: 48px;
    height: 48px;
    background: var(--wf-gray-100);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wf-gray-400);
    font-size: 1.25rem;
}

.wf-plato-name-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.wf-plato-info-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.375rem;
    cursor: pointer;
    color: var(--wf-primary);
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1;
}

.wf-chevron {
    transition: transform 0.2s ease;
    display: inline-block;
}
.wf-chevron-open {
    transform: rotate(180deg);
}

.wf-plato-detalle {
    background: var(--wf-gray-50);
    border-top: 1px solid var(--wf-gray-100);
}

.wf-detalle-body {
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.wf-detalle-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.wf-detalle-texto {
    margin: 0;
    font-size: 0.875rem;
    color: var(--wf-text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* =============================================
   INGRESAR NOMBRES
   ============================================= */

.wf-nombre-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    border-bottom: 1px solid var(--wf-gray-100);
}
.wf-nombre-row:last-child { border-bottom: none; }

.wf-nombre-label {
    font-size: 0.875rem;
    color: var(--wf-text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.wf-nombre-input {
    flex: 1;
    border: 1px solid var(--wf-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    color: var(--wf-text);
    background: #fff;
    transition: border-color 0.15s;
}
.wf-nombre-input:focus {
    outline: none;
    border-color: var(--wf-primary);
    box-shadow: 0 0 0 3px rgba(13,97,66,0.12);
}
.wf-nombre-input.is-invalid {
    border-color: #dc3545;
}

/* Open view — nombres por plato */
.wf-plato-row-open { align-items: flex-start; }

.wf-nombres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.wf-nombre-tag {
    display: inline-flex;
    align-items: center;
    background: var(--wf-gray-100);
    color: var(--wf-text-muted);
    border-radius: 20px;
    padding: 0.2rem 0.625rem;
    font-size: 0.8125rem;
}

@media (max-width: 576px) {
    .wf-detalle-body { flex-direction: column; }
    .wf-detalle-img  { width: 100%; height: 180px; }
    .wf-nombre-row   { padding: 0.625rem 1rem; }
}
