/* ===== Fuji Café — telas de autenticação e painel =====
   Usa os tokens semânticos de tema definidos em styles.css
   (--bg, --surface, --text, --accent...), com suporte a claro/escuro. */

/* ----- Barra de toggles (idioma + tema) no topo das telas de auth ----- */
.auth-topbar {
  position: fixed; top: 1rem; right: 1rem; z-index: 20;
  display: flex; align-items: center; gap: .6rem;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    linear-gradient(rgba(7,16,33,.85), rgba(7,16,33,.92)),
    url("https://images.unsplash.com/photo-1554118811-1e0d58224f24?auto=format&fit=crop&w=1400&q=80") center/cover fixed;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(7, 16, 33, .55);
  padding: clamp(1.8rem, 5vw, 2.8rem);
  border-top: 4px solid var(--accent-2);
}

.auth-brand { text-align: center; margin-bottom: 1.6rem; }
.auth-brand .brand-logo { margin-inline: auto; }
.auth-brand .kanji { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent-2); }
.auth-brand .name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--text); margin-left: .4rem; }
.auth-card h1 { font-size: 1.55rem; text-align: center; margin-bottom: .3rem; color: var(--text); }
.auth-sub { text-align: center; font-size: .9rem; color: var(--text-soft); margin-bottom: 1.6rem; }

.auth-form { display: grid; gap: 1rem; }
.auth-form label { display: grid; gap: .35rem; font-size: .82rem; font-weight: 500; color: var(--text-soft); }
.auth-form input, .auth-form select {
  font-family: var(--font-body); font-size: .95rem; padding: .8rem 1rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
  color: var(--text); transition: var(--ease);
}
.auth-form input:focus, .auth-form select:focus {
  outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(27,158,224,.22);
}
.auth-form .btn { margin-top: .4rem; width: 100%; text-align: center; }

.auth-switch { text-align: center; margin-top: 1.3rem; font-size: .88rem; color: var(--text-soft); }
.auth-switch a { color: var(--accent); font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

.auth-msg { font-size: .88rem; padding: .75rem 1rem; border-radius: 10px; display: none; }
.auth-msg.show { display: block; }
.auth-msg.error { background: #fde8e8; color: #9b2c2c; border: 1px solid #f5c6c6; }
.auth-msg.success { background: #e6f4ff; color: #14528a; border: 1px solid #bfe1ff; }

.auth-back { display: block; text-align: center; margin-top: 1rem; font-size: .85rem; color: var(--text-soft); }
.auth-back:hover { color: var(--accent); }

/* ===== Painel ===== */
.painel-body { background: var(--bg); min-height: 100vh; color: var(--text); }
.painel-top {
  background: var(--section-dark); color: var(--on-dark);
  padding: 1rem var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.painel-top .brand-kanji { color: var(--accent-2); font-family: var(--font-display); font-size: 1.3rem; }
.painel-top .brand-name { font-family: var(--font-display); font-size: 1.15rem; margin-left: .35rem; }
.painel-user { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.role-badge {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: .28rem .8rem; border-radius: 999px; color: #fff; background: var(--accent);
}
.btn-logout {
  background: transparent; border: 1px solid rgba(255,255,255,.35); color: var(--on-dark);
  padding: .45rem 1rem; border-radius: 999px; cursor: pointer; font-family: var(--font-body); font-size: .85rem;
  transition: var(--ease);
}
.btn-logout:hover { background: rgba(255,255,255,.12); }

/* ----- Layout: sidebar (desktop) + conteúdo ----- */
.painel-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  align-items: start;
  min-height: calc(100vh - 64px);
}

.painel-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.6rem 1.2rem;
  position: sticky; top: 0;
  min-height: calc(100vh - 64px);
}
.sidebar-title {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: .2rem .4rem 1rem;
}
.painel-nav { display: flex; flex-direction: column; gap: .45rem; }

.nav-item {
  display: flex; align-items: flex-start; gap: .85rem;
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  padding: .85rem 1rem; transition: var(--ease); font-family: var(--font-body);
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--surface-2); border-color: rgba(28,116,187,.35); }
.nav-item .ni-icon { font-size: 1.25rem; line-height: 1.3; flex-shrink: 0; }
.ni-text { display: flex; flex-direction: column; gap: .15rem; }
.ni-title { font-weight: 600; color: var(--text); font-size: .98rem; }
.ni-desc { font-size: .78rem; color: var(--text-soft); line-height: 1.35; }

/* ----- Área de conteúdo ----- */
.painel-content { padding: clamp(1.6rem, 4vw, 3rem); }
.content-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.content-icon { font-size: 1.8rem; }
.content-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.content-desc { color: var(--text-soft); max-width: 560px; margin-bottom: 1.8rem; }

.content-soon {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 14px;
  padding: 1.3rem 1.5rem; max-width: 560px;
}
.content-soon p { font-size: .9rem; color: var(--text-soft); }
.soon-badge {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: .3rem .8rem; border-radius: 999px; color: #fff; background: var(--accent-2); white-space: nowrap;
}

/* ----- Métricas do dashboard ----- */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; max-width: 760px; }
.metric-card {
  background: var(--surface); border-radius: 16px; padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow); border-top: 3px solid var(--accent-2);
}
.metric-card .m-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.metric-card .m-value { font-family: var(--font-display); font-size: 2.2rem; color: var(--text); margin-top: .3rem; }
.metric-card .m-sub { font-size: .8rem; color: var(--accent); margin-top: .2rem; }

/* ----- Tabelas (usuários, pedidos) ----- */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; max-width: 820px; }
.data-table th, .data-table td { text-align: left; padding: .8rem .9rem; border-bottom: 1px solid var(--border); }
.data-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.data-table select {
  font-family: var(--font-body); font-size: .85rem; padding: .4rem .6rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--accent); }
.pill.ok { background: #e6f7ed; color: #1c7a45; }
.pill.off { background: #fdecec; color: #a3343a; }

/* ----- Cardápio (lista) ----- */
.menu-list { display: grid; gap: .8rem; max-width: 720px; }
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem;
}
.menu-row .mr-info h4 { font-size: 1rem; color: var(--text); }
.menu-row .mr-info p { font-size: .82rem; color: var(--text-soft); }
.menu-row .mr-price { font-family: var(--font-display); font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ----- Formulário de perfil/reserva ----- */
.panel-form { display: grid; gap: 1rem; max-width: 440px; }
.panel-form label { display: grid; gap: .35rem; font-size: .82rem; font-weight: 500; color: var(--text-soft); }
.panel-form input, .panel-form textarea {
  font-family: var(--font-body); font-size: .95rem; padding: .7rem .9rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); transition: var(--ease);
}
.panel-form input:focus, .panel-form textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(27,158,224,.2); }
.panel-msg { font-size: .85rem; color: var(--accent); min-height: 1.2em; }

/* ----- Toolbar (botão Adicionar acima da tabela) ----- */
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 1rem; max-width: 900px; }
.toolbar .btn { padding: .6rem 1.4rem; }

/* ----- Tabela com colunas redimensionáveis (rolagem) + cabeçalho fixo ----- */
.table-wrap { overflow: auto; max-width: 100%; max-height: calc(100vh - 230px); }
.data-table thead th { position: sticky; top: 0; z-index: 3; background: var(--bg); }
.data-table input, .data-table select {
  font-family: var(--font-body); font-size: .85rem; padding: .5rem .6rem; width: 100%;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); transition: var(--ease);
}
.data-table input:focus, .data-table select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(27,158,224,.18); }
.data-table tr.editing td { vertical-align: top; padding-top: .55rem; padding-bottom: .55rem; }
.data-table .stack { display: grid; gap: .4rem; }
.data-table td.act-cell { white-space: nowrap; text-align: right; }
/* divisória visível entre colunas */
.data-table th, .data-table td { border-right: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; }
.data-table th:last-child, .data-table td:last-child { border-right: none; }

/* foto do item no painel */
.thumb-cell { width: 60px; }
.row-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: block; }
.file-mini { font-size: .72rem; width: 100%; }
.file-mini::file-selector-button {
  font-family: var(--font-body); font-size: .72rem; padding: .25rem .5rem; margin-right: .4rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text-soft);
}

/* Destaque + avaliação no cardápio (painel) */
.dest-cell { white-space: nowrap; }
.star-toggle { background: none; border: 0; cursor: pointer; font-size: 1.35rem; line-height: 1; padding: 0; color: #c7d0dd; transition: var(--ease); }
.star-toggle.on { color: #f5b301; }
.star-toggle:hover { transform: scale(1.15); }
.dest-nota { display: block; font-size: .74rem; color: var(--text-soft); margin-top: .15rem; }
.dest-edit { display: grid; gap: .4rem; min-width: 140px; }
.mini-check { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-soft); }
.data-table .mini-check input { width: auto; }
.data-table input.nota-input { width: 72px; }
.pos-cell { text-align: center; }
.data-table input.pos-input { width: 60px; text-align: center; font-weight: 600; }

/* Editor da foto "Sobre" */
.about-editor { margin-bottom: 2rem; }
.about-row { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.about-preview {
  width: 130px; aspect-ratio: 4/5; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2) center/cover no-repeat; flex-shrink: 0;
}

/* Galeria no painel */
.gal-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.1rem; max-width: 860px; }
.gal-card { border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.gal-img-wrap { position: relative; }
.gal-img-wrap img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.gal-card.broken .gal-img-wrap { aspect-ratio: 1/1; display: grid; place-items: center; background: var(--surface-2); }
.gal-card.broken .gal-img-wrap img { display: none; }
.gal-card.broken .gal-img-wrap::after { content: '⚠'; font-size: 1.6rem; color: var(--text-soft); }
/* barra inferior: número de ordem à esquerda, lixeira à direita */
.gal-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .65rem; }
.gal-ord { display: flex; align-items: center; gap: .35rem; }
.gal-hash { color: var(--text-soft); font-weight: 700; font-size: .9rem; }
.gal-bar .pos-input { width: 58px; }
.gal-del {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
  border: 1px solid var(--border); background: transparent; color: #c0392b;
  display: grid; place-items: center; transition: var(--ease);
}
.gal-del svg { width: 16px; height: 16px; }
.gal-del:hover { background: #fdecec; border-color: #f0bcbc; }

/* ----- Botões de ícone (editar / lixeira / salvar / cancelar) ----- */
.icon-act {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; margin-left: .35rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  display: inline-grid; place-items: center; vertical-align: middle; transition: var(--ease);
}
.icon-act svg { width: 16px; height: 16px; }
.icon-act:hover { background: var(--surface-2); color: var(--accent); border-color: var(--accent-2); }
.icon-act.trash:hover { background: #fdecec; color: #a3343a; border-color: #f0bcbc; }
.icon-act.save { color: #1c7a45; border-color: #bfe3cc; }
.icon-act.save:hover { background: #e6f7ed; }
.icon-act.key:hover { color: var(--accent-2); border-color: var(--accent-2); }
.act-cell .you { margin-left: .4rem; }

/* Alça de redimensionamento de coluna — mostra um "|" visível */
.data-table th { position: relative; }
.col-resizer {
  position: absolute; top: 50%; right: -1px; transform: translateY(-50%);
  width: 12px; height: 62%; display: flex; align-items: center; justify-content: center;
  cursor: col-resize; user-select: none; z-index: 2;
}
.col-resizer::before {
  content: ""; width: 2px; height: 100%; background: var(--border); border-radius: 2px; transition: background .15s, height .15s;
}
.col-resizer:hover::before, .col-resizer:active::before { background: var(--accent); height: 90%; }

/* Subtítulo dentro do conteúdo (ex.: trocar senha) */
.panel-subhead {
  margin: 2.4rem 0 1rem; font-size: 1.15rem; color: var(--text);
  padding-top: 1.6rem; border-top: 1px solid var(--border); max-width: 440px;
}

/* ----- Mobile: sidebar vira cards ----- */
@media (max-width: 860px) {
  .painel-layout { grid-template-columns: 1fr; min-height: 0; }
  .painel-sidebar {
    position: static; min-height: 0; border-right: none; border-bottom: 1px solid var(--border);
    padding: clamp(1.4rem, 5vw, 2rem) var(--pad);
  }
  .painel-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
  .nav-item {
    flex-direction: column; gap: .5rem; border-radius: 16px; padding: 1.5rem;
    box-shadow: var(--shadow); border-top: 3px solid var(--accent-2); background: var(--surface);
  }
  .nav-item:hover { transform: translateY(-3px); }
  .nav-item.active { border-color: transparent; border-top-color: var(--accent); }
  .nav-item .ni-icon { font-size: 1.6rem; }
  .painel-content { padding: clamp(1.6rem, 6vw, 2.2rem) var(--pad); }
  .data-table { font-size: .82rem; }
  .table-wrap { max-height: none; }
  .toolbar { max-width: none; }
  .painel-user { font-size: .82rem; gap: .5rem; }
}
