@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Roboto:wght@400;500;700&display=swap');
/* Tema moderno inspirado no iFood */
:root {
  --primary: #EA1D2C; /* iFood red */
  --primary-dark: #C1121F;
  --secondary: #111111;
  --background: #ffffff;
  --surface: #ffffff;
  --text: #111111;
  --muted: #6c757d;
  --border: #eaeaea;
  --accent: #EA1D2C;
  --accent2: #C1121F;
  --accent-color: #EA1D2C;
  --success-color: #16a34a;
  --card: #101010;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
body { font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; padding: 0; background: var(--background); color: var(--text); line-height: 1.6; }

h1, h2, h3, .title { color: #111; }
.product .name { color: #fff; }
.sidebar a { color: #e5e5e5; }
.btn, .price, .bn-item.active { color: #fff; }

body.light { background: #ffffff; min-height: 100vh; color: #111; }

.login-container { max-width: 420px; margin: 8vh auto; padding: 24px; }
h1 { text-align: center; color: var(--accent); }

.card { background: var(--card); padding: 20px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
label { display: block; margin-top: 12px; color: var(--muted); font-weight: 600; }
input, select { width: 100%; padding: 12px 14px; margin-top: 6px; border: 1px solid #333; border-radius: 10px; background: #0d0d0d; color: #eee; }
.btn { width: auto; padding: 12px 16px; margin-top: 12px; background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; border-radius: 10px; color: white; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

.toast { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.toast.error { background: #8e2323; color: #fff; }
.toast.success { background: #236e23; color: #fff; }

.sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: 248px; background: #0c0c0c; border-right: 1px solid #1f1f1f; padding: 16px; }
.sidebar h2 { color: #fff; font-weight: 800; }
.sidebar a { display: block; color: #cfcfcf; text-decoration: none; padding: 12px 10px; border-radius: 10px; margin-top: 8px; }
.sidebar a:hover { background: #141414; }
.sidebar a.active { background: #111; color: var(--accent-color); font-weight: 700; }

.content { margin-left: 270px; padding: 24px 24px 84px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card-item { background: #ffffff; border-radius: 16px; padding: 14px; border: 1px solid #eee; }
.card-item img { width: 100%; height: 160px; object-fit: cover; border-radius: 12px; }
.card-item .title { font-weight: 700; margin-top: 8px; color: #111; }
.card-item .price { color: var(--accent-color); font-weight: 800; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid #eee; color: #111; }
th { text-align: left; color: var(--accent-color); font-weight: 800; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { width: auto; padding: 10px 14px; }

.bottom-nav { position: fixed; left: 0; bottom: 0; width: 100%; height: 68px; background: #ffffff; backdrop-filter: none; border-top: 1px solid #eee; display: flex; justify-content: space-around; align-items: center; z-index: 1000; box-shadow: 0 -1px 6px rgba(0,0,0,0.04); }
  .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #666; text-decoration: none; font-size: 12px; font-weight: 600; padding: 8px 4px 4px; min-width: 64px; transition: color 0.2s ease; }
  .bn-item .bn-icon { font-size: 20px; margin-bottom: 2px; color: #666; }
  .bn-item.active { color: var(--accent-color); }
  .bn-item:hover { color: var(--accent-color); }

@media (max-width: 768px) {
  .sidebar { width: 220px; }
  .content { margin-left: 240px; padding-bottom: 84px; }
}

.btn-primary { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 10px 14px; font-weight: 800; cursor: pointer; }
.pill { display:inline-block; border:1px solid #333; padding:6px 10px; border-radius:999px; color:#ccc; font-size:12px; cursor:pointer; }
.pill.selected { border-color: var(--accent-color); color: var(--accent-color); }

.app { max-width: 960px; margin: 0 auto; padding-bottom: 88px; }
.header { display:flex; align-items:center; justify-content:space-between; padding:16px; background:#fff; box-shadow: 0 1px 0 #eee; }
.header h1 { font-size: 22px; font-weight: 800; color: #111; }
.searchbar { padding: 12px; background:#fff; border-top:1px solid #eee; border-bottom:1px solid #eee; }
.searchbar input { width:100%; padding: 12px 14px; border:1px solid #ddd; border-radius: 12px; font-size:14px; }
.mesa-selector { display:flex; align-items:center; gap: 12px; padding: 12px; background:#fff; border-top:1px solid #eee; border-bottom:1px solid #eee; }
.mesa-selector label { font-weight: 600; color: #ccc; }
.mesa-select { flex: 1; max-width: 120px; background: linear-gradient(135deg, #141414 0%, #1f1f1f 100%); color: #fff; border: 2px solid #333; border-radius: 10px; padding: 10px 12px; font-size: 14px; transition: all 0.3s ease; }
.mesa-select:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(234, 29, 44, 0.25); outline: none; }

.category-tabs { position: sticky; top: 0; z-index: 10; background: #fff; box-shadow: 0 1px 0 #eee; }
.tabs { display:flex; gap: 16px; overflow-x:auto; white-space:nowrap; padding: 12px; }
.tabs .tab { color:#111; text-decoration:none; font-weight:700; border-bottom:2px solid transparent; padding-bottom:8px; }
.tabs .tab.active { border-color:#EA1D2C; color:#EA1D2C; }

.category-title { padding: 16px; font-weight: 800; color: #111; font-size: 18px; background: #fff; border-top:1px solid #eee; border-bottom:1px solid #eee; }

.products-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.product { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: center; background: #fff; border-bottom: 1px solid #eee; padding: 16px; }
.product img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; }
.product .name { font-weight: 700; color: #111; }
.product .desc { color: #666; font-size: 13px; }
.product .price { font-weight: 700; color: #111; }
.product .actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background:#fff; border:1px solid #ddd; color:#111; padding:10px 12px; border-radius:12px; font-weight:700; cursor:pointer; }
.btn:hover { border-color:#bbb; }
.btn-submit { background:#EA1D2C; color:#fff; border:none; padding:12px 14px; border-radius:12px; font-weight:700; cursor:pointer; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pill { display: inline-block; padding: 6px 10px; border: 1px solid #ddd; border-radius: 999px; color: #111; font-size: 12px; cursor: pointer; background:#fff; }
.pill.selected { background: #EA1D2C; color: #fff; border-color: #EA1D2C; }
.ad-section { margin-top: 8px; }
.ad-section > summary { cursor: pointer; color: #111; font-weight:700; }

.btn-cart { background: #EA1D2C; color: #fff; border: none; padding: 10px 14px; border-radius: 12px; font-weight: 700; cursor: pointer; }

.btn-cart::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12L8.1 13h7.45c.75 0 1.41-.41 1.75-1.03L21.7 4H5.21l-.94-2H1zm16 16c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E");
}

.btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.4);
}

.btn-add {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 8px 16px 8px 32px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    box-shadow: 0 2px 8px var(--shadow);
    position: relative;
}

.btn-add::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/%3E%3C/svg%3E");
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.cart-item { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid #eee; }
.cart-user .input { background:#fff; color:#111; border:1px solid #ddd; }
.cart-user .btn { background:#fff; color:#111; border:1px solid #ddd; }

/* Visibilidade de textos em painéis escuros (mantém navbar como está) */
.sidebar a, .muted { color: #cfcfcf; }
.sidebar a:hover { color: #fff; }

/* Em superfícies brancas, use textos mais escuros para evitar ficar apagado */
.light .product .desc,
.light .bn-item,
.light .bn-item .bn-icon,
.light .category-title,
.light .tabs .tab,
.light .searchbar,
.light .mesa-selector label,
.light .app,
.light .cart-item,
.light .pill,
.light .ad-section > summary,
.light .btn { color: #222; }
.light .product .desc { color: #333; }
.light table th, .light table td { color: #222; }

/* Admin com fundo branco e textos pretos (mantém sidebar escura) */
.dark { background: #ffffff; color: #111; }
.dark .content { color: #111; }
.dark label { color: #111; }
.dark input, .dark select, .dark textarea { color: #111; border-color: #ddd; background: #fff; }
.dark input::placeholder, .dark textarea::placeholder { color: #777; }
.dark table { background: transparent; }
.dark table th, .dark table td { color: #111; border-color: #eee; }
.dark .card { background: #fff; color: #111; border: 1px solid #eee; }
.dark .actions .btn { color: #111; }
.dark code { color: #111; }
.dark select option { color: #111; }

/* Modal for Pedidos/Comanda */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display:none; align-items: center; justify-content: center; z-index: 1100; }
.modal { background: #fff; border-radius: 12px; width: 92%; max-width: 520px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); overflow: hidden; }
.modal header { padding: 12px 16px; border-bottom: 1px solid #eee; font-weight: 800; color: #111; }
.modal .body { padding: 12px 16px; }
.modal .footer { padding: 12px 16px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 8px; }
.modal .list { max-height: 300px; overflow: auto; }
.modal .list-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f2f2f2; }
.modal .input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; }