/* ============================================================
   admin.css — Painel administrativo Lírios do Campo
   ============================================================ */

:root {
  --sb:        #1a2535;
  --sb-hover:  #243044;
  --sb-active: rgba(116,198,157,.15);
  --sb-text:   #94a3b8;
  --sb-accent: #74c69d;
  --primary:   #2d6a4f;
  --success:   #22c55e;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --info:      #3b82f6;
  --bg:        #f1f5f9;
  --white:     #ffffff;
  --text:      #1e2330;
  --muted:     #6b7280;
  --border:    #e2e8f0;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow:    0 4px 16px rgba(0,0,0,.10);
  --radius:    8px;
  --sb-w:      230px;
  --top-h:     60px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
}

/* ── Sidebar ─────────────────────────────────────── */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-w);
  background: var(--sb);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sb-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.2rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}

.sb-brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sb-brand-name {
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sb-brand-sub {
  font-size: .65rem;
  color: var(--sb-text);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.sb-section {
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #475569;
  padding: 1.1rem 1.25rem .4rem;
}

.sb-menu { list-style: none; flex: 1; padding-bottom: 1rem; }

.sb-menu a {
  display: flex; align-items: center; gap: .75rem;
  padding: .62rem 1.25rem;
  color: var(--sb-text);
  text-decoration: none;
  font-size: .87rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s;
}

.sb-menu a:hover,
.sb-menu a.ativo {
  background: var(--sb-hover);
  color: #fff;
  border-left-color: var(--sb-accent);
}

.sb-menu a.ativo { background: var(--sb-active); color: var(--sb-accent); }

.sb-menu a .ico { font-size: 1rem; width: 20px; text-align: center; }

.sb-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .78rem;
  color: #475569;
}

.sb-footer a {
  color: #ef4444;
  text-decoration: none;
  display: flex; align-items: center; gap: .5rem;
  transition: opacity .15s;
}

.sb-footer a:hover { opacity: .8; }

/* ── Main ────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sb-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ────────────────────────────────────── */
.admin-topbar {
  height: var(--top-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 1rem; font-weight: 600; }
.topbar-user  { font-size: .82rem; color: var(--muted); }

/* ── Content ────────────────────────────────────── */
.admin-content { padding: 1.75rem; flex: 1; }

/* ── Page header ────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-title { font-size: 1.25rem; font-weight: 700; }
.page-sub   { font-size: .8rem; color: var(--muted); margin-top: .15rem; }

/* ── Stat cards ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 1rem;
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.green  { background: #dcfce7; }
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.orange { background: #ffedd5; }
.stat-icon.purple { background: #f3e8ff; }

.stat-num  { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label{ font-size: .75rem; color: var(--muted); margin-top: .2rem; }

/* ── Card ────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.card-body { padding: 1.25rem; }

/* ── Table ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

th {
  text-align: left;
  padding: .65rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}

td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafcff; }

.prod-thumb {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #edf7f1;
}

.no-thumb {
  width: 44px; height: 44px;
  border-radius: 6px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

/* ── Badges / tags ──────────────────────────────── */
.tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 999px;
}

.tag-green  { background: #dcfce7; color: #15803d; }
.tag-red    { background: #fee2e2; color: #dc2626; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-blue   { background: #dbeafe; color: #1d4ed8; }
.tag-gray   { background: #f1f5f9; color: #64748b; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity .15s, filter .15s;
  line-height: 1;
}

.btn:hover { opacity: .88; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-info     { background: var(--info);    color: #fff; }
.btn-light    { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-sm       { padding: .32rem .75rem; font-size: .76rem; }
.btn-icon     { padding: .32rem .45rem; }

/* ── Forms ──────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group.full { grid-column: 1/-1; }

label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
}

input[type=text],
input[type=email],
input[type=number],
input[type=password],
input[type=tel],
input[type=url],
input[type=date],
select,
textarea {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .875rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}

textarea { resize: vertical; min-height: 80px; }

.form-check {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem;
  cursor: pointer;
}

.form-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-actions {
  display: flex; gap: .75rem; align-items: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* ── Alert ──────────────────────────────────────── */
.alert {
  padding: .8rem 1.1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Image preview ──────────────────────────────── */
.img-preview {
  width: 100px; height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: .5rem;
  display: block;
}

/* ── Comanda items ──────────────────────────────── */
.comanda-total {
  text-align: right;
  font-size: 1.1rem;
  font-weight: 700;
  padding: .75rem 1rem;
  color: var(--primary);
  border-top: 2px solid var(--border);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .28s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main   { margin-left: 0; }
  .topbar-hamburger {
    display: flex !important;
    align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    font-size: 1.3rem; color: var(--text);
    padding: .3rem;
  }
  .overlay { display: none; position: fixed; inset:0; background:rgba(0,0,0,.4); z-index:99; }
  .overlay.open { display: block; }
}

@media (max-width: 768px) {
  .admin-content { padding: .75rem .5rem; }
  .admin-topbar  { padding: 0 .5rem; }
  .card-body     { padding: .75rem .5rem; }
}

.topbar-hamburger { display: none; }

/* ── Login ───────────────────────────────────────── */
body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 60%, #52b788 100%);
  margin: 0;
}

.login-card {
  background: var(--white);
  border-radius: 14px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo .ico { font-size: 2.5rem; }

.login-logo h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: .4rem;
  color: var(--primary);
}

.login-logo p { font-size: .78rem; color: var(--muted); }

.login-card .form-group { margin-bottom: .9rem; }

.btn-login {
  width: 100%;
  padding: .7rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s;
  margin-top: .5rem;
}

.btn-login:hover { filter: brightness(.9); }

@media (max-width: 768px) {
  .mobile-hide { display: none !important; }
}
