:root {
    /* Paleta Premium Dark Mode */
    --bg-color: #0b0f19;
    --bg-gradient: radial-gradient(circle at top left, #1e293b, #0b0f19 70%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Navbar Simples */
header {
    width: 100%;
    padding: 24px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(11, 15, 25, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; 
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}

.badge-delete {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.6;
    transition: var(--transition);
}
.badge-delete:hover {
    opacity: 1;
    transform: scale(1.2);
    color: #ef4444; /* danger red */
}

/* Analytics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.metric-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: var(--transition);
    min-height: 120px;
}
.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}
.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}
.metric-value {
    color: white;
    font-size: 1.5rem; /* Fonte reduzida para evitar estouro */
    font-weight: 700;
    word-break: break-word;
}

.notification-card {
    background: linear-gradient(105deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 30px;
}
.notification-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.notification-card h2 {
    font-size: 1.1rem;
    margin-top: 3px;
}
.notification-eyebrow {
    color: #6ee7b7;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.notification-count {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #10b981;
    color: #042f2e;
    font-weight: 800;
}
.notification-list {
    display: grid;
    gap: 8px;
}
.notification-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}
.notification-item strong { color: #a7f3d0; }
.notification-item small { color: var(--text-secondary); text-transform: capitalize; }
.notification-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; }
.notification-empty { color: var(--text-secondary); font-size: 0.85rem; }

@media (max-width: 600px) {
    .notification-item { grid-template-columns: auto minmax(0, 1fr) auto; }
    .notification-item small { grid-column: 2 / -1; }
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Main Container */
main {
    width: 100%;
    max-width: 1200px;
    padding: 40px 24px;
    flex: 1;
}

/* Top Bar de Controles */
.controls-layer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-wrapper input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 12px 16px 12px 42px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.search-wrapper input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
    transition: var(--transition);
}

.search-wrapper input:focus + svg {
    fill: var(--accent-color);
}

.btn-refresh {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-refresh:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-refresh:active {
    transform: translateY(0);
}

/* Esconde botões que só devem aparecer após verificação de permissão no servidor */
button.hidden-until-auth {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Nova Barra de Filtros Refinada */
.filters-layer {
    display: flex;
    gap: 20px;
    margin-bottom: 40px; /* Espaço aumentado entre filtros e grid */
    background: rgba(255, 255, 255, 0.03);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-wrap: wrap;
    align-items: flex-end; /* Alinha labels e inputs na base */
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 160px;
    flex: 1;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-left: 2px;
}

.filter-group select, .filter-group input {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    outline: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    height: 48px; /* Altura padronizada */
}

/* Estilização Customizada para o Select */
.filter-group select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

.filter-group select:hover, .filter-group input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.filter-group select:focus, .filter-group input:focus {
    border-color: var(--accent-color);
    background: rgba(15, 23, 42, 1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.filter-group select option {
    background: #0f172a;
    color: white;
    padding: 12px;
}

.btn-refresh.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--accent-glow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

/* Botão de export CSV (verde) */
.btn-csv {
    background: linear-gradient(135deg,#34d399 0%, #10b981 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(16,185,129,0.18);
}
.btn-csv { display: inline-flex; align-items: center; gap: 8px; }
.btn-csv:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,185,129,0.22); }

/* Variante compacta para actions small */
.btn-sm { padding: 8px 14px; font-size:0.9rem; border-radius: 999px; }

/* Forçar padronização mesmo quando há estilos inline remanescentes */
.btn-primary, .btn-csv, .btn-refresh {
    padding: 12px 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-sm { padding: 8px 14px !important; display: inline-flex !important; align-items:center !important; gap:8px !important; }

.btn-cancel {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 999px;
}

.action-btn { padding: 6px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important; border-radius: 8px; }

/* Inserir ícones via atributo data-icon em todos os botões suportados */
button[data-icon]::before {
    content: attr(data-icon);
    margin-right: 8px;
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
}

/* Garante ícone visível em botões de ação mesmo com cores escuras */
button[data-icon]::before { opacity: 1; }

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 500;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%; 
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

@keyframes modalFadeIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.90); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Sistema de Toasts (Notificações) */
#toastContainer {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    background: rgba(11, 15, 25, 0.8);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    border-left: 4px solid var(--accent-color);
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }

@keyframes toastIn {
    from { transform: translateX(100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast.fade-out {
    animation: toastOut 0.3s forwards cubic-bezier(0.4, 0, 1, 1);
}
@keyframes toastOut {
    to { transform: translateX(100%); opacity: 0; }
}

/* Modal de Confirmação Moderno */
.modal-confirm {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 11000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.confirm-content {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.confirm-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.confirm-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions button {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}
.btn-cancel:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Media Queries para Mobile */
@media (max-width: 640px) {
    header { padding: 16px 20px; }
    main { padding: 20px 16px; }
    .controls-layer { flex-direction: column; align-items: stretch; }
    .search-wrapper { max-width: none; }
    #toastContainer {
        top: auto;
        bottom: 24px;
        right: 16px;
        left: 16px;
    }
    .toast { min-width: 0; }
    .confirm-actions { flex-direction: column-reverse; }
}

.error-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97);
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Simulador de Lucro - Estilo Analytics */
.simulation-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.simulation-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0.5;
}

.sim-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.sim-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.profit-highlight {
    grid-column: span 2;
    background: rgba(16, 185, 129, 0.05);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(16, 185, 129, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.price-unit-group {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.price-unit-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.price-unit-group input {
    border: none !important;
    background: transparent !important;
    flex: 1;
}

.price-unit-group select {
    border: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary);
    padding: 0 12px;
    outline: none;
    cursor: pointer;
    border-left: 1px solid var(--glass-border) !important;
    font-weight: 600;
}

/* Ocultar setas padrão do input number */
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.stepper-input[type=number] {
    -moz-appearance: textfield;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-secondary); }
.form-group input {
    width: 100%; padding: 12px; background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border); color: white; border-radius: var(--radius-md); outline: none;
}
.form-group input:focus { border-color: var(--accent-color); }
.flex-row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 32px; }

.action-btn { background: transparent; border: none; cursor: pointer; color: var(--text-secondary); transition: var(--transition); padding: 4px; border-radius: 4px; }
.action-btn:hover { color: white; background: rgba(255,255,255,0.1); }

/* Tabela - Glassmorphism Card com Scroll Responsivo */
.table-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow-x: auto; /* Habilita scroll horizontal */
    overflow-y: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Scrollbar Customizada Premium */
.table-container::-webkit-scrollbar {
    height: 6px;
}
.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}
.table-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    transition: var(--transition);
}
.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 800px; /* Garante que a tabela não esprema no mobile */
}

th {
    background: rgba(255, 255, 255, 0.05);
    padding: 18px 24px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 18px 24px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: var(--transition);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    cursor: default;
}

/* Status Pills */
.stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-in {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stock-low {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.stock-out {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Empty State & Loading */
.message-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-secondary);
}

/* Admin Panel specific styles */
.tab-buttons {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.tab-btn.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
}
.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.admin-table th {
    padding: 12px 16px;
    font-size: 0.75rem;
}
.admin-table td {
    padding: 12px 16px;
    font-size: 0.85rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    border: 1px solid transparent;
}
.status-ativo { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.status-inativo { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.status-pago {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
}
.status-pending {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}
.status-cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}
.status-pronto {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.25);
}

.status-entregue {
    background: rgba(16, 185, 129, 0.12);
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.22);
}

.modal-ready-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.modal-ready-btn--active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.modal-ready-btn--active:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.modal-ready-btn--ready {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.22);
    cursor: default;
    opacity: 0.9;
}

.modal-ready-btn--muted {
    background: rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.18);
    font-size: 0.76rem;
    padding: 9px 12px;
}

.modal-ready-btn--muted:hover {
    background: rgba(148, 163, 184, 0.14);
}

.order-detail-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: #e2e8f0;
}

.order-product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.order-product-header h3 {
    font-size: clamp(1.5rem, 1.9vw, 2.15rem);
    font-weight: 800;
    line-height: 1.2;
    color: #f8fafc;
    margin: 0;
    letter-spacing: -0.02em;
}

.order-product-id {
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0.9;
    white-space: nowrap;
    margin-top: 6px;
}

.order-client-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
}

.order-client-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    font-size: 1rem;
}

.order-client-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.order-client-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.order-client-cpf {
    font-size: 0.82rem;
    color: #94a3b8;
}

.order-client-link {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.order-status-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0 0;
    background: transparent;
    border: none;
    border-radius: 0;
    flex-wrap: wrap;
}

.order-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 0;
}

.order-status-icon {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    margin-top: 2px;
}

.order-status-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.order-status-label {
    font-size: 1.08rem;
    color: #f8fafc;
    font-weight: 700;
    line-height: 1.3;
}

.order-status-copy {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.order-status-row--success {
    color: #86efac;
}

.order-status-row--warning {
    color: #fbbf24;
}

.order-status-row--neutral {
    color: #7dd3fc;
}

.order-status-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
    margin-top: 2px;
}

.order-status-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 220px;
}

.order-status-action--secondary {
    min-width: 0;
}

.order-status-action--secondary .modal-ready-btn {
    padding: 10px 12px;
    min-height: 38px;
}

.order-address-block,
.order-items-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-section-label {
    font-size: 0.72rem;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
}

.order-address-content {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    color: #e2e8f0;
    font-size: 0.98rem;
    line-height: 1.45;
}

.order-address-line {
    color: #f8fafc;
    font-weight: 500;
}

.order-address-meta {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.order-items-block .bg-slate-800\/60 {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.order-items-block .bg-slate-800\/60 > div:first-child {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-items-block .bg-slate-800\/60 .font-bold {
    color: #f8fafc;
    font-size: 0.98rem;
    line-height: 1.35;
    word-break: break-word;
    margin: 0;
}

.order-items-block .bg-slate-800\/60 .text-xs {
    color: #94a3b8 !important;
    margin-top: 0;
    line-height: 1.35;
    word-break: break-word;
}

.order-items-block .bg-slate-800\/60 .text-right {
    color: #38bdf8;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
    font-size: 0.9rem;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .order-product-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-status-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .order-status-action {
        justify-content: flex-start;
        width: 100%;
    }

    .modal-ready-btn {
        width: 100%;
    }
}

.role-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}
.role-super { color: #f59e0b; border-color: #f59e0b; }

.admin-actions {
    display: flex;
    gap: 8px;
}

/* 🚚 Estilo para quando o pedido for Postado / Em trânsito */
.status-postado {
    background: rgba(14, 165, 233, 0.15) !important; /* Azul suave */
    color: #38bdf8 !important;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

/* ✅ Estilo para quando o pedido for Entregue ao cliente */
.status-entregue {
    background: rgba(34, 197, 94, 0.15) !important; /* Verde suave */
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.3);
}