/* IGC Admin — design system preto e branco minimalista */
:root {
  --ink: #0a0a0a;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --muted-2: #9a9a9a;
  --line: #e6e6e6;
  --line-2: #f0f0f0;
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --bg-hover: #f4f4f4;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --success: #1f7a3d;
  --success-bg: #eaf7ee;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px -12px rgba(0,0,0,.10);
  --ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff);
  color: var(--ink);
  background: var(--bg-alt);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* Layout shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: 0 0 auto;
  background: var(--ink); color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 20;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand img { height: 30px; width: auto; filter: brightness(0) invert(1); }
.sidebar-brand b { font-size: 13px; font-weight: 600; letter-spacing: .01em; line-height: 1.25; }
.sidebar-brand small { display: block; font-size: 10.5px; color: rgba(255,255,255,.55); font-weight: 400; margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: rgba(255,255,255,.72); font-size: 13.5px; font-weight: 500;
  transition: .15s;
}
.sidebar-nav a svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: #fff; color: var(--ink); }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-foot { padding: 14px 20px 20px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user { font-size: 12.5px; color: rgba(255,255,255,.6); margin-bottom: 10px; }
.sidebar-user b { color: #fff; display: block; font-size: 13px; }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: rgba(255,255,255,.6);
  border: 0; padding: 0; background: transparent; font: inherit; cursor: pointer;
}
.sidebar-logout:hover { color: #fff; }
.sidebar-logout svg { width: 15px; height: 15px; }

.main { flex: 1; margin-left: 240px; min-width: 0; }
.topbar {
  height: 64px; border-bottom: 1px solid var(--line);
  background: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.content { padding: 30px; max-width: 1180px; }

/* Cards / tabelas */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.card-title { font-size: 14.5px; font-weight: 700; margin: 0 0 4px; }
.card-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: var(--bg-hover); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer;
  transition: .15s; line-height: 1;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: #2a2a2a; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); background: var(--bg-hover); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f0d2ce; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--bg-hover); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; }
.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 13.5px; font-family: var(--ff); color: var(--ink);
  background: #fff; transition: .15s;
}
.input:focus, textarea.input:focus, select.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }

/* Badges / pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.pill-gray { background: var(--bg-hover); color: var(--muted); }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; display: flex; align-items: center; gap: 9px; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* Empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; margin: 0 auto 12px; opacity: .3; }
.empty p { margin: 0; font-size: 13px; }

/* Accordion (documentos por categoria) */
.doc-cat { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; background: #fff; }
.doc-cat-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; }
.doc-cat-head:hover { background: var(--bg-hover); }
.doc-cat-head .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-alt); display: grid; place-items: center; flex: 0 0 auto; }
.doc-cat-head .ic svg { width: 16px; height: 16px; }
.doc-cat-head .title { flex: 1; font-weight: 600; font-size: 13.5px; }
.doc-cat-head .title small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.doc-cat-head .count { font-size: 11px; color: var(--muted); background: var(--bg-hover); padding: 3px 9px; border-radius: 100px; }
.doc-cat-head .chev { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted-2); transition: .2s; }
.doc-cat-head svg { flex: 0 0 auto; }
.doc-cat-body { border-top: 1px solid var(--line); padding: 14px 18px; display: none; }
.doc-cat-body.open { display: block; }
.doc-row-admin { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.doc-row-admin:last-child { border-bottom: 0; }
.doc-row-admin .name { flex: 1; font-size: 13px; font-weight: 500; }
.doc-row-admin .name small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.doc-row-admin .actions { display: flex; gap: 6px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 18px; padding: 38px 34px; }
.login-card img { height: 40px; margin: 0 auto 22px; }
.login-card h1 { font-size: 16px; text-align: center; margin: 0 0 26px; font-weight: 700; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-error { background: var(--danger-bg); color: var(--danger); font-size: 12.5px; padding: 10px 12px; border-radius: 9px; margin-bottom: 16px; }

/* Cropper modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-scrim.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal-box-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-box-head h3 { margin: 0; font-size: 14.5px; }
.modal-box-body { padding: 20px 22px; }
.modal-box-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.crop-area { max-height: 400px; overflow: hidden; background: #111; border-radius: 10px; }
.crop-area img { display: block; max-width: 100%; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.toolbar h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.toolbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.tabs-strip { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs-strip a { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-strip a:hover { color: var(--ink); }
.tabs-strip a.active { color: var(--ink); border-color: var(--ink); }

.upload-drop {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center;
  cursor: pointer; transition: .15s; background: var(--bg-alt);
}
.upload-drop:hover, .upload-drop.drag { border-color: var(--ink); background: var(--bg-hover); }
.upload-drop svg { width: 24px; height: 24px; margin: 0 auto 8px; color: var(--muted); }
.upload-drop p { margin: 0; font-size: 12.5px; color: var(--muted); }
.upload-drop input[type=file] { display: none; }

.thumb-preview { width: 100%; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover; background: var(--bg-alt); border: 1px solid var(--line); }

@media (max-width: 880px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 18px; }
}
