/* =============================================
   YaEstá Dashboard Pro - All Panels
   Premium design with animations and dynamics
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============ DASHBOARD ROOT ============ */
#yaesta-owner-dashboard,
#yaesta-restaurant-dashboard,
#yaesta-driver-dashboard {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 60px;
    color: #0F172A;
    -webkit-font-smoothing: antialiased;
}

/* ============ DASHBOARD HEADER ============ */
.ye-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.ye-dash-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 4px;
    color: #0F172A;
    letter-spacing: -0.5px;
}
.ye-dash-header p {
    color: #64748B;
    margin: 0;
    font-size: 15px;
}
.ye-dash-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ============ STAT CARDS GRID ============ */
.ye-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}
.ye-stat-card {
    position: relative;
    padding: 22px 24px;
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    animation: fadeSlideUp 0.5s ease forwards;
    opacity: 0;
}
.ye-stat-card:nth-child(1) { animation-delay: 0s; }
.ye-stat-card:nth-child(2) { animation-delay: 0.08s; }
.ye-stat-card:nth-child(3) { animation-delay: 0.16s; }
.ye-stat-card:nth-child(4) { animation-delay: 0.24s; }

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ye-stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }

.ye-stat-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
}
.ye-stat-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.ye-stat-card-1 { background: linear-gradient(135deg, #10B981 0%, #059669 100%); color: #fff; }
.ye-stat-card-2 { background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%); color: #fff; }
.ye-stat-card-3 { background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%); color: #fff; }
.ye-stat-card-4 { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); color: #fff; }
.ye-stat-card-5 { background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%); color: #fff; }
.ye-stat-card-6 { background: #fff; color: #0F172A; border: 1px solid #E2E8F0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }

.ye-stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    position: relative;
    z-index: 1;
}
.ye-stat-value {
    font-size: 30px;
    font-weight: 800;
    display: block;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}
.ye-stat-label {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 500;
    position: relative;
    z-index: 1;
}
.ye-stat-card-6 .ye-stat-label { color: #64748B; }

/* ============ ALERT BANNERS ============ */
.ye-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.ye-alert-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    animation: fadeSlideUp 0.4s ease forwards;
}
.ye-alert-warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
    border: 1px solid #FCD34D;
}
.ye-alert-banner .ye-alert-action {
    margin-left: auto;
    padding: 6px 16px;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: inherit;
}
.ye-alert-banner .ye-alert-action:hover { background: rgba(0,0,0,0.18); }

/* ============ PERIOD SELECTOR ============ */
.ye-period-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: #F1F5F9;
    padding: 5px;
    border-radius: 12px;
    width: fit-content;
}
.ye-period-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    background: transparent;
    color: #64748B;
}
.ye-period-btn:hover { color: #0F172A; }
.ye-period-btn.active {
    background: #fff;
    color: #0F172A;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ============ TABS ============ */
.ye-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}
.ye-tabs::-webkit-scrollbar { display: none; }
.ye-tab {
    padding: 14px 22px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #94A3B8;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.25s;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
}
.ye-tab:hover { color: #475569; }
.ye-tab.active {
    color: #F43F5E;
    border-bottom-color: #F43F5E;
}
.ye-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #F43F5E;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}

.ye-tab-content { display: none; animation: fadeIn 0.3s ease; }
.ye-tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ FILTER PILLS ============ */
.ye-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.ye-filter-pill {
    padding: 7px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 100px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: #64748B;
}
.ye-filter-pill:hover { border-color: #CBD5E1; color: #0F172A; }
.ye-filter-pill.active {
    background: #0F172A;
    color: #fff;
    border-color: #0F172A;
}

/* ============ DATA CARDS ============ */
.ye-data-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.2s;
}
.ye-data-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.ye-data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #F1F5F9;
}
.ye-data-card-header h3 { margin: 0; font-size: 16px; font-weight: 700; }

/* ============ PROFESSIONAL TABLE ============ */
.ye-table-wrap { overflow-x: auto; }
.ye-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.ye-table thead th {
    padding: 12px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94A3B8;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    white-space: nowrap;
}
.ye-table tbody tr {
    transition: background 0.15s;
}
.ye-table tbody tr:hover { background: #F8FAFC; }
.ye-table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}
.ye-table tbody tr:last-child td { border-bottom: none; }

/* ============ STATUS BADGES ============ */
.ye-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.ye-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.ye-badge-pending { background: #FEF3C7; color: #92400E; }
.ye-badge-pending::before { background: #F59E0B; }
.ye-badge-accepted, .ye-badge-approved { background: #DBEAFE; color: #1E40AF; }
.ye-badge-accepted::before, .ye-badge-approved::before { background: #3B82F6; }
.ye-badge-preparing { background: #E0E7FF; color: #3730A3; }
.ye-badge-preparing::before { background: #6366F1; }
.ye-badge-ready { background: #D1FAE5; color: #065F46; }
.ye-badge-ready::before { background: #10B981; }
.ye-badge-picked_up, .ye-badge-on_the_way { background: #CFFAFE; color: #155E75; }
.ye-badge-picked_up::before, .ye-badge-on_the_way::before { background: #06B6D4; }
.ye-badge-delivered { background: #D1FAE5; color: #065F46; }
.ye-badge-delivered::before { background: #10B981; }
.ye-badge-cancelled, .ye-badge-suspended { background: #FEE2E2; color: #991B1B; }
.ye-badge-cancelled::before, .ye-badge-suspended::before { background: #EF4444; }

.ye-badge-online { background: #D1FAE5; color: #065F46; }
.ye-badge-online::before { background: #10B981; animation: pulse-dot 2s infinite; }
.ye-badge-offline { background: #F1F5F9; color: #64748B; }
.ye-badge-offline::before { background: #94A3B8; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============ ACTION BUTTONS ============ */
.ye-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.ye-btn:hover { transform: translateY(-1px); }
.ye-btn:active { transform: translateY(0); }
.ye-btn-primary { background: #F43F5E; color: #fff; }
.ye-btn-primary:hover { background: #E11D48; box-shadow: 0 4px 12px rgba(244,63,94,0.3); }
.ye-btn-success { background: #10B981; color: #fff; }
.ye-btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.ye-btn-danger { background: #FEE2E2; color: #DC2626; }
.ye-btn-danger:hover { background: #DC2626; color: #fff; }
.ye-btn-ghost { background: #F1F5F9; color: #475569; }
.ye-btn-ghost:hover { background: #E2E8F0; }
.ye-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.ye-btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }

/* ============ ORDER CARDS (Mobile-first for drivers/restaurants) ============ */
.ye-order-list { display: flex; flex-direction: column; gap: 14px; }
.ye-order-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 22px;
    transition: all 0.25s;
    animation: fadeSlideUp 0.4s ease forwards;
    opacity: 0;
}
.ye-order-card:hover { border-color: #CBD5E1; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.ye-order-card.ye-order-new {
    border-left: 4px solid #F59E0B;
    animation: fadeSlideUp 0.4s ease forwards, glowPulse 2s infinite;
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
    50% { box-shadow: 0 0 0 6px rgba(245,158,11,0.15); }
}

.ye-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.ye-order-number { font-size: 16px; font-weight: 800; color: #0F172A; }
.ye-order-time { font-size: 13px; color: #94A3B8; }
.ye-order-body { margin-bottom: 16px; }
.ye-order-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    font-size: 14px;
    color: #475569;
}
.ye-order-row-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.ye-order-items { list-style: none; padding: 0; margin: 8px 0 0 32px; }
.ye-order-items li { padding: 3px 0; font-size: 14px; color: #64748B; }
.ye-order-items li strong { color: #0F172A; }
.ye-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 0;
    border-top: 1px solid #F1F5F9;
    margin-top: 12px;
}
.ye-order-amount { font-size: 22px; font-weight: 800; color: #0F172A; }
.ye-order-payment { font-size: 13px; color: #64748B; font-weight: 600; }
.ye-order-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ MENU MANAGEMENT ============ */
.ye-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.ye-menu-item {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
}
.ye-menu-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: translateY(-2px); }
.ye-menu-img { height: 140px; background: #F1F5F9; overflow: hidden; position: relative; }
.ye-menu-img img { width: 100%; height: 100%; object-fit: cover; }
.ye-menu-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; background: linear-gradient(135deg, #F1F5F9, #E2E8F0); }
.ye-menu-info { padding: 16px; }
.ye-menu-info h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.ye-menu-info p { margin: 0; font-size: 13px; color: #94A3B8; }
.ye-menu-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #F8FAFC; border-top: 1px solid #F1F5F9; }
.ye-menu-price { font-size: 18px; font-weight: 800; color: #F43F5E; }
.ye-menu-actions { display: flex; gap: 6px; }

/* ============ TOGGLE SWITCH ============ */
.ye-toggle-wrap { display: flex; align-items: center; gap: 14px; }
.ye-toggle {
    position: relative;
    width: 56px;
    height: 30px;
    cursor: pointer;
}
.ye-toggle input { opacity: 0; width: 0; height: 0; }
.ye-toggle-track {
    position: absolute;
    inset: 0;
    background: #CBD5E1;
    border-radius: 30px;
    transition: all 0.3s;
}
.ye-toggle-track::before {
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.ye-toggle input:checked + .ye-toggle-track { background: #10B981; }
.ye-toggle input:checked + .ye-toggle-track::before { transform: translateX(26px); }
.ye-toggle-label { font-weight: 700; font-size: 16px; }
.ye-toggle-label.online { color: #10B981; }
.ye-toggle-label.offline { color: #94A3B8; }

/* ============ WALLET CARDS ============ */
.ye-wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.ye-wallet-card {
    padding: 24px;
    border-radius: 18px;
    text-align: center;
}
.ye-wallet-card h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.ye-wallet-amount { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.ye-wallet-earnings { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); color: #065F46; }
.ye-wallet-pending { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; }
.ye-wallet-total { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); color: #1E40AF; }

.ye-wallet-history { display: flex; flex-direction: column; gap: 8px; }
.ye-wallet-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #F1F5F9;
    border-radius: 12px;
    font-size: 14px;
}
.ye-wallet-entry-amount { font-weight: 800; font-size: 16px; }
.ye-wallet-entry-amount.positive { color: #10B981; }
.ye-wallet-entry-amount.negative { color: #EF4444; }
.ye-wallet-entry small { display: block; color: #94A3B8; font-size: 12px; }

/* ============ SETTINGS ============ */
.ye-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ye-settings-section {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 28px;
}
.ye-settings-section h3 { margin: 0 0 20px; font-size: 18px; font-weight: 700; }
.ye-field { margin-bottom: 16px; }
.ye-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.3px; }
.ye-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    background: #fff;
    color: #0F172A;
}
.ye-input:focus { border-color: #F43F5E; outline: none; box-shadow: 0 0 0 3px rgba(244,63,94,0.1); }
.ye-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ EMPTY STATE ============ */
.ye-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94A3B8;
}
.ye-empty-icon { font-size: 56px; display: block; margin-bottom: 16px; opacity: 0.5; }
.ye-empty p { font-size: 16px; font-weight: 500; }

/* ============ LOADING ============ */
.ye-loading {
    text-align: center;
    padding: 40px;
    color: #94A3B8;
    font-size: 15px;
}
.ye-loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid #E2E8F0;
    border-top-color: #F43F5E;
    border-radius: 50%;
    margin: 12px auto 0;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ NOTIFICATION SOUND BUTTON ============ */
.ye-sound-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #FEF3C7;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    color: #92400E;
}
.ye-sound-indicator::before {
    content: '🔔';
    animation: ring 2s infinite;
}
@keyframes ring {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(15deg); }
    20%, 40% { transform: rotate(-15deg); }
    50% { transform: rotate(0); }
}

/* ============ MAP CONTAINER ============ */
.ye-map-container {
    height: 320px;
    border-radius: 18px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    margin: 16px 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .ye-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .ye-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .ye-stats-grid { grid-template-columns: 1fr; }
    .ye-dash-header { flex-direction: column; }
    .ye-order-actions { flex-direction: column; }
    .ye-order-actions .ye-btn { width: 100%; justify-content: center; }
    .ye-field-row { grid-template-columns: 1fr; }
    .ye-menu-grid { grid-template-columns: 1fr; }
    .ye-wallet-grid { grid-template-columns: 1fr; }
    .ye-tabs { gap: 0; }
    .ye-tab { padding: 12px 14px; font-size: 13px; }
}
