/* ═══════════════════════════════════════════════════
   HELPDEZ — stylesheet
   Público + Admin
═══════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  /* Dozo brand */
  --primary:   #048e81;
  --primary-d: #037269;
  --primary-2: #05a396;
  --primary-l: #e6f7f5;
  --accent:    #e1fd36;
  --accent-d:  #c8e020;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --success:   #22c55e;
  --info:      #3b82f6;

  /* public (light) */
  --pub-bg:    #f1f5f9;
  --pub-card:  #ffffff;
  --pub-txt:   #0d1b1a;
  --pub-txt2:  #3d5250;
  --pub-txt3:  #7a9492;
  --pub-border:#d4e0df;

  /* admin (light) — sidebar usa paleta Dozo escura */
  --adm-sidebar:   #0d1b1a;
  --adm-sidebar-h: #122322;
  --adm-bg:        #f0f5f4;
  --adm-card:      #ffffff;
  --adm-txt:       #0d1b1a;
  --adm-txt2:      #3d5250;
  --adm-txt3:      #7a9492;
  --adm-border:    #d4e0df;
  --adm-topbar:    #ffffff;

  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
}

/* ── Dark mode — paleta Dozo escura ── */
[data-theme="dark"] {
  --pub-bg:    #0d1b1a;
  --pub-card:  #122322;
  --pub-txt:   #edf2f7;
  --pub-txt2:  #8b95a8;
  --pub-txt3:  #525d72;
  --pub-border:#1c3432;

  --adm-sidebar:   #071211;
  --adm-sidebar-h: #0d1b1a;
  --adm-bg:        #0d1b1a;
  --adm-card:      #122322;
  --adm-txt:       #edf2f7;
  --adm-txt2:      #8b95a8;
  --adm-txt3:      #525d72;
  --adm-border:    #1c3432;
  --adm-topbar:    #122322;

  --shadow:    0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════════════════
   PUBLIC PAGES
══════════════════════════════════════════════════ */
.public-body { background: var(--pub-bg); color: var(--pub-txt); min-height: 100vh; display: flex; flex-direction: column; }
.pub-footer { margin-top: auto; }

/* Container */
.container, .pub-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Header */
.pub-header { background: var(--primary); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.pub-header-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 20px; }
.pub-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 20px; font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.pub-logo-icon { width: 32px; height: 32px; background: rgba(255,255,255,.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pub-search { flex: 1; max-width: 480px; position: relative; display: flex; }
.pub-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.6); font-size: 14px; pointer-events: none; }
.pub-search input { width: 100%; padding: 8px 44px 8px 36px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); border-radius: 8px; color: #fff; font-size: 14px; outline: none; transition: background .2s; }
.pub-search input::placeholder { color: rgba(255,255,255,.6); }
.pub-search input:focus { background: rgba(255,255,255,.25); }

/* Header actions / user menu */
.pub-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pub-user-menu { position: relative; }
.pub-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; padding: 6px 10px; color: #fff; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: background .2s;
}
.pub-user-btn:hover { background: rgba(255,255,255,.25); }
.pub-user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.3); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.pub-user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-user-chevron { font-size: 10px; transition: transform .2s; }
.pub-user-menu.open .pub-user-chevron { transform: rotate(180deg); }
.pub-user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--pub-card); border: 1px solid var(--pub-border);
  border-radius: 12px; box-shadow: var(--shadow-md);
  min-width: 200px; z-index: 300;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .18s, transform .18s;
}
.pub-user-menu.open .pub-user-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.pub-user-info { padding: 12px 16px; }
.pub-user-info-name { font-size: 13px; font-weight: 700; color: var(--pub-txt); }
.pub-user-info-role { font-size: 12px; color: var(--pub-txt3); margin-top: 2px; }
.pub-dropdown-divider { height: 1px; background: var(--pub-border); margin: 4px 0; }
.pub-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--pub-txt2); cursor: pointer; width: 100%;
  background: none; border: none; text-align: left;
  transition: background .15s, color .15s;
}
.pub-dropdown-item:hover { background: var(--pub-bg); color: var(--pub-txt); }
.pub-dropdown-item:last-child { border-radius: 0 0 12px 12px; }
.pub-dropdown-item:first-of-type { border-radius: 0; }
.pub-dropdown-danger { color: var(--danger) !important; }
.pub-dropdown-danger:hover { background: rgba(239,68,68,.08) !important; }

/* Hero */
.pub-hero { background: linear-gradient(135deg, var(--primary) 0%, #00665e 50%, #0d1b1a 100%); padding: 64px 24px; text-align: center; color: #fff; }
.pub-hero h1 { font-size: clamp(24px, 4vw, 40px); font-weight: 800; margin-bottom: 8px; }
.pub-hero p { font-size: 16px; opacity: .85; margin-bottom: 28px; }
.pub-search.pub-hero-search { max-width: 540px; margin: 0 auto; display: flex; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.25); }
.pub-search.pub-hero-search input { border-radius: 0; border: none; background: #fff; color: var(--pub-txt); padding: 14px 16px; font-size: 15px; flex: 1; }
.pub-search.pub-hero-search input::placeholder { color: var(--pub-txt3); }
.pub-search.pub-hero-search button { background: var(--accent); color: #0d1b1a; border: none; padding: 0 20px; font-size: 16px; cursor: pointer; font-weight: 700; transition: background .15s; }
.pub-search.pub-hero-search button:hover { background: var(--accent-d); }

/* Section */
.pub-section { padding: 48px 0; }
.section-title { font-size: 20px; font-weight: 700; color: var(--pub-txt); margin-bottom: 24px; }
.empty-msg { color: var(--pub-txt3); padding: 40px 0; text-align: center; font-size: 15px; }
.btn-link { color: var(--primary); font-size: 14px; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cat-card {
  background: var(--pub-card); border: 1px solid var(--pub-border);
  border-radius: var(--radius); padding: 24px 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .2s, transform .15s; color: var(--pub-txt);
}
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: color-mix(in srgb, var(--cat-color, var(--primary)) 15%, transparent); color: var(--cat-color, var(--primary)); margin-bottom: 4px; }
.cat-name { font-size: 15px; font-weight: 700; color: var(--pub-txt); }
.cat-count { font-size: 12px; color: var(--pub-txt3); }
.cat-desc { font-size: 13px; color: var(--pub-txt2); line-height: 1.5; }

/* Article list */
.article-list { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.article-item { background: var(--pub-card); border: 1px solid var(--pub-border); border-radius: var(--radius); transition: box-shadow .2s, border-color .2s; }
.article-item:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.article-item a { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 16px; }
.article-title { font-size: 15px; font-weight: 600; color: var(--pub-txt); flex: 1; }
.article-item:hover .article-title { color: var(--primary); }
.article-meta, .article-cat { font-size: 12px; color: var(--pub-txt3); white-space: nowrap; flex-shrink: 0; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--pub-txt3); padding: 20px 0 16px; }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--pub-txt3); }

/* Category page header */
.pub-cat-header { background: linear-gradient(135deg, var(--cat-color, var(--primary)) 0%, #0d1b1a 100%); padding: 40px 24px; color: #fff; }
.pub-cat-header .container { display: flex; align-items: center; gap: 20px; }
.pub-cat-icon { width: 56px; height: 56px; background: rgba(255,255,255,.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.pub-cat-header h1 { font-size: clamp(20px, 3vw, 28px); font-weight: 800; margin-bottom: 4px; }
.pub-cat-header p { font-size: 14px; opacity: .85; }
.pub-cat-layout { max-width: 760px; }

/* Article page */
.article-layout { display: grid; grid-template-columns: 1fr 260px; gap: 40px; padding: 32px 0 64px; align-items: start; }
.article-main { min-width: 0; }
.article-heading { font-size: clamp(22px, 3vw, 32px); font-weight: 800; color: var(--pub-txt); margin: 16px 0 12px; }
.article-meta-bar { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--pub-txt3); padding-bottom: 20px; border-bottom: 1px solid var(--pub-border); margin-bottom: 28px; }
.article-meta-bar i { margin-right: 5px; color: var(--primary); }

/* Article sidebar */
.article-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }
.article-cat-card { background: var(--pub-card); border: 1px solid var(--pub-border); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.article-cat-card .cat-icon { margin-bottom: 0; width: 38px; height: 38px; font-size: 18px; }
.article-cat-card a { font-size: 14px; font-weight: 600; color: var(--pub-txt); }
.article-cat-card a:hover { color: var(--primary); }
.related-box { background: var(--pub-card); border: 1px solid var(--pub-border); border-radius: var(--radius); padding: 20px; }
.related-box h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pub-txt3); margin-bottom: 14px; }
.related-box ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.related-box li a { font-size: 13px; color: var(--pub-txt2); padding: 6px 10px; border-radius: 6px; display: block; transition: background .15s, color .15s; }
.related-box li a:hover { background: var(--primary-l); color: var(--primary); font-weight: 600; }

/* Article body (Quill content) */
.article-body { font-size: 15px; color: var(--pub-txt); line-height: 1.8; }
.article-body h1,.article-body h2,.article-body h3 { margin: 28px 0 12px; font-weight: 700; color: var(--pub-txt); }
.article-body h1 { font-size: 26px; }
.article-body h2 { font-size: 22px; }
.article-body h3 { font-size: 18px; }
.article-body p { margin-bottom: 16px; }
.article-body ul,.article-body ol { margin: 0 0 16px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote { border-left: 4px solid var(--primary); padding: 12px 16px; background: var(--primary-l); border-radius: 0 6px 6px 0; margin: 20px 0; color: var(--pub-txt2); }
.article-body pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; margin: 20px 0; }
.article-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #be185d; }
.article-body pre code { background: none; color: inherit; padding: 0; }
.article-body img { border-radius: 8px; margin: 16px 0; max-width: 100%; }
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.article-body th { background: var(--primary); color: #fff; text-align: left; padding: 10px 14px; font-size: 13px; }
.article-body td { padding: 10px 14px; border-bottom: 1px solid var(--pub-border); font-size: 14px; }
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:nth-child(even) td { background: var(--pub-bg); }
.article-body .ql-video { width: 100%; aspect-ratio: 16/9; border-radius: 8px; margin: 20px 0; }
.article-body a { color: var(--primary); text-decoration: underline; }

/* Footer */
.pub-footer { background: var(--pub-card); border-top: 1px solid var(--pub-border); padding: 24px; text-align: center; font-size: 13px; color: var(--pub-txt3); }

/* ══════════════════════════════════════════════════
   ADMIN PAGES
══════════════════════════════════════════════════ */
.admin-body { background: var(--adm-bg); color: var(--adm-txt); }

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

/* Sidebar */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--adm-sidebar); color: #cbd5e1;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 200;
  transition: transform .25s;
}
.sidebar-logo { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-logo a { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: #fff; }
.sidebar-logo-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.sidebar-nav { flex: 1; padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #475569; padding: 14px 8px 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: #94a3b8; transition: background .15s, color .15s;
}
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #e2e8f0; }
.sidebar-link.active { background: var(--primary); color: #fff; }
.sidebar-link.active i { color: var(--accent); }
.sidebar-link i { width: 16px; text-align: center; }
.sidebar-user { padding: 16px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.sidebar-user-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: #64748b; }
.sidebar-logout { color: #64748b; padding: 6px; border-radius: 6px; transition: color .15s; }
.sidebar-logout:hover { color: var(--danger); }

/* Main */
.admin-main { flex: 1; margin-left: 240px; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  background: var(--adm-topbar); border-bottom: 1px solid var(--adm-border);
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.admin-page-title { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.sidebar-toggle { display: none; background: none; border: none; color: var(--adm-txt2); padding: 6px; }
.theme-toggle { background: none; border: 1px solid var(--adm-border); border-radius: 8px; color: var(--adm-txt2); padding: 7px 10px; font-size: 15px; transition: background .15s, color .15s; }
.theme-toggle:hover { background: var(--adm-bg); color: var(--adm-txt); }
.admin-content { padding: 28px; flex: 1; }

/* Cards / Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: var(--radius); padding: 20px; }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--adm-txt2); }

/* Bulk action bar */
.bulk-bar {
  display: none; align-items: center; gap: 12px;
  background: var(--primary); color: #fff;
  padding: 10px 20px; border-radius: var(--radius);
  margin-bottom: 12px; font-size: 14px; font-weight: 500;
}
.bulk-bar.active { display: flex; }
.bulk-bar-count { flex: 1; }
.bulk-bar .btn-bulk-delete {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: 7px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 7px; transition: background .15s;
}
.bulk-bar .btn-bulk-delete:hover { background: rgba(239,68,68,.7); border-color: transparent; }

/* Checkbox column */
.th-check, .td-check { width: 44px; padding: 0 0 0 16px !important; }
input[type="checkbox"].row-check, input[type="checkbox"]#checkAll {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);
}

/* Table */
.card { background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: var(--radius); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--adm-border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th { background: #f8fafc; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--adm-txt3); padding: 10px 16px; text-align: left; white-space: nowrap; }
table.data-table td { padding: 12px 16px; border-top: 1px solid var(--adm-border); font-size: 14px; vertical-align: middle; }
table.data-table tr:hover td { background: #f8fafc; }
.td-actions { display: flex; gap: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; border: none; transition: all .15s; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost   { background: transparent; color: var(--adm-txt2); border: 1px solid var(--adm-border); }
.btn-ghost:hover { background: var(--adm-bg); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: 7px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--adm-txt2); }
.form-control {
  padding: 10px 14px; border: 1px solid var(--adm-border); border-radius: 8px;
  font-size: 14px; color: var(--adm-txt); background: var(--adm-card);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(4,142,129,.1); }
.form-control-sm { padding: 7px 11px; font-size: 13px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--adm-txt3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Quill editor */
.quill-wrap { border: 1px solid var(--adm-border); border-radius: 8px; overflow: hidden; }
.quill-wrap .ql-toolbar { border: none; border-bottom: 1px solid var(--adm-border); background: #f8fafc; }
.quill-wrap .ql-container { border: none; font-family: 'Inter', sans-serif; font-size: 14px; }
.quill-wrap .ql-editor { min-height: 260px; background: #fff; color: #0f172a; }
[data-theme="dark"] .quill-wrap .ql-toolbar { background: #1e293b; border-bottom-color: #334155; }
[data-theme="dark"] .quill-wrap .ql-toolbar button, [data-theme="dark"] .quill-wrap .ql-toolbar .ql-stroke { stroke: #94a3b8; }
[data-theme="dark"] .quill-wrap .ql-toolbar .ql-fill { fill: #94a3b8; }
[data-theme="dark"] .quill-wrap { border-color: #334155; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--adm-card); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.2); transform: translateY(16px); transition: transform .2s; max-height: 90vh; overflow-y: auto; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-overlay.modal-lg .modal { max-width: 800px; }
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--adm-txt3); font-size: 20px; padding: 4px; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-admin  { background: rgba(239,68,68,.1);  color: #ef4444; }
.badge-editor { background: rgba(59,130,246,.1); color: #3b82f6; }
.badge-viewer { background: rgba(100,116,139,.1);color: #64748b; }
.badge-publicado { background: rgba(34,197,94,.1); color: #16a34a; }
.badge-rascunho  { background: rgba(245,158,11,.1);color: #d97706; }

/* Alerts */
.alert { padding: 12px 20px; border-radius: 8px; font-size: 14px; margin: 0 28px 0; }
.alert-success { background: rgba(34,197,94,.1); color: #16a34a; border: 1px solid rgba(34,197,94,.2); }
.alert-error   { background: rgba(239,68,68,.1); color: #dc2626; border: 1px solid rgba(239,68,68,.2); }
.alert-info    { background: rgba(59,130,246,.1); color: #2563eb; border: 1px solid rgba(59,130,246,.2); }

/* Filters bar */
.filters-bar, .filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters-bar input, .filters-bar select,
.filter-bar input, .filter-bar select { min-width: 160px; }

/* Admin login */
.login-body { background: linear-gradient(135deg, #0d1b1a 0%, #00665e 50%, #0d1b1a 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #122322; border: 1px solid #1c3432; border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 400px; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.login-logo-icon { width: 40px; height: 40px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.login-logo span { font-size: 22px; font-weight: 800; color: #fff; }
.login-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.login-sub { font-size: 14px; color: #64748b; margin-bottom: 28px; }
.login-card .form-control { background: rgba(255,255,255,.06); border-color: #1c3432; color: #edf2f7; }
.login-card .form-control:focus { border-color: var(--primary); background: rgba(255,255,255,.09); }
.login-card label { color: #8b95a8; }
.login-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* Color picker row */
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-opt { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: border-color .15s; }
.color-opt.selected, .color-opt:hover { border-color: var(--adm-txt); }

/* Icon picker */
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; max-height: 200px; overflow-y: auto; }
.icon-opt { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: all .15s; font-size: 16px; color: var(--adm-txt2); }
.icon-opt:hover { background: var(--primary-l); color: var(--primary); }
.icon-opt.selected { border-color: var(--primary); background: var(--primary-l); color: var(--primary); }

/* Quill editor container */
.ql-container.ql-snow { border-radius: 0 0 8px 8px; font-size: 15px; min-height: 360px; }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; background: #f8fafc; }
.editor-wrap { border-radius: 8px; overflow: hidden; }

/* Responsive */
@media (max-width: 900px) {
  /* admin */
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  /* public */
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; display: flex; flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .article-cat-card, .related-box { flex: 1; min-width: 200px; }
  .pub-cat-header .container { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 640px) {
  /* admin */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 16px; }
  .filters-bar, .filter-bar { flex-direction: column; align-items: stretch; }
  /* public */
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .pub-header-inner { gap: 12px; }
  .pub-search { display: none; }
  .article-meta-bar { gap: 12px; }
}
@media (max-width: 420px) {
  .cat-grid { grid-template-columns: 1fr; }
}
