/* ─── Backoffice Custom CSS ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary:    #0048E8;
  --secondary:  #FC4D16;
  --accent:     #8EEC8F;
  --black:      #000;
  --bg:         #F5F4EC;
  --bg-dark:    #0A0A0A;
  --surface:    #FFFFFF;
  --border:     rgba(0,0,0,.1);
  --text:       #111;
  --text-muted: #777;
  --radius:     10px;
  --radius-lg:  16px;
  --sidebar-w:  240px;
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.bo-layout { display: flex; min-height: 100vh; }

.bo-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}
.bo-sidebar-brand {
  padding: 1.5rem 1.4rem;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.bo-sidebar-brand span { color: var(--primary); }
.bo-sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  list-style: none;
}
.bo-sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem 1.4rem;
  font-size: .88rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  transition: color var(--transition), background var(--transition);
  border-left: 3px solid transparent;
}
.bo-sidebar-nav li a:hover,
.bo-sidebar-nav li a.active {
  color: #fff;
  background: rgba(255,255,255,.06);
  border-left-color: var(--primary);
}
.bo-sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .8rem;
  color: rgba(255,255,255,.3);
}
.bo-sidebar-footer a {
  color: var(--secondary);
  font-weight: 600;
}

/* Mobile sidebar */
.bo-sidebar { transform: translateX(-100%); }
.bo-sidebar.open { transform: translateX(0); }
@media (min-width: 900px) {
  .bo-sidebar { transform: translateX(0); }
}

.bo-main {
  flex: 1;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@media (min-width: 900px) {
  .bo-main { margin-left: var(--sidebar-w); }
}

.bo-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.bo-menu-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  cursor: pointer;
}
.bo-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
@media (min-width: 900px) { .bo-menu-btn { display: none; } }

.bo-topbar-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.bo-topbar-user {
  font-size: .82rem;
  color: var(--text-muted);
}

.bo-content { padding: 1.5rem; flex: 1; }
@media (min-width: 768px) { .bo-content { padding: 2rem 2.5rem; } }

/* Sidebar overlay on mobile */
.bo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.bo-overlay.active { display: block; }

/* ── Page header ───────────────────────────────────────────────────────────── */
.bo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.bo-page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.bo-breadcrumb {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.bo-breadcrumb a { color: var(--primary); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.bo-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.3rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  border: none;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  white-space: nowrap;
  min-height: 40px;
}
.bo-btn:active { transform: scale(.97); }
.bo-btn-primary { background: var(--primary); color: #fff; }
.bo-btn-primary:hover { opacity: .88; box-shadow: 0 4px 16px rgba(0,72,232,.3); }
.bo-btn-danger  { background: var(--secondary); color: #fff; }
.bo-btn-danger:hover  { opacity: .88; }
.bo-btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.bo-btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.bo-btn-sm { padding: .45rem .9rem; font-size: .78rem; min-height: 32px; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.bo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.bo-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
.bo-table-wrap { overflow-x: auto; }
.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.bo-table th {
  text-align: left;
  padding: .7rem 1rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.bo-table td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.bo-table tr:last-child td { border-bottom: none; }
.bo-table tr:hover td { background: rgba(0,0,0,.02); }
.bo-table .actions { display: flex; gap: .5rem; align-items: center; }

/* ── Form ──────────────────────────────────────────────────────────────────── */
.bo-form { display: flex; flex-direction: column; gap: 1.2rem; }
.bo-form-group { display: flex; flex-direction: column; gap: .4rem; }
.bo-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bo-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
  -webkit-appearance: none;
}
.bo-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,72,232,.1);
  background: #fff;
}
textarea.bo-input { resize: vertical; min-height: 140px; }
.bo-file-input {
  font-size: .88rem;
  color: var(--text-muted);
}

/* ── Image Grid ────────────────────────────────────────────────────────────── */
.bo-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
@media (min-width: 600px) {
  .bo-image-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
.bo-image-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.bo-image-item img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.bo-image-item-body {
  padding: .6rem .8rem;
  font-size: .78rem;
  color: var(--text-muted);
}
.bo-image-item-actions {
  padding: .4rem .8rem .7rem;
  display: flex;
  gap: .5rem;
}

/* ── Alerts / Messages ─────────────────────────────────────────────────────── */
.bo-messages { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.bo-alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  border-left: 4px solid;
}
.bo-alert-success { background: rgba(142,236,143,.15); border-color: var(--accent); color: #1a6b1a; }
.bo-alert-error   { background: rgba(252,77,22,.1);   border-color: var(--secondary); color: #8b2200; }
.bo-alert-info    { background: rgba(0,72,232,.08);   border-color: var(--primary); color: #003080; }

/* ── Confirm Delete ────────────────────────────────────────────────────────── */
.bo-confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  text-align: center;
}
.bo-confirm-box h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: .8rem; }
.bo-confirm-box p  { color: var(--text-muted); font-size: .92rem; margin-bottom: 1.5rem; line-height: 1.6; }
.bo-confirm-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ── Login ─────────────────────────────────────────────────────────────────── */
.bo-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  padding: 1.5rem;
}
.bo-login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
@media (min-width: 480px) {
  .bo-login-card { padding: 3rem 2.5rem; }
}
.bo-login-brand {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: .5rem;
}
.bo-login-brand span { color: var(--primary); }
.bo-login-sub {
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.bo-login-form { display: flex; flex-direction: column; gap: 1rem; }
.bo-login-submit {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .9rem;
  font-size: 1rem;
  font-weight: 700;
  width: 100%;
  min-height: 48px;
  cursor: pointer;
  transition: opacity var(--transition), box-shadow var(--transition);
}
.bo-login-submit:hover {
  opacity: .88;
  box-shadow: 0 6px 20px rgba(0,72,232,.35);
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.bo-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: .95rem;
}
.bo-empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .4; }

/* ── Badge ─────────────────────────────────────────────────────────────────── */
.bo-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(0,72,232,.1);
  color: var(--primary);
}

/* ── Thumbnail ─────────────────────────────────────────────────────────────── */
.bo-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}
.bo-thumb-placeholder {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 6px;
  font-size: 1.2rem;
  color: var(--text-muted);
}
