@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* =========================================================================
   ResidenceSystem — Theme Orange (cleaned & consolidated)
   ========================================================================= */

/* ------------------------
   Design tokens (light)
   ------------------------ */
:root{
  --font-sans:"Inter",system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,"Noto Sans","Apple Color Emoji","Segoe UI Emoji";

  /* Surface & text */
  --bg:#f6f7f8;
  --bg-muted:#ebedee;
  --bg-elevated:#ffffff;
  --panel:#ffffff;
  --panel-quiet:#f6f7f8;
  --panel-muted:#ebedee;
  --text:#1f2937;
  --text-strong:#111827;
  --muted:#7d8993;
  --sep:#dbe0e2;        /* generic separator/border */

  /* Brand */
  --brand:#3880e4;
  --brand-2:#67b5f3;
  --brand-3:#c2e1fb;

  /* Pills / badges */
  --pill-bg:color-mix(in srgb, var(--brand) 6%, white);
  --pill-fg:#1a2c51;

  /* State */
  --ok:#16a34a;
  --warn:#f59e0b;
  --err:#dc2626;

  /* Buttons */
  --btn-fg:#1f2937;
  --btn-bg:var(--brand-3);
  --btn-bd:var(--brand-2);
  --brand-contrast:#ffffff;

  /* Accents */
  --orange:var(--brand);
  --orange-weak:color-mix(in srgb, var(--brand) 20%, transparent);
  --orange-fg:#1a2c51;

  /* Inputs */
  --input-bg:#ffffff;
  --input-fg:#111;
  --input-bd:var(--sep);

  /* Effects */
  --shadow-sm:0 2px 8px rgba(15,23,42,0.08);
  --shadow:0 8px 24px rgba(15,23,42,0.12);
  --shadow-lg:0 16px 40px rgba(15,23,42,0.16);

  /* Icon sizing */
  --nav-icon-size:clamp(16px, calc(1.4vw + 12px), 24px);
  --inline-icon-size:56px;
  --card-height:260px;
  --sidebar-collapsed:266px;
  --sidebar-expanded:266px;
  --sidebar-current:var(--sidebar-collapsed, 240px);
  --topbar-height:80px;
}

body.egg-pink{
  --bg:#f7d9ea;
  --bg-muted:#f5d1e6;
  --bg-elevated:#fae5f2;
  --panel:#ffffff;
  --panel-quiet:#fde8f4;
  --panel-muted:#f8dced;
  --brand:#e86aa6;
  --brand-2:#f09bc4;
  --brand-3:#f6cce2;
  --pill-bg:#fce6f2;
  --pill-fg:#8a2f5d;
  --btn-bg:#f6cce2;
  --btn-bd:#f09bc4;
  --orange:var(--brand);
  --orange-weak:color-mix(in srgb, var(--brand) 25%, transparent);
  --orange-fg:#2b1522;
}

html.dark body.egg-pink{
  --bg:#1b1218;
  --bg-muted:#22151f;
  --bg-elevated:#281a24;
  --panel:#1f171d;
  --panel-quiet:#241a21;
  --panel-muted:#261b22;
  --text:#f6e8f1;
  --text-strong:#fff3fa;
  --muted:#d6b6c6;
  --sep:#3a2934;
  --brand:#f09bc4;
  --brand-2:#f6cce2;
  --brand-3:#f4b9d6;
  --pill-bg:#2a1b25;
  --pill-fg:#f4b9d6;
  --btn-bg:#2c1c27;
  --btn-bd:#6b3f57;
  --orange:var(--brand);
  --orange-weak:color-mix(in srgb, var(--brand) 20%, transparent);
  --orange-fg:#fbe6f2;
}

html.sidebar-expanded{
  --sidebar-current:var(--sidebar-expanded, 240px);
}

/* ------------------------
   Design tokens (dark)
   ------------------------ */
html.dark{
  --bg:#323639;
  --bg-muted:#3a3e42;
  --bg-elevated:#4e545a;
  --panel:#3a3e42;
  --panel-quiet:#323639;
  --panel-muted:#3a3e42;
  --text:#ebedee;
  --text-strong:#f6f7f8;
  --muted:#a5b0b5;
  --sep:#4e545a;

  --brand:#67b5f3;
  --brand-2:#98cff8;
  --brand-3:#c2e1fb;

  --pill-bg:#3a3e42;
  --pill-fg:var(--brand-3);

  --btn-fg:#ebedee;
  --btn-bg:#4e545a;
  --btn-bd:#5f656e;

  --orange:var(--brand);
  --orange-weak:color-mix(in srgb, var(--brand) 20%, transparent);
  --orange-fg:#f0f7fe;

  --input-bg:#323639;
  --input-fg:#ebedee;
  --input-bd:var(--sep);

  --shadow-sm:0 2px 10px rgba(0,0,0,0.35);
  --shadow:0 10px 28px rgba(0,0,0,0.4);
  --shadow-lg:0 18px 46px rgba(0,0,0,0.5);
  --brand-contrast:#1a2c51;
}

/* ------------------------
   Reset & base
   ------------------------ */
*{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
body{
  margin:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  color:var(--text);
  font:13.5px/1.5 var(--font-sans);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
h1,h2,h3,h4{margin:0 0 .35em 0;line-height:1.25;font-weight:600;}
h1{font-size:22px;}
h2{font-size:18px;}
h3{font-size:16px;}
h4{font-size:14px;}
p{margin:0 0 .6em 0;font-size:.95rem;line-height:1.45;}
input[type="date"],input[type="datetime-local"],input[type="time"]{font-family:var(--font-sans);letter-spacing:normal;}
.theme-fade-overlay{
  position:fixed;
  inset:0;
  pointer-events:none;
  background:var(--bg);
  opacity:1;
  z-index:4000;
  transition:opacity .4s ease;
}
.page-fade-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:var(--bg);
  opacity:1;
  z-index:3500;
  transition:opacity .22s ease;
}
body.page-fade-ready .page-fade-overlay{opacity:0;}
body.page-fade-out .page-fade-overlay{opacity:1;}
.page-fade-content{transition:opacity .22s ease,transform .22s ease;}
body.page-fade-out .page-fade-content{opacity:0;transform:translateY(6px);}
@media (prefers-reduced-motion: reduce){
  .page-fade-overlay,
  .page-fade-content{transition:none;}
}
a{color:inherit;text-decoration:none}
main.container{
  max-width:1280px;
  width:100%;
  flex:1 0 auto;
  display:flex;
  flex-direction:column;
  position:relative;
  margin:20px auto 0;
  padding:0 20px calc(20px + env(safe-area-inset-bottom, 0px));
  gap:20px;
}

@media (max-width:960px){
  main.container{
    margin-top:16px;
    padding:0 14px calc(16px + env(safe-area-inset-bottom, 0px));
    gap:16px;
  }
}

.inline-icon{
  display:block;
  width:var(--inline-icon-size);
  height:auto;
  max-width:100%;
}

/* ------------------------
   Cards / sections
   ------------------------ */
.card{
  background:var(--panel);
  border:1px solid var(--sep);
  border-radius:12px;
  padding:16px;
  box-shadow:var(--shadow-sm);
  min-height:0;
}
.section{margin:18px 0}

/* ------------------------
   Navbar (sticky)
   ------------------------ */
.navbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; gap:12px;
  padding:4px 18px;
  --nav-h: 50px;
  min-height: var(--nav-h);
  border-bottom:1px solid var(--sep);
  background:var(--panel);
  white-space:nowrap;
}
.brand-group{display:inline-flex;align-items:center;gap:10px;flex:0 0 auto;}
.brand{
  display:inline-flex; align-items:center; gap:8px;
  min-width:40px; color:var(--brand); font-weight:800;
}
.brand-logo{height:var(--nav-h); width:auto; display:block}
.honpar{height:var(--nav-h); width:auto; border-radius:10px;border:1px solid var(--sep);object-fit:contain;background:#fff}

.nav-links{
  display:flex; align-items:center; gap:12px;
  min-width:0; flex:1 1 auto; overflow-x:auto; scrollbar-width:thin;
}
.nav-link{
  padding:8px 10px; border-radius:10px; border:1px solid transparent;
}
.nav-link:hover{background:var(--brand-3); border-color:var(--brand-2)}
html.dark .nav-link:hover{background:var(--orange-weak); border-color:color-mix(in srgb, var(--brand) 40%, var(--sep))}
.nav-link.active{background:var(--pill-bg); border:1px solid var(--brand-2)}

.right-box{display:inline-flex;align-items:center;gap:10px;flex:0 0 auto}
.role-pill{
  font-weight:700; font-size:12px; padding:4px 10px; border-radius:999px;
  background:var(--pill-bg); color:var(--pill-fg); border:1px solid var(--sep);
}

/* Avatar + dropdown */
.avatar-menu{position:relative;display:inline-flex;align-items:center}
.avatar{
  width:42px;height:42px;border-radius:50%;
  border:1px solid var(--sep); object-fit:cover; background:#ddd; cursor:pointer;
}
.dropdown{
  position:absolute; right:0; top:calc(100% + 8px); min-width:240px;
  border:1px solid var(--sep); background:var(--panel); box-shadow:var(--shadow);
  border-radius:12px; padding:8px; display:none; z-index:100;
}
.avatar-menu .dropdown::before{ content:""; position:absolute; left:0; right:0; top:-8px; height:8px; }
.avatar-menu:hover .dropdown,
.avatar-menu:focus-within .dropdown{display:block}
.drop-title{font-size:12px;color:var(--muted);padding:6px 8px}
.drop-sep{height:1px;background:var(--sep);margin:6px 0}
.drop-item{display:block;padding:8px;border-radius:10px}
.drop-item:hover{background:var(--brand-3);border:1px solid var(--brand-2)}
html.dark .drop-item:hover{background:var(--orange-weak);border:1px solid color-mix(in srgb, var(--brand) 40%, var(--sep))}
.logout-btn{
  display:block;width:100%;text-align:left;background:transparent;border:none;
  color:var(--text);padding:8px;border-radius:10px;cursor:pointer;
}
.logout-btn:hover{background:var(--brand-3);border:1px solid var(--brand-2)}
html.dark .logout-btn:hover{background:var(--orange-weak);border:1px solid color-mix(in srgb, var(--brand) 40%, var(--sep))}

.icon-btn{
  border:1px solid var(--sep);
  background:transparent; color:var(--text);
  border-radius:8px; padding:8px 10px; cursor:pointer; font-size:16px;
}
.icon-btn:hover{background:var(--brand-3);border-color:var(--brand-2)}
html.dark .icon-btn:hover{background:var(--orange-weak);border-color:color-mix(in srgb, var(--brand) 40%, var(--sep))}

/* Responsive header */
@media (max-width:760px){
  .navbar{flex-wrap:wrap}
  .brand-group{order:1;width:100%;justify-content:center}
  .right-box{order:2}
  .nav-links{order:3;width:100%;justify-content:center}
}

/* ------------------------
   Buttons
   ------------------------ */
.btn{
  display:inline-flex; align-items:center; line-height:1;
  padding:8px 12px; border-radius:8px;
  border:1px solid var(--btn-bd); background:var(--btn-bg); color:var(--btn-fg);
  cursor:pointer; font-weight:600; font-size:13px;
}
.btn .inline-icon{
  width:1.2em;
  height:auto;
  margin-right:8px;
  vertical-align:middle;
  display:inline-block;
}
.btn:hover{filter:brightness(.97)}
.btn:disabled{opacity:.6;cursor:not-allowed}
.btn.full{width:100%}
.btn.sm{padding:6px 8px; font-weight:600; font-size:12px}

.btn.brand{
  background:var(--brand); border-color:var(--brand-2); color:#1d1d1d;
}
.btn.orange{
  background:var(--orange); border-color:var(--brand-2); color:var(--orange-fg);
}
.btn.outline{
  background:#fff;
  color:var(--text);
  border-color:var(--sep);
}
html.dark .btn.outline{
  background:#1f1f22;
  color:var(--text);
  border-color:#3a3a40;
}
.btn.outline:hover{
  background:var(--brand-3);
  border-color:var(--brand-2);
}
html.dark .btn.outline:hover{
  background:#3a3a40;
  border-color:#4a4a52;
}
.btn.ghost{
  background:transparent; border-color:var(--sep); color:var(--text);
}
.btn.ghost:hover{background:var(--brand-3);border-color:var(--brand-2)}
html.dark .btn.ghost:hover{background:#3a3a40;border-color:#4a4a52}
.btn.danger{
  background:rgba(239,68,68,0.9);
  border-color:rgba(239,68,68,0.9);
  color:#fff;
}
.btn.danger:hover{background:rgba(220,38,38,0.95);border-color:rgba(220,38,38,0.95)}
html.dark .btn.danger{
  background:rgba(248,113,113,0.92);
  border-color:rgba(248,113,113,0.92);
  color:#0f172a;
}
html.dark .btn.danger:hover{background:rgba(248,113,113,0.98);border-color:rgba(248,113,113,0.98)}
.btn.sign-in-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:600;
}
.btn.sign-in-button svg{display:block;}

/* ------------------------
   Notice overlays
   ------------------------ */
.notice-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(15,23,42,0.45);
  backdrop-filter:blur(2px);
  z-index:1400;
  opacity:0;
  pointer-events:none;
  visibility:hidden;
  transition:opacity .18s ease, visibility 0s linear .18s;
}
.notice-overlay.visible{
  opacity:1;
  pointer-events:auto;
  visibility:visible;
  transition:opacity .18s ease, visibility 0s linear 0s;
}
.notice-card{
  width:min(520px, 100%);
  background:var(--panel);
  color:var(--text);
  border-radius:16px;
  border:1px solid var(--sep);
  padding:24px;
  box-shadow:0 22px 60px rgba(15,23,42,0.22);
  display:flex;
  flex-direction:column;
  gap:16px;
  max-height:calc(100vh - 64px);
  overflow:auto;
  transform:translateY(12px);
  transition:transform .18s ease;
}
.notice-overlay.visible .notice-card{
  transform:translateY(0);
}
html.dark .notice-card{
  background:#0b1120;
  color:#e2e8f0;
  border-color:rgba(148,163,184,0.35);
  box-shadow:0 30px 60px rgba(8,15,30,0.65);
}
.notice-head{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:700;
  color:var(--brand);
}
.notice-icon{
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:999px;
  background:var(--orange-weak);
  color:inherit;
}
html.dark .notice-icon{
  background:var(--orange-weak);
}
.notice-label{
  font-size:13px;
  letter-spacing:0.06em;
  text-transform:uppercase;
}
.notice-title{
  margin:0;
  font-size:1.18rem;
}
.notice-message{
  margin:0;
  line-height:1.55;
  color:var(--text);
}
html.dark .notice-message{
  color:#cbd5e1;
}
.notice-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.notice-overlay[aria-hidden="true"] .notice-card{
  pointer-events:none;
}

/* ------------------------
   Forms
   ------------------------ */
label{display:block;margin:6px 0 6px 2px;color:#374151}
html.dark label{color:#cbd5e1}
input,select,textarea{
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  background:var(--input-bg); color:var(--input-fg); border:1px solid var(--input-bd);
  font-size:13px;
  line-height:1.3;
}
input:focus,select:focus,textarea:focus{
  outline:none; border-color:var(--brand-2); box-shadow:0 0 0 2px var(--orange-weak);
}
input:required,select:required,textarea:required{border-color:var(--brand);}
.form-field{display:flex;flex-direction:column;gap:6px;margin:8px 0;}
.form-field__label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.form-field__label{font-weight:600;margin:0 0 2px 2px;display:inline-flex;align-items:center;gap:4px;flex:1;}
.form-field__required{
  color:var(--brand);
  font-size:0.85em;
  display:inline-flex;
  align-items:center;
  line-height:1;
  white-space:nowrap;
}
.form-tooltip{position:relative;display:inline-flex;align-items:center;}
.form-tooltip__trigger{
  border:none;
  background:var(--brand-3);
  width:24px;
  height:24px;
  border-radius:50%;
  font-weight:700;
  color:var(--brand);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:background .2s ease,color .2s ease;
}
.form-tooltip__trigger:hover,
.form-tooltip__trigger:focus-visible{background:var(--brand-2);color:#fff;outline:none;}
.form-tooltip__bubble{
  position:absolute;
  top:-8px;
  right:0;
  transform:translateY(-120%);
  background:var(--panel);
  border:1px solid var(--sep);
  box-shadow:0 12px 30px rgba(15,23,42,0.2);
  border-radius:10px;
  padding:10px 12px;
  max-width:240px;
  font-size:0.85rem;
  line-height:1.4;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease,transform .15s ease;
  z-index:10;
}
.form-tooltip__bubble.tooltip-large{max-width:360px;}
.form-tooltip:hover .form-tooltip__bubble,
.form-tooltip:focus-within .form-tooltip__bubble{
  opacity:1;
  transform:translateY(-140%);
  pointer-events:auto;
}
.form-tooltip__bubble.is-visible{opacity:1;transform:translateY(-140%);pointer-events:auto;}
.checkbox-field,.radio-field{display:flex;flex-direction:column;gap:4px;margin:6px 0;}
.checkbox-field label,.radio-field label{display:flex;align-items:center;gap:8px;cursor:pointer;}
input[type="checkbox"],
input[type="radio"]{
  appearance:none;
  -webkit-appearance:none;
  width:16px;
  height:16px;
  min-width:16px;
  min-height:16px;
  max-width:16px;
  max-height:16px;
  aspect-ratio:1 / 1;
  display:inline-block;
  box-sizing:border-box;
  margin:0;
  border:1px solid var(--sep);
  border-radius:4px;
  background:var(--input-bg);
  cursor:pointer;
  transition:background .12s ease, border-color .12s ease, box-shadow .12s ease;
  flex:0 0 16px;
}
input[type="radio"]{border-radius:999px;}
input[type="checkbox"]:checked{
  background-color:var(--brand);
  border-color:var(--brand);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 5l3 3 7-7'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:center;
}
input[type="radio"]:checked{
  border-color:var(--brand);
  background:radial-gradient(circle at center,#fff 0 45%,transparent 46%),var(--brand);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px var(--orange-weak);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled{
  opacity:.6;
  cursor:not-allowed;
}
.drop-item{display:block;padding:8px;border-radius:10px;border:1px solid transparent;text-align:left;background:transparent;color:inherit;cursor:pointer;}
.drop-item:hover{background:var(--brand-3);border-color:var(--brand-2);}
html.dark .drop-item:hover{background:#3a3a40;border-color:#4a4a52;}
.input-with-icon{position:relative;display:flex;align-items:center;}
.input-with-icon input{padding-left:42px;}
.input-with-icon .input-icon{position:absolute;left:14px;display:inline-flex;align-items:center;justify-content:center;color:var(--muted);}
.input-with-icon .input-icon svg{width:18px;height:18px;display:block;}
.input-with-icon input:focus + .input-icon,
.input-with-icon .input-icon svg:focus{color:var(--brand);}
.toggle-switch{display:inline-flex;align-items:center;gap:10px;}
.toggle-switch__label{font-size:14px;color:var(--text);}
.toggle-switch__hint{font-size:12px;color:var(--muted);margin-left:4px;}
.avatar-stack{display:flex;align-items:center;}
.avatar-stack__avatars{display:flex;align-items:center;}
.avatar-stack__avatars .avatar-item{margin-left:-10px;}
.avatar-stack__avatars .avatar-item:first-of-type{margin-left:0;}
.avatar-stack__names{margin-left:12px;font-size:13px;color:var(--muted);}
.chosen-pill{display:inline-block;padding:4px 8px;border-radius:999px;border:1px solid var(--sep);background:transparent;color:var(--text);font-weight:500;}
.chosen-pill.active{border-color:var(--brand-2);box-shadow:0 0 0 2px var(--orange-weak);color:var(--text);}
.helper{color:var(--muted);font-size:12px;margin-top:4px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:720px){ .form-row{grid-template-columns:1fr} }
.search-row{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;}
.form-grid{
  --form-grid-gap:16px;
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:var(--form-grid-gap);
}
.form-grid__item{min-width:0;}
@media (max-width:1200px){
  .form-grid{grid-template-columns:repeat(6,minmax(0,1fr));}
}
@media (max-width:768px){
  .form-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media (max-width:520px){
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
.cadastros-search{display:flex;flex-direction:column;gap:12px;}
.cadastros-search__row{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end;}
.cadastros-search__field{flex:3 1 75%;min-width:320px;max-width:75%;}
@media (max-width:960px){
  .cadastros-search__field{flex-basis:100%;max-width:100%;}
}
.cadastros-search__actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:flex-end;flex:1 1 25%;}
.cadastros-search__filters{display:flex;flex-direction:column;gap:10px;}
.cadastros-search__filters-head{font-weight:600;font-size:.95rem;color:var(--text);}
.cadastros-search__filters-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
@media (max-width:920px){
  .cadastros-search__filters-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
.filter-pill{
  border:1px solid var(--sep);
  border-radius:999px;
  padding:10px 18px;
  background:var(--panel);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:background .2s ease,color .2s ease,box-shadow .2s ease;
  cursor:pointer;
  font-weight:600;
  text-align:center;
  min-height:48px;
}
.filter-pill__label{font-size:0.95rem;text-transform:capitalize;}
.filter-pill.is-active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
  box-shadow:0 14px 30px rgba(37,99,235,0.3);
}
.filter-pill:disabled{opacity:.5;cursor:not-allowed;}
.floating-action-button{
  --fab-size:56px;
  --fab-collapse-delay:.2s;
  position:absolute;
  bottom:12px;
  right:12px;
  border:none;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  width:var(--fab-size);
  height:var(--fab-size);
  min-width:var(--fab-size);
  padding:0;
  box-shadow:none;
  cursor:pointer;
  transition:width .24s ease var(--fab-collapse-delay),padding .24s ease var(--fab-collapse-delay),gap .24s ease var(--fab-collapse-delay),transform .18s ease;
  overflow:hidden;
  z-index:10;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:0;
}
.floating-action-button:hover,
.floating-action-button:focus-visible{
  --fab-collapse-delay:0s;
  outline:none;
  width:auto;
  padding:0 16px 0 12px;
  gap:10px;
}
.floating-action-button:focus-visible{
  box-shadow:0 0 0 2px rgba(255,255,255,.35);
}
.floating-action-button__inner{
  display:contents;
}
.floating-action-button__icon{
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1.3rem;
  font-weight:700;
}
.floating-action-button__label{
  opacity:0;
  max-width:0;
  overflow:hidden;
  white-space:nowrap;
  transition:opacity .18s ease,max-width .22s ease;
}
.floating-action-button:hover .floating-action-button__label,
.floating-action-button:focus-visible .floating-action-button__label{
  opacity:1;
  max-width:200px;
}
.floating-action-button__plus{display:inline-block;transform:translateY(-1px);}
.upload-field{display:flex;flex-direction:column;gap:8px;}
.upload-field__control{display:flex;flex-direction:column;gap:6px;cursor:pointer;}
.upload-field__button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed var(--sep);
  font-weight:600;
  background:var(--brand-3);
  color:var(--text);
}
.upload-field__filename{font-size:.85rem;color:var(--muted);}
.upload-field__preview{border:1px dashed var(--sep);border-radius:12px;padding:12px;display:flex;align-items:center;justify-content:center;min-height:140px;background:var(--panel-muted, rgba(148,163,184,0.08));}
.upload-field__preview img{max-width:100%;max-height:200px;display:block;border-radius:10px;}
.upload-field__preview--media{border:none;padding:0;background:transparent;}
.upload-field__preview--media .upload-field__preview-content{background:transparent;border:none;border-radius:12px;}
.upload-field__preview--empty{color:var(--muted);font-size:.85rem;}
.upload-field__preview-link{border:none;background:none;font-weight:600;color:var(--brand);cursor:pointer;text-decoration:underline;}
.upload-field__actions{display:inline-flex;flex-wrap:wrap;gap:8px;align-items:center;}
.upload-field__actions--end{margin-left:auto;justify-content:flex-end;width:100%;}
.upload-field__action-btn{min-height:34px;padding:8px 12px;}

.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;padding:16px;z-index:1600;}
.modal-card{background:var(--panel);border-radius:18px;border:1px solid var(--sep);padding:20px;width:min(720px,95vw);max-height:90vh;overflow:auto;box-shadow:var(--shadow-lg);display:flex;flex-direction:column;gap:16px;}
html.dark .modal-card{background:#111827;border-color:#334155;box-shadow:var(--shadow-lg);}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--sep);padding-bottom:12px;margin:-8px -8px 0 -8px;padding-left:8px;padding-right:8px;}

/* Toggle “pill” */
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--sep);
  background:var(--brand-3);
  font-size:12px;
  color:#111;
  line-height:1.2;
}
html.dark .pill{
  background:#3a3a40;
  border-color:#4a4a52;
  color:var(--text);
}
.pill input[type="checkbox"],
.pill input[type="radio"]{
  margin:0;
  accent-color:var(--brand);
}

.pill-toggle{
  border-radius:10px;
  background:transparent;
  border-color:var(--sep);
  color:var(--text);
}
html.dark .pill-toggle{
  background:#3a3a40;
  border-color:#4a4a52;
}

/* ------------------------
   Table
   ------------------------ */
table{width:100%;border-collapse:collapse}
thead th{
  font-size:12px; text-transform:uppercase; letter-spacing:.03em;
  color:var(--muted); border-bottom:1px solid var(--sep); padding:10px; text-align:left;
}
td{padding:10px;border-bottom:1px solid var(--sep);text-align:left}
tr:hover td{background:rgba(0,0,0,.02)}
html.dark tr:hover td{background:#26262a}

.table-scroll{overflow-x:auto}
.table-residentes{table-layout:fixed;min-width:1040px}
.table-residentes col.col-select{width:48px}
.table-residentes col.col-nome{width:320px}
.table-residentes col.col-ano{width:90px}
.table-residentes col.col-estagio{width:220px}
.table-residentes col.col-preceptor{width:230px}
.table-residentes col.col-tipo{width:160px}
.table-residentes th,.table-residentes td{white-space:nowrap}
.table-residentes td{overflow:hidden;text-overflow:ellipsis}
.table-residentes th.sortable{cursor:pointer;position:relative;padding-right:22px}
.table-residentes th.sortable::after{
  content:"\21C5";
  position:absolute;
  right:8px;
  font-size:11px;
  opacity:.4;
}
.table-residentes th.sort-asc::after{content:"\25B2";opacity:.8}
.table-residentes th.sort-desc::after{content:"\25BC";opacity:.8}

/* Row states */
.is-deleted{text-decoration:line-through;opacity:.7}
.warn td{background:rgba(252,166,103,.15)}
.muted{color:var(--muted)}
.hidden{display:none}

/* ------------------------
   Layout utils
   ------------------------ */
.grid{display:grid;gap:16px}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:900px){ .grid.cols-3{grid-template-columns:1fr 1fr} }
@media (max-width:620px){ .grid.cols-2,.grid.cols-3{grid-template-columns:1fr} }
.stack{display:grid;gap:12px}
.center{display:grid;place-items:center}


/* ------------------------
   Hub de Cadastros — cards grandes
   ------------------------ */
.page-head{display:flex;gap:12px;align-items:center;padding-bottom:12px;border-bottom:1px solid var(--sep);margin-bottom:20px}
.page-head h3{margin:0;font-size:22px;font-weight:600;line-height:1.2;color:var(--text,#0f172a);}
.page-head p{margin:4px 0 0;font-size:13px;line-height:1.4;color:var(--muted,#64748b);}
.page-head__title{font-size:22px;font-weight:600;line-height:1.2;margin:0;}
.page-head__subtitle{font-size:13px;line-height:1.4;margin:4px 0 0;}
.page-head__icon{width:56px;height:56px;border-radius:18px;background:var(--panel-quiet,#f8fafc);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.page-head__icon img,.page-head__icon svg{width:32px;height:32px}
.cards-hub-page__head{margin-bottom:20px}

.grid-cards{
  display:grid;
  gap:16px;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  align-items:stretch;
  grid-auto-rows:200px;
}
.grid-cards--compact{
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
}
.grid-cards--four{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
[data-card-grid]{
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:200px;
  justify-content:stretch;
}
[data-card-grid] .card-link{
  width:100%;
  height:200px;
  padding:14px 16px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  text-align:left;
  gap:10px;
  border:1px solid var(--sep);
  border-radius:12px;
  background:var(--panel);
  color:inherit;
  text-decoration:none;
  transition:background .18s ease, transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
[data-card-grid] .card-link:hover{
  background:var(--panel-quiet);
  transform:translateY(-2px);
  box-shadow:var(--shadow-sm);
  border-color:var(--brand-2);
}
html.dark [data-card-grid] .card-link:hover{
  background:#2c2c31;
  border-color:#4a4a52;
  box-shadow:var(--shadow-sm);
}
[data-card-grid] .card-link .icon{
  width:40px;
  height:40px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--panel-quiet);
  margin-bottom:0;
}
[data-card-grid] .card-link .icon svg,
[data-card-grid] .card-link .icon img{
  width:22px;
  height:22px;
}

.icon-gallery-card{
  min-height:auto;
  padding:24px;
}
.icon-gallery-tools{
  display:flex;
  align-items:flex-end;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.icon-gallery-tools .field{
  margin:0;
}
.icon-gallery-grid{
  display:grid;
  gap:16px;
  margin-top:16px;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
}
.icon-gallery-card .icon-tile{
  border:1px solid var(--sep);
  border-radius:16px;
  padding:16px;
  text-align:center;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.icon-gallery-card .icon-tile:hover,
.icon-gallery-card .icon-tile:focus-visible{
  border-color:var(--brand-2);
  box-shadow:0 0 0 3px var(--orange-weak);
  transform:translateY(-2px);
}
.icon-gallery-card .icon-preview{
  width:72px;
  height:72px;
  margin:0 auto 10px;
  border-radius:18px;
  background:var(--panel-quiet,#fff3e6);
  border:1px solid var(--sep);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:12px;
}
.icon-gallery-card .icon-preview img,
.icon-gallery-card .icon-preview svg{
  display:block;
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
}
.icon-gallery-card figcaption{
  font-size:12px;
  color:var(--muted);
  word-break:break-all;
}

[data-card-grid] .card-link h4{
  margin:0;
  font-size:0.98rem;
  font-weight:600;
  position:relative;
  padding-bottom:0;
  width:100%;
}
[data-card-grid] .card-link h4::after{
  content:"";
  display:none;
}
[data-card-grid] .card-link p{
  margin:0;
  color:var(--muted);
  font-size:.85rem;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
[data-card-grid] .card-link .badge{
  margin-top:8px;
}
[data-card-grid] .card-link .badge,
.cards-hub-card__badge{
  margin-top:auto;
}
[data-card-grid] .card-link[aria-disabled="true"]{
  opacity:.6;
  cursor:default;
  transform:none;
  box-shadow:none;
}
.grid-cards-wrapper{
  display:flex;
  align-items:stretch;
  gap:16px;
  justify-content:stretch;
  flex-wrap:nowrap;
}
.grid-cards-pager{
  border:none;
  background:var(--panel);
  color:var(--muted);
  width:40px;
  height:40px;
  border-radius:999px;
  font-size:20px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(15,23,42,0.14);
  transition:transform .16s ease, box-shadow .16s ease, color .16s ease;
}

.cards-hub-empty{height:200px;display:flex;flex-direction:column;justify-content:center;align-items:center;}
.grid-cards-pager:hover:not(:disabled){
  transform:translateY(-2px);
  color:var(--text);
  box-shadow:0 12px 26px rgba(15,23,42,0.18);
}
.grid-cards-pager:disabled{
  opacity:.4;
  cursor:default;
  box-shadow:none;
}
.grid-cards-pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  font-size:.92rem;
  color:var(--muted);
  margin-top:8px;
}
@media (max-width:1280px){
  [data-card-grid]{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media (max-width:960px){
  [data-card-grid]{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:640px){
  [data-card-grid]{
    grid-template-columns:1fr;
  }
  .grid-cards-wrapper{
    gap:12px;
  }
}
.cards-hub-page{display:flex;flex-direction:column;gap:18px;flex:1 1 auto;min-height:0;width:100%;overflow:auto;}
body.page--cards-hub main.container{margin-top:0;padding-bottom:0;flex:1 1 auto;display:flex;flex-direction:column;min-height:0;}
body.page--cards-hub main.container>.cards-hub-container{flex:1 1 auto;min-height:0;display:flex;width:100%;}
body.page--cards-hub .cards-hub-container{flex:1 1 auto;display:flex;width:100%;min-height:0;height:100%;}
body.page--cards-hub .cards-hub-container>#cards-hub-root{flex:1 1 auto;display:flex;width:100%;min-height:0;}
.cards-hub-page__body{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;}
.cards-hub-page__body .grid-cards{flex:1 1 auto;min-height:0;}
.cards-hub-page__body .cards-hub-pagination{margin-top:auto;}
.cards-hub-header{display:flex;flex-direction:column;gap:12px;}
.cards-hub-title{display:flex;align-items:center;gap:12px;}
.cards-hub-title h1{margin:0;font-size:24px;font-weight:600;line-height:1.2;}
.cards-hub-subtitle{display:flex;align-items:center;gap:10px;}
.cards-hub-subtitle h2{margin:0;font-size:15px;font-weight:500;color:var(--muted);}
.cards-hub-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:12px;background:var(--panel);border:1px solid var(--sep);}
.cards-hub-icon img,.cards-hub-icon svg{width:22px;height:22px;}
.cards-hub-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px;}
.cards-hub-divider{height:1px;background:var(--sep);width:100%;}
.cards-hub-grid-wrapper{display:flex;flex-direction:column;gap:16px;flex:1;min-height:0;}
.cards-hub-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;align-items:stretch;}
.cards-hub-item{display:flex;flex-direction:column;gap:6px;}
.cards-hub-card{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px 16px;
  border-radius:12px;
  border:1px solid var(--sep);
  background:var(--panel);
  color:inherit;
  text-decoration:none;
  height:200px;
  transition:background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cards-hub-card:hover{background:var(--panel-quiet);border-color:var(--brand-2);box-shadow:var(--shadow-sm);transform:translateY(-2px);}
html.dark .cards-hub-card:hover{background:#2c2c31;border-color:#4a4a52;}
.cards-hub-card.is-disabled{opacity:.6;cursor:default;box-shadow:none;transform:none;}
.cards-hub-card__icon{
  width:40px;
  height:40px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--panel-quiet);
  flex-shrink:0;
}
.cards-hub-card__icon img,.cards-hub-card__icon svg{width:22px;height:22px;}
.cards-hub-card__body{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1;min-height:0;}
.cards-hub-card__title{margin:0;font-size:0.98rem;font-weight:600;line-height:1.25;}
.cards-hub-card__desc{
  margin:0;
  color:var(--muted);
  font-size:.85rem;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.cards-hub-card__badge{align-self:flex-start;margin-top:4px;}
.cards-hub-card__extra{
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-weight:600;
  color:var(--brand);
  text-decoration:none;
  font-size:.85rem;
}
.cards-hub-card__extra:hover{text-decoration:underline;}
.cards-hub-pager{border:none;background:var(--panel);color:var(--muted);width:40px;height:40px;border-radius:999px;font-size:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:var(--shadow-sm);}
.cards-hub-pager:hover{color:var(--text-strong);}
.cards-hub-pagination{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-top:8px;}
@media (max-width:1080px){
  .cards-hub-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:900px){
  .cards-hub-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:620px){
  .cards-hub-grid{grid-template-columns:1fr;}
  body.page--cards-hub .cards-hub-page--legacy .grid-cards{display:flex;flex-direction:column;align-items:stretch;gap:12px;}
  body.page--cards-hub .cards-hub-page--legacy .grid-card{width:100%;}
  body.page--cards-hub .cards-hub-page--legacy .grid-card .card{width:100%;height:auto;align-items:flex-start;text-align:left;padding:12px 14px;gap:10px;}
  body.page--cards-hub .cards-hub-page--legacy .grid-card__header{flex-direction:row !important;align-items:center !important;justify-content:flex-start !important;height:auto !important;gap:12px;width:100%;}
  body.page--cards-hub .cards-hub-page--legacy .grid-card__header h4{margin:0 !important;text-align:left !important;min-height:0 !important;}
  body.page--cards-hub .cards-hub-page--legacy .grid-card__divider{display:none;}
  body.page--cards-hub .cards-hub-page--legacy .grid-card__body{height:auto !important;padding-top:0 !important;}
  body.page--cards-hub .cards-hub-page--legacy .grid-card__body p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
}
.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;background:var(--pill-bg);color:var(--pill-fg);}
.badge--fresh{background:#dcfce7;color:#166534;border:1px solid #bbf7d0;}
.badge--stale{background:#fef3c7;color:#92400e;border:1px solid #fcd34d;}
.storage-table{width:100%;border-collapse:collapse;}
.storage-table th,.storage-table td{padding:10px 12px;border-bottom:1px solid var(--sep);text-align:left;vertical-align:top;}
.storage-row-missing{background:rgba(248,113,113,0.16);}
.storage-row.is-stale{background:rgba(253,230,138,0.22);}
.storage-badges{display:flex;gap:6px;margin-top:4px;}
.card-icon--theme{
  width:60px;
  height:auto;
}
.card-link h4{margin:0 0 4px 0;font-weight:600;font-size:15px;line-height:1.3}
.card-link p{margin:0;font-size:13px;line-height:1.4}
.system-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px;align-items:stretch;}
.system-card{display:flex;flex-direction:column;gap:12px;padding:22px;border-radius:18px;border:1px solid var(--sep);background:var(--panel);text-decoration:none;color:inherit;box-shadow:var(--shadow);transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;min-height:210px;position:relative;}
.system-card:hover,
.system-card:focus-visible{transform:translateY(-4px);box-shadow:var(--shadow-lg);border-color:var(--brand-2);}
.system-card:focus-visible{outline:none;box-shadow:0 0 0 3px var(--orange-weak),var(--shadow-lg);}
.system-card-icon{width:48px;height:48px;border-radius:14px;background:var(--brand-3);color:var(--brand);display:inline-flex;align-items:center;justify-content:center;}
.system-card-icon img,.system-card-icon svg{width:22px;height:22px;display:block;}
.system-card-body h3{margin:0 0 4px;font-size:15px;line-height:1.25;font-weight:600;}
.system-card-body p{margin:0;color:var(--muted);line-height:1.4;font-size:13px;}
.system-card-cta{margin-top:auto;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--brand);display:inline-flex;align-items:center;gap:6px;}

/* ------------------------
   Settings pages
   ------------------------ */
.settings-page{display:flex;flex-direction:column;gap:22px;}
.settings-head{align-items:center;gap:16px;}
.settings-head-text{display:flex;flex-direction:column;gap:4px;}
.settings-card{position:relative;overflow:hidden;}
.settings-form{display:flex;flex-direction:column;gap:24px;}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
@media (max-width:780px){.field-grid{grid-template-columns:1fr;}}

.media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start;}
@media (max-width:960px){.media-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:620px){.media-grid{grid-template-columns:1fr;}}
.media-field{display:flex;flex-direction:column;gap:12px;}
.media-preview-wrap{position:relative;border:1px solid var(--sep);border-radius:16px;overflow:hidden;background:var(--bg);aspect-ratio:1;display:flex;align-items:center;justify-content:center;}
.media-preview{width:100%;height:100%;object-fit:cover;display:block;}
.media-meta{display:flex;flex-direction:column;gap:6px;}
.field-label{font-weight:600;margin:0 0 2px 2px;}
.avatar-field .media-preview-wrap{border-radius:50%;aspect-ratio:1;max-width:220px;margin:0 auto;}
.avatar-controls{display:flex;flex-direction:column;gap:18px;align-items:center;}
.avatar-lower{display:flex;flex-direction:column;gap:14px;align-items:center;}
.avatar-preview{width:140px;height:140px;border-radius:50%;object-fit:cover;border:2px solid var(--sep);background:#ddd;}
.avatar-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;}

.avatar-source{display:flex;flex-direction:column;gap:10px;align-items:center;text-align:center;}
.avatar-source-toggle{display:flex;align-items:center;gap:14px;font-weight:600;flex-wrap:wrap;justify-content:center;}
.avatar-source-text{font-size:13px;color:var(--muted);text-align:center;}
.avatar-source-toggle .avatar-source-text{white-space:nowrap;}
.avatar-source-toggle .avatar-source-text.avatar-source-text-on{color:var(--text);}
.avatar-source-toggle .avatar-source-text.avatar-source-text-off{color:var(--text);}
@media (max-width:600px){
  .avatar-source-toggle{flex-direction:column;gap:10px;}
  .avatar-source-toggle .avatar-source-text{white-space:normal;}
}

.avatar-switch{position:relative;display:inline-flex;align-items:center;justify-content:center;width:58px;height:30px;cursor:pointer;}
.avatar-switch input{position:absolute;inset:0;margin:0;opacity:0;}
.avatar-switch-track{position:relative;width:100%;height:100%;border-radius:999px;background:rgba(148,163,184,0.35);display:flex;align-items:center;padding:4px;transition:background .24s ease, box-shadow .24s ease;}
.avatar-switch-thumb{width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 4px 10px rgba(15,23,42,0.18);transform:translateX(0);transition:transform .24s ease, background .24s ease;}
.avatar-switch input:checked + .avatar-switch-track{background:var(--brand-2);}
.avatar-switch input:checked + .avatar-switch-track .avatar-switch-thumb{transform:translateX(28px);background:var(--brand);}
html.dark .avatar-switch-track{background:rgba(148,163,184,0.28);}
html.dark .avatar-switch input:checked + .avatar-switch-track{background:var(--brand);}
html.dark .avatar-switch input:checked + .avatar-switch-track .avatar-switch-thumb{background:#111;}

.settings-actions{display:flex;gap:12px;justify-content:flex-end;flex-wrap:wrap;}
.settings-card.locked form{filter:grayscale(.25);pointer-events:none;}
.settings-card.locked .settings-lock-overlay{opacity:1;pointer-events:auto;}
.settings-lock-overlay{position:absolute;inset:0;background:linear-gradient(160deg,rgba(255,255,255,0.82),rgba(252,214,182,0.82));display:flex;align-items:center;justify-content:center;text-align:center;padding:18px;font-weight:600;color:#7a4b11;opacity:0;pointer-events:none;transition:opacity .2s ease;}
html.dark .settings-lock-overlay{background:linear-gradient(160deg,rgba(17,24,39,0.9),rgba(30,41,59,0.88));color:#f8d2b0;}

.avatar-editor-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(15,23,42,0.55);backdrop-filter:blur(2px);z-index:1600;}
.avatar-editor-overlay[hidden]{display:none !important;}
.avatar-editor-modal{width:min(640px,100%);max-height:calc(100vh - 80px);overflow:auto;background:var(--panel);border-radius:18px;border:1px solid var(--sep);padding:24px;display:flex;flex-direction:column;gap:18px;}
html.dark .avatar-editor-modal{background:#111827;border-color:#334155;}
.avatar-editor-header,.avatar-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.avatar-editor-body{display:grid;grid-template-columns:1fr 220px;gap:18px;align-items:start;}
.avatar-editor-body canvas{display:block;width:100%;height:auto;max-width:360px;border-radius:18px;border:1px solid var(--sep);background:rgba(148,163,184,0.15);}
html.dark .avatar-editor-body canvas{border-color:#334155;background:rgba(30,41,59,0.45);}
.avatar-editor-controls{display:flex;flex-direction:column;gap:16px;}
.avatar-editor-zoom input[type="range"]{width:100%;}
.avatar-editor-buttons{display:flex;flex-direction:column;gap:10px;}
@media (max-width:780px){
  .avatar-editor-body{grid-template-columns:1fr;grid-template-rows:auto auto;}
  .avatar-editor-controls{flex-direction:row;flex-wrap:wrap;justify-content:center;}
  .avatar-editor-buttons{flex-direction:row;justify-content:center;}
}

/* ------------------------
   Login
   ------------------------ */
.login-wrap{
  flex:1 0 auto;
  width:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:40px 24px 80px;
  gap:32px;
  position:relative;
  isolation:isolate;
  overflow:hidden;
  background:var(--bg);
  --login-bg-light:none;
  --login-bg-dark:none;
}
.login-wrap::before,
.login-wrap::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0;
  transition:opacity .6s ease, filter .6s ease;
}
.login-wrap::before{
  z-index:-2;
  background-image:var(--login-bg-active, none);
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  filter:var(--login-bg-filter, saturate(1));
}
.login-wrap::after{
  z-index:-1;
  background:var(--login-bg-overlay, transparent);
}
.login-wrap[data-login-bg="true"]::before,
.login-wrap[data-login-bg="true"]::after{
  opacity:1;
}
html:not(.dark) .login-wrap{
  --login-bg-active:var(--login-bg-light, none);
  --login-bg-filter:saturate(1.15);
  --login-bg-overlay:linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,255,255,0.82));
}
html.dark .login-wrap{
  --login-bg-active:var(--login-bg-dark, none);
  --login-bg-filter:grayscale(1) brightness(0.45);
  --login-bg-overlay:linear-gradient(120deg, rgba(15,23,42,0.85), rgba(0,0,0,0.65));
}
.login-grid{
  display:grid; grid-template-columns: 1fr 420px; gap:28px; align-items:center;
  width:100%; max-width:1100px;
}
.login-branding{
  display:flex;
  flex-direction:column;
  gap:32px;
  align-items:center;
  justify-content:center;
  width:100%;
}
.login-logo{
  display:block;
  max-width:100%;
  height:auto;
  object-fit:contain;
  margin:0 auto;
  max-height:220px;
}
.login-card{ width:100% }
@media (max-width:800px){
  .login-grid{grid-template-columns:1fr}
  .login-logo{max-height:180px;}
}

/* ------------------------
   Footer
   ------------------------ */
.site-footer{
  position:fixed;
  left:0; right:0; bottom:0;
  padding:12px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background:var(--bg);
  border-top:1px solid var(--sep);
  text-align:center;
  color:var(--muted);
  z-index:30;
}
.site-footer .copy{margin:0 0 6px 0;font-size:13px;}
.site-footer .footer-logo{margin-top:8px;display:flex;justify-content:center}
.site-footer .footer-logo img{height:30px;width:auto;opacity:.85}
.site-footer .egg{color:var(--bg);font-size:12px;}

/* ------------------------
   Menus específicos (legado)
   ------------------------ */
.menu-cads{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px;
}
.menu-cads a{
  display:block;padding:14px;border-radius:12px;border:1px solid var(--sep);
  background:var(--panel); text-align:center; font-weight:700;
}
.menu-cads a:hover{background:var(--brand-3);border-color:var(--brand-2)}
html.dark .menu-cads a:hover{background:#3a3a40;border-color:#4a4a52}

/* -----------------------
   Swatches para Cadastro de Residentes
  ------------------------ */

.swatch-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(34px,1fr));gap:8px}
.swatch{
  width:34px;height:34px;border-radius:8px;border:1px solid var(--border);
  cursor:pointer; position:relative;
}
.swatch.used::after{
  content:""; position:absolute; inset:0; border-radius:8px;
  background:repeating-linear-gradient(45deg, rgba(0,0,0,.12), rgba(0,0,0,.12) 6px, transparent 6px, transparent 12px);
}
.swatch.selected{outline:2px solid var(--brand); outline-offset:2px}

/* ------------------------
   App shell & navigation
   ------------------------ */
.app-shell{
  display:flex;
  flex-direction:row;
  min-height:100vh;
  padding-left:var(--sidebar-current, 240px);
  transition:padding-left .24s ease;
}
.app-shell--no-sidebar{padding-left:0;}
.app-shell__main{flex:1 1 auto;display:flex;flex-direction:column;min-height:100vh;position:relative;}

/* Dashboard page – remove large bottom padding from main.container */
body.page--dashboard main.container{padding-bottom:0;margin-top:0;}

.app-sidebar{
  position:fixed;
  top:0;
  left:0;
  height:100vh;
  width:var(--sidebar-collapsed, 240px);
  background:var(--panel);
  border-right:1px solid var(--sep);
  box-shadow:var(--shadow-lg);
  transition:width .24s ease, box-shadow .24s ease;
  z-index:80;
}
html.dark .app-sidebar{box-shadow:var(--shadow-lg);}
.app-sidebar.expanded{width:var(--sidebar-expanded, 240px);}
.app-sidebar__inner{display:flex;flex-direction:column;height:100%;padding:16px 14px;gap:10px;overflow:hidden;}
.app-sidebar__top{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;}
.app-sidebar__bottom{margin-top:auto;display:flex;flex-direction:column;gap:12px;flex:0 0 auto;}
.app-sidebar__brand-block{display:flex;align-items:center;justify-content:center;padding:4px 0 16px;}
.app-sidebar__brand-link{display:inline-flex;align-items:center;justify-content:center;width:100%;}
.app-sidebar__brand-logo{max-width:168px;width:100%;height:auto;object-fit:contain;filter:drop-shadow(0 5px 18px rgba(15,23,42,0.12));}
html.dark .app-sidebar__brand-logo{filter:none;}
.app-sidebar__divider{width:100%;height:1px;background:var(--sep);margin:10px 0;opacity:.9;}
.app-sidebar__theme-icon{display:inline-flex;}
.app-sidebar__theme-icon svg{width:20px;height:20px;display:block;}
.app-sidebar__profile{position:relative;display:flex;flex-direction:column;gap:10px;padding:4px 0;}
.app-sidebar__profile-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:16px;border:1px solid var(--sep);background:var(--panel);box-shadow:none;cursor:pointer;transition:border-color .18s ease, background .18s ease, box-shadow .18s ease;}
.app-sidebar__profile-card:hover,
.app-sidebar__profile-card.open{border-color:var(--brand);background:var(--orange-weak);box-shadow:var(--shadow);}
.app-sidebar__avatar-wrap{width:48px;height:48px;border-radius:50%;overflow:hidden;border:1px solid var(--sep);flex:0 0 auto;background:var(--panel);}
.app-sidebar__avatar{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%;}
.app-sidebar__profile-meta{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;height:48px;justify-content:center;}
.app-sidebar__profile-name{font-weight:700;font-size:13px;line-height:1.3;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.app-sidebar__profile-username{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.app-sidebar__profile-roleline{font-size:11px;font-weight:600;color:var(--brand);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.app-sidebar__profile-caret{border:none;background:transparent;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;transition:transform .18s ease,color .18s ease;cursor:pointer;flex:0 0 auto;}
.app-sidebar__profile-card.open .app-sidebar__profile-caret{transform:rotate(180deg);color:var(--brand);}
.app-sidebar__profile-menu{position:absolute;bottom:calc(100% + 8px);left:0;width:100%;background:var(--panel);border:1px solid var(--sep);border-radius:14px;box-shadow:var(--shadow-lg);display:flex;flex-direction:column;overflow:hidden;z-index:160;min-width:220px;color:var(--text);}
.app-sidebar__profile-menu[hidden]{display:none;}
.app-sidebar__profile-menu-item{display:flex;align-items:center;gap:10px;padding:10px 16px;border:none;background:transparent;text-align:left;font:inherit;cursor:pointer;transition:background .18s ease;color:var(--text);}
.app-sidebar__profile-menu-item span{color:inherit;}
.app-sidebar__profile-menu-item:hover,
.app-sidebar__profile-menu-item:focus-visible{background:var(--orange-weak);outline:none;}
.app-sidebar__profile-menu-item:visited{color:inherit;}
.app-sidebar__profile-menu-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;color:inherit;}
.app-sidebar__profile-menu-icon svg,.app-sidebar__profile-menu-icon img{width:18px;height:18px;display:block;stroke:currentColor;fill:none;}
.app-sidebar__profile-menu-icon svg *{stroke:currentColor;fill:none;}
.app-sidebar__glyph{width:18px;height:18px;display:block;}
html.dark .app-sidebar img.app-sidebar__glyph{filter:brightness(0) invert(0.92);}
html.dark .app-sidebar__profile-card{background:rgba(37,41,54,0.8);border-color:rgba(94,109,137,0.34);}
html.dark .app-sidebar__profile-card:hover,
html.dark .app-sidebar__profile-card.open{background:rgba(37,41,54,0.92);}
html.dark .app-sidebar__avatar-wrap{border-color:#3a3a40;background:#242428;}
html.dark .app-sidebar__profile-menu{background:#111827;border-color:#2c2f36;box-shadow:var(--shadow-lg);}
.app-sidebar:not(.expanded) .app-sidebar__profile-card{flex-direction:column;align-items:center;text-align:center;padding:12px;border-radius:18px;}
.app-sidebar:not(.expanded) .app-sidebar__profile-meta{display:none;}
.app-sidebar:not(.expanded) .app-sidebar__profile-roleline{display:none;}
.app-sidebar:not(.expanded) .app-sidebar__profile-menu{left:50%;transform:translateX(-50%);min-width:220px;}
.app-sidebar__icon-btn{border:1px solid var(--sep);background:var(--panel);border-radius:12px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;color:var(--muted);cursor:pointer;transition:all .18s ease;flex:0 0 36px;}
.app-sidebar__icon-btn svg{width:18px;height:18px;display:block;}
.app-sidebar__icon-btn:hover,
.app-sidebar__icon-btn:focus-visible{border-color:var(--brand-2);color:var(--brand);box-shadow:0 0 0 3px var(--orange-weak);}
.app-sidebar__login{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid var(--brand-2);background:var(--panel);color:var(--brand);font-weight:600;text-decoration:none;}
.app-sidebar__login-icon svg{width:18px;height:18px;display:block;}
.app-sidebar__login:hover,
.app-sidebar__login:focus-visible{text-decoration:underline;}
.app-sidebar__backdrop{display:none;position:fixed;inset:0;background:rgba(15,23,42,0.52);z-index:140;}
.app-sidebar__backdrop.visible{display:block;}
.app-sidebar.is-mobile-open{transform:translateX(0);box-shadow:var(--shadow-lg);}
@media (max-width:900px){
  .app-sidebar{position:fixed;top:0;bottom:0;left:0;transform:translateX(-120%);transition:transform .24s ease;z-index:150;}
  .app-sidebar.expanded{width:280px;}
}
.app-sidebar__toggle{
  width:44px;
  height:44px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  background:transparent;
  color:var(--muted);
  border-radius:12px;
  cursor:pointer;
  transition:color .18s ease, background .18s ease;
}
.app-sidebar__toggle:hover,
.app-sidebar__toggle:focus-visible{
  background:var(--brand-3);
  color:var(--brand);
  outline:none;
}
html.dark .app-sidebar__toggle:hover,
html.dark .app-sidebar__toggle:focus-visible{
  background:var(--orange-weak);
  color:var(--brand-2);
}
.app-sidebar__nav{
  display:flex;
  flex-direction:column;
  gap:4px;
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  padding-right:4px;
}
.app-sidebar__nav::-webkit-scrollbar{width:6px;}
.app-sidebar__nav::-webkit-scrollbar-thumb{background:rgba(15,23,42,0.18);border-radius:6px;}
html.dark .app-sidebar__nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.16);}
.app-sidebar__menu{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-top:8px;
}
.app-sidebar__link,
.app-sidebar__action{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 13px;
  border-radius:12px;
  border:1px solid transparent;
  color:var(--text);
  text-decoration:none;
  transition:background .18s ease, border-color .18s ease, color .18s ease;
}
.app-sidebar__link:hover,
.app-sidebar__action:hover{
  background:var(--brand-3);
  border-color:var(--brand-2);
}
html.dark .app-sidebar__link:hover,
html.dark .app-sidebar__action:hover{
  background:var(--orange-weak);
  border-color:color-mix(in srgb, var(--brand) 40%, var(--sep));
}
.app-sidebar__link.active{
  background:var(--pill-bg);
  border-color:var(--brand-2);
  color:var(--brand);
}
.app-sidebar__icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--nav-icon-size);
  height:var(--nav-icon-size);
  flex:0 0 var(--nav-icon-size);
  color:var(--brand);
}
.app-sidebar__icon svg,
.app-sidebar__icon img{
  width:100%;
  height:100%;
  display:block;
}
.app-sidebar__label{
  flex:1 1 auto;
  min-width:0;
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.app-sidebar__badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:10px;
  background:var(--brand);
  color:#fff;
  font-size:11px;
  font-weight:700;
  line-height:1;
  flex:0 0 auto;
  white-space:nowrap;
}
.app-sidebar:not(.expanded) .app-sidebar__badge{
  position:absolute;
  top:2px;
  right:2px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  font-size:9px;
}
.app-sidebar__footer{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:16px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
  align-items:center;
  text-align:center;
}
.app-sidebar__footer-logos{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;}
.app-sidebar__footer-logo{flex:1 1 0;width:100%;max-width:100%;min-width:0;height:auto;display:block;object-fit:contain;}
.app-sidebar__footer-row{display:flex;align-items:center;gap:8px;font-weight:600;font-size:11px;color:var(--text);}
.app-sidebar__footer-brand{font-weight:700;}
.app-sidebar__footer-dot{color:var(--muted);font-size:12px;}
.app-sidebar__footer-version{color:var(--muted);}
.app-sidebar__footer-version-link{color:var(--brand);font-weight:600;text-decoration:none;}
.app-sidebar__footer-version-link:hover,
.app-sidebar__footer-version-link:focus-visible{text-decoration:underline;}
.app-sidebar__footer-copy{font-size:11px;color:var(--muted);}
.app-sidebar:not(.expanded) .app-sidebar__label{
  opacity:0;
  pointer-events:none;
  max-width:0;
  margin:0;
}
.app-sidebar:not(.expanded) .app-sidebar__link,
.app-sidebar:not(.expanded) .app-sidebar__action{
  justify-content:center;
  padding:10px 0;
  gap:0;
}
.app-sidebar:not(.expanded) .app-sidebar__icon{margin:0;}
.app-sidebar:not(.expanded) .app-sidebar__divider{display:none;}
.app-sidebar:not(.expanded) .app-sidebar__footer{display:none;}
.app-sidebar:not(.expanded) .app-sidebar__profile{align-items:center;}
.app-sidebar:not(.expanded) .app-sidebar__profile-card{padding:10px;border-radius:50%;width:auto;flex-direction:column;align-items:center;background:var(--panel);box-shadow:none;border:1px solid var(--sep);}
.app-sidebar:not(.expanded) .app-sidebar__avatar-link{width:48px;height:48px;border-width:1px;}
.app-sidebar:not(.expanded) .app-sidebar__profile-meta{display:none;}
.app-sidebar:not(.expanded) .app-sidebar__profile-actions{display:none;}
.app-sidebar:not(.expanded) .app-sidebar__logout{display:none;}
.app-sidebar:not(.expanded) .app-sidebar__login{justify-content:center;padding:10px;border-radius:12px;}

.dashboard-layout{display:flex;flex-direction:column;gap:24px;margin-bottom:24px;}
.dashboard-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.dashboard-head__titles{display:flex;flex-direction:column;gap:6px;}
.dashboard-title{margin:0;font-size:28px;font-weight:700;}
.dashboard-greeting{margin:0;color:var(--muted);font-size:1rem;}
.dashboard-actions{display:flex;align-items:center;gap:12px;}
.btn.icon{display:inline-flex;align-items:center;gap:10px;}
.btn.icon .btn__icon{display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;}
.btn.icon .btn__icon svg{width:20px;height:20px;display:block;}
.dashboard-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:minmax(120px,auto);gap:20px;grid-auto-flow:dense;}
.dashboard-card{position:relative;display:flex;flex-direction:column;gap:16px;padding:20px;min-height:0;}
.dashboard-card__head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.dashboard-card__title{margin:0;font-size:18px;font-weight:700;}
.dashboard-card__subtitle{margin:2px 0 0;color:var(--muted);font-size:.92rem;}
.dashboard-card__body{flex:1 1 auto;display:flex;flex-direction:column;gap:12px;min-height:0;}
.dashboard-card__body--scroll{overflow:auto;padding-right:4px;}
.dashboard-card__footer{margin-top:auto;padding-top:12px;border-top:1px solid var(--sep);}
.dashboard-card--2x2{grid-column:span 3;grid-row:span 2;}
.dashboard-card--1x2{grid-column:span 2;grid-row:span 2;}
@media (max-width:1160px){
  .dashboard-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
  .dashboard-card--2x2{grid-column:span 3;}
  .dashboard-card--1x2{grid-column:span 3;}
}
@media (max-width:720px){
  .dashboard-head{flex-direction:column;align-items:flex-start;}
  .dashboard-grid{grid-template-columns:repeat(1,minmax(0,1fr));grid-auto-rows:auto;}
  .dashboard-card--2x2,
  .dashboard-card--1x2{grid-column:span 1;grid-row:auto;}
}
.dashboard-metric{font-size:36px;font-weight:700;line-height:1;}
.dashboard-meta-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;}
.dashboard-meta-list li{display:flex;justify-content:space-between;gap:12px;font-size:.95rem;}
.dashboard-link{display:inline-flex;align-items:center;gap:6px;font-weight:600;color:var(--brand);text-decoration:none;}
.dashboard-link:hover,
.dashboard-link:focus-visible{text-decoration:underline;}
.dashboard-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:18px;border:1px dashed var(--sep);border-radius:12px;color:var(--muted);}
.dashboard-placeholder svg{width:48px;height:48px;fill:currentColor;opacity:.35;}
.dashboard-table{width:100%;border-collapse:collapse;font-size:.9rem;min-width:420px;}
.dashboard-table th,
.dashboard-table td{padding:8px 10px;border-bottom:1px solid var(--sep);text-align:left;}
.dashboard-table tbody tr:last-child td{border-bottom:none;}
.tag{display:inline-flex;align-items:center;justify-content:center;padding:0 8px;border-radius:999px;font-size:.78rem;font-weight:600;}
.tag--alert{background:rgba(239,68,68,0.12);color:#b91c1c;}
.tag--ok{background:rgba(34,197,94,0.14);color:#15803d;}
.dashboard-card.is-hidden{display:none !important;}
.notice-body{margin:4px 0 6px;}
.notice-board__empty{margin:0 0 10px 0;}

.dashboard-customize-backdrop{position:fixed;inset:0;background:rgba(15,23,42,0.55);opacity:0;pointer-events:none;transition:opacity .22s ease;z-index:140;backdrop-filter:blur(2px);}
.dashboard-customize-backdrop.visible{opacity:1;pointer-events:auto;}
.dashboard-customize{position:fixed;top:50%;left:50%;width:min(720px,92vw);max-height:85vh;background:var(--panel);box-shadow:0 24px 50px rgba(15,23,42,0.3);transform:translate(-50%,-50%) scale(.98);opacity:0;pointer-events:none;transition:opacity .22s ease,transform .22s ease;z-index:150;display:flex;flex-direction:column;border-radius:18px;overflow:hidden;}
.dashboard-customize.open{transform:translate(-50%,-50%) scale(1);opacity:1;pointer-events:auto;}
.dashboard-customize__form{display:flex;flex-direction:column;height:100%;}
.dashboard-customize__head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--sep);}
.dashboard-customize__title{margin:0;font-size:20px;}
.dashboard-customize__subtitle{margin:6px 0 0;color:var(--muted);font-size:.9rem;}
.dashboard-customize__content{flex:1 1 auto;overflow:auto;padding:24px;display:flex;flex-direction:column;gap:24px;}
.dashboard-customize__section{display:flex;flex-direction:column;gap:12px;}
.dashboard-customize__section h3{margin:0;font-size:1rem;}
.dashboard-customize__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;}
.dashboard-customize__list--cards{gap:12px;}
.dashboard-customize__item{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:12px;border-radius:12px;border:1px solid var(--sep);background:var(--panel);}
.dashboard-customize__preview{width:68px;height:52px;border-radius:10px;border:1px dashed rgba(148,163,184,0.7);background:linear-gradient(135deg,rgba(148,163,184,0.15),rgba(148,163,184,0.05));display:flex;align-items:center;justify-content:center;}
.dashboard-customize__preview-card{width:70%;height:70%;border-radius:8px;background:var(--panel);border:1px solid rgba(148,163,184,0.5);box-shadow:0 6px 14px rgba(15,23,42,0.12);}
.dashboard-customize__preview--medium .dashboard-customize__preview-card{height:90%;}
.dashboard-customize__preview--tall .dashboard-customize__preview-card{width:60%;height:100%;}
.dashboard-customize__info{display:flex;flex-direction:column;gap:4px;}
.dashboard-customize__label{font-weight:600;}
.dashboard-customize__desc{color:var(--muted);font-size:.85rem;}
.dashboard-customize__controls{display:flex;flex-direction:column;gap:8px;align-items:flex-end;min-width:140px;}
.dashboard-customize__size{display:flex;flex-direction:column;gap:4px;font-size:.8rem;color:var(--muted);}
.dashboard-customize__size select{min-width:120px;padding:6px 10px;border-radius:10px;border:1px solid var(--sep);background:var(--panel);}
.dashboard-customize__size-pill{margin-left:8px;padding:2px 8px;border-radius:999px;border:1px solid var(--sep);font-size:.7rem;text-transform:uppercase;letter-spacing:.03em;}
.dashboard-customize__checkbox{display:flex;align-items:flex-start;gap:10px;font-weight:500;}
.dashboard-customize__checkbox input{width:18px;height:18px;margin-top:2px;}
.dashboard-customize__checkbox span{display:flex;flex-direction:column;gap:2px;}
.dashboard-customize__checkbox small{font-weight:400;}
.dashboard-customize__checkbox--inline{align-items:center;gap:8px;font-weight:500;}
.dashboard-customize__hint{font-size:.85rem;line-height:1.4;}
.dashboard-customize__footer{padding:16px 24px;border-top:1px solid var(--sep);display:flex;justify-content:flex-end;}
.dashboard-customize__footer .btn + .btn{margin-left:8px;}
@media(max-width:820px){
  .dashboard-customize__item{grid-template-columns:1fr;align-items:flex-start;}
  .dashboard-customize__preview{width:100%;height:56px;justify-self:stretch;}
  .dashboard-customize__controls{flex-direction:row;justify-content:space-between;width:100%;}
}
@media(max-width:720px){
  .dashboard-customize{width:94vw;max-height:90vh;}
  .dashboard-customize__head{padding:18px;}
  .dashboard-customize__content{padding:18px;}
  .dashboard-customize__footer{padding:14px 18px;}
}
.form-field{display:flex;flex-direction:column;gap:6px;}
.form-field label{font-weight:600;font-size:.92rem;}
.form-field select{padding:9px 12px;border-radius:12px;border:1px solid var(--sep);background:var(--panel);color:var(--text);transition:border-color .18s ease;}
.form-field select:focus{outline:none;border-color:var(--brand);}

.cad-layout{display:flex;flex-direction:column;gap:24px;}
.cad-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px;}
.cad-head__info{display:flex;flex-direction:column;gap:10px;max-width:640px;}
.cad-head__info h1{margin:0;font-size:24px;line-height:1.2;}
.cad-head__actions{display:flex;flex-wrap:wrap;gap:12px;}
.cad-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;padding:16px;border:1px solid var(--sep);border-radius:16px;background:var(--panel);}
.cad-summary__item{display:flex;flex-direction:column;gap:6px;}
.cad-summary__label{font-size:.92rem;color:var(--muted);}
.cad-shortcuts{display:flex;flex-wrap:wrap;gap:12px;}
.cad-content{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:24px;}
@media(max-width:1080px){.cad-content{grid-template-columns:1fr;}}
.cad-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;}
.cad-card{display:flex;flex-direction:column;gap:14px;padding:20px;border:1px solid var(--sep);border-radius:18px;background:var(--panel);box-shadow:0 10px 24px rgba(15,23,42,0.08);}
.cad-card__head{display:flex;flex-direction:column;gap:6px;}
.cad-card__badge{align-self:flex-start;padding:4px 10px;border-radius:999px;background:var(--brand-3);color:var(--brand);font-weight:600;font-size:.78rem;}
.cad-card__title{margin:0;font-size:20px;}
.cad-card__summary{margin:0;color:var(--muted);font-size:.95rem;}
.cad-card__metrics{display:flex;gap:16px;flex-wrap:wrap;}
.cad-card__metric{display:flex;flex-direction:column;gap:4px;min-width:96px;}
.cad-card__metric-label{color:var(--muted);font-size:.85rem;}
.cad-card__metric-value{font-size:1.4rem;}
.cad-card__footer{display:flex;gap:10px;flex-wrap:wrap;}
.cad-aside{display:flex;flex-direction:column;gap:18px;}
.cad-callout{padding:18px;border-radius:16px;border:1px solid var(--sep);background:linear-gradient(160deg,rgba(255,255,255,0.95),rgba(241,245,249,0.7));display:flex;flex-direction:column;gap:12px;}
html.dark .cad-callout{background:linear-gradient(170deg,rgba(31,33,44,0.95),rgba(17,19,25,0.88));}
.cad-knowledge{display:flex;flex-direction:column;gap:12px;}
.cad-knowledge-card{padding:16px;border:1px solid var(--sep);border-radius:14px;display:flex;flex-direction:column;gap:8px;}
.cad-knowledge-card h4{margin:0;}

.changelog-grid{display:flex;flex-direction:column;gap:20px;}
.changelog-entry{display:flex;flex-direction:column;gap:20px;}
.changelog-entry__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px;}
.changelog-entry__title{display:flex;flex-direction:column;gap:4px;}
.changelog-entry__label{font-size:12px;font-weight:600;text-transform:uppercase;color:var(--muted);letter-spacing:.08em;}
.changelog-entry__version{margin:0;font-size:24px;color:var(--text);}
.changelog-entry__meta{display:flex;flex-direction:column;align-items:flex-end;gap:6px;min-width:120px;}
.changelog-entry__date{font-size:13px;color:var(--muted);}
.changelog-entry__content{display:grid;gap:18px;}
@media (min-width:768px){.changelog-entry__content{grid-template-columns:repeat(2,minmax(0,1fr));}}
.changelog-entry__section{display:flex;flex-direction:column;gap:12px;}
.changelog-entry__section-title{margin:0;font-size:16px;color:var(--text);}
.changelog-entry__list{margin:0;padding-left:20px;display:grid;gap:8px;}
.changelog-entry__empty{margin:0;}

.mobile-nav-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.55);
  opacity:0;
  transition:opacity .24s ease;
  z-index:110;
  pointer-events:none;
}
.mobile-nav-backdrop.visible{opacity:1;pointer-events:auto;}
.mobile-nav-backdrop[hidden]{display:none !important;}

.mobile-nav{
  position:fixed;
  z-index:115;
  top:var(--topbar-height, 80px);
  left:0;
  width:min(320px, calc(100vw - 48px));
  height:calc(100vh - var(--topbar-height, 80px));
  background:var(--panel);
  border-right:1px solid var(--sep);
  box-shadow:0 24px 48px rgba(15,23,42,0.28);
  transform:translateX(-100%);
  transition:transform .24s ease;
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:18px;
  overflow:hidden;
}
.mobile-nav.open{transform:translateX(0);}
.mobile-nav--right{
  left:auto;
  right:0;
  transform:translateX(100%);
  border-right:none;
  border-left:1px solid var(--sep);
}
.mobile-nav--right.open{transform:translateX(0);}
.mobile-nav__body{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:18px;
  overflow-y:auto;
  padding-right:6px;
}
.mobile-nav__section{display:flex;flex-direction:column;gap:12px;}
.mobile-nav__user{flex-direction:row;align-items:center;gap:14px;}
.mobile-nav__avatar{width:52px;height:52px;display:block;border-radius:50%;object-fit:cover;border:1px solid var(--sep);background:#ddd;}
.mobile-nav__user-name{font-weight:700;}
.mobile-nav__user-role{color:var(--muted);font-size:13px;margin-top:4px;}
.mobile-nav__links,.mobile-nav__actions{gap:8px;}
.mobile-nav__link,
.mobile-nav__action{
  display:block;
  width:100%;
  text-align:left;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  font-weight:600;
}
.mobile-nav__link{
  display:flex;
  align-items:center;
  gap:12px;
}
.mobile-nav__link-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--nav-icon-size);
  height:var(--nav-icon-size);
  color:var(--muted);
  flex:0 0 var(--nav-icon-size);
}
.mobile-nav__link-icon svg{
  width:100%;
  height:100%;
  display:block;
}
.mobile-nav__link-label{flex:1 1 auto;}
.mobile-nav__action{cursor:pointer;}
.mobile-nav__link:hover,
.mobile-nav__action:hover{background:var(--brand-3);border-color:var(--brand-2);}
html.dark .mobile-nav__link:hover,
html.dark .mobile-nav__action:hover{background:#3a3a40;border-color:#4a4a52;}
.mobile-nav__link.active{background:var(--pill-bg);border-color:var(--brand-2);}
.mobile-nav__link.active .mobile-nav__link-icon{color:var(--brand);}
.mobile-nav__footer{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.mobile-nav--right .mobile-nav__action{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
}
.mobile-nav--right .mobile-nav__action-icon img{filter:none;}
html.dark .mobile-nav--right .mobile-nav__action-icon img{filter:brightness(0) invert(0.92);}
.mobile-nav--right .mobile-nav__section{gap:10px;}
.mobile-profile-card{display:flex;gap:14px;align-items:center;padding:12px 14px;border-radius:14px;border:1px solid var(--sep);background:var(--panel);}
.mobile-profile-card__avatar{width:56px;height:56px;border-radius:50%;object-fit:cover;border:1px solid var(--sep);background:#ddd;}
.mobile-profile-card__meta{display:flex;flex-direction:column;gap:4px;min-width:0;}
.mobile-profile-card__name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mobile-profile-card__username{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mobile-profile-card__role{font-size:12px;font-weight:600;color:var(--brand);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mobile-nav__action-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;}
.mobile-nav__action-icon img{width:18px;height:18px;display:block;}
.mobile-nav__footer--profile{border-top:1px solid var(--sep);padding-top:14px;}
.mobile-nav__footer-logos{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.mobile-nav__footer-logos img{flex:1 1 0;width:100%;max-width:100%;height:auto;object-fit:contain;}
.mobile-nav__footer-text{display:flex;flex-direction:column;align-items:flex-start;gap:6px;font-size:12px;color:var(--muted);}
.mobile-nav__footer-brand{font-weight:600;color:var(--text);}
.mobile-nav__footer-version{text-decoration:none;color:var(--brand);font-weight:600;}
.mobile-nav__footer-version:hover,
.mobile-nav__footer-version:focus-visible{text-decoration:underline;}
.mobile-nav__footer-copy{width:100%;font-size:11px;color:var(--muted);}

.app-topbar{
  position:-webkit-sticky;
  position:sticky;
  top:0;
  left:0;
  right:0;
  z-index:120;
  display:flex;
  align-items:center;
  gap:16px;
  padding:0 24px;
  min-height:var(--topbar-height, 80px);
  background:var(--panel);
  transition:padding .24s ease;
  overflow:visible;
}
.app-topbar::before{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:calc(-1 * var(--sidebar-current, 240px));
  right:0;
  background:var(--panel);
  border-bottom:1px solid var(--sep);
  pointer-events:none;
  z-index:-1;
}
.app-topbar__left{
  display:flex;
  align-items:center;
  gap:16px;
  flex:1 1 auto;
  min-width:0;
}
.app-topbar__right{margin-left:auto;display:flex;align-items:center;gap:16px;flex:0 0 auto;flex-wrap:nowrap;justify-content:flex-end;}
.app-topbar__brand{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:14px;
  text-decoration:none;
  padding:0;
  border:none;
  background:transparent;
  flex:1 1 auto;
  min-width:0;
}
.app-topbar__logo{
  height:72px;
  max-height:calc(var(--topbar-height, 80px) - 8px);
  width:auto;
  max-width:100%;
  object-fit:contain;
  object-position:left center;
  display:block;
}
.session-expired{min-height:100vh;padding:48px 16px 120px;display:flex;align-items:center;justify-content:center;position:relative;}
.session-expired__card{max-width:460px;width:100%;background:var(--panel);border:1px solid var(--sep);border-radius:24px;padding:36px;text-align:center;box-shadow:var(--shadow);}
html.dark .session-expired__card{border-color:#2f2f36;box-shadow:var(--shadow-lg);}
.session-expired__icon{width:72px;height:72px;border-radius:18px;margin:0 auto 20px;display:flex;align-items:center;justify-content:center;background:var(--orange-weak);color:var(--orange);}
html.dark .session-expired__icon{background:rgba(252,166,103,0.12);color:var(--brand-2);}
.session-expired__icon svg{width:42px;height:42px;display:block;}
.session-expired__title{font-size:26px;margin:0 0 12px;color:var(--text);}
.session-expired__text{margin:0 0 18px;font-size:15px;line-height:1.6;color:var(--muted);}
.session-expired__countdown{margin:0 0 28px;display:flex;flex-direction:column;align-items:center;gap:12px;}
.session-expired__countdown-intro{font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;}
.session-expired__countdown-ring{
  --ring-duration:2s;
  --ring-circumference:0;
  width:148px;
  height:148px;
  border-radius:50%;
  position:relative;
  display:grid;
  place-items:center;
}
.session-expired__countdown-ring svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  transform:rotate(-90deg);
}
.session-expired__countdown-track{
  fill:none;
  stroke:var(--sep);
  stroke-width:8;
  opacity:.6;
}
.session-expired__countdown-progress{
  fill:none;
  stroke:var(--brand);
  stroke-width:8;
  stroke-linecap:round;
  stroke-dasharray:var(--ring-circumference);
  stroke-dashoffset:var(--ring-circumference);
  animation:ring-countdown var(--ring-duration) linear forwards;
}
html.dark .session-expired__countdown-track{stroke:#2f3338;}
html.dark .session-expired__countdown-progress{stroke:var(--brand-2);}
.session-expired__countdown-ring-core{
  width:116px;
  height:116px;
  border-radius:50%;
  background:var(--panel);
  border:1px solid var(--sep);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  box-shadow:var(--shadow-sm);
}
html.dark .session-expired__countdown-ring-core{
  background:#1c1f24;
  border-color:#2f3338;
}
.session-expired__countdown-number{font-size:48px;line-height:1;font-weight:700;}
.session-expired__countdown-number.is-now{font-size:34px;letter-spacing:.02em;}
.session-expired__countdown-suffix{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;}
.session-expired__countdown-announcement{margin:0;font-size:14px;line-height:1.5;color:var(--muted);text-align:center;}
.session-expired__actions{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-bottom:8px;}
.session-expired__actions .btn{min-width:200px;}
.session-expired__instant{border-width:1px;border-style:solid;border-color:var(--sep);background:var(--panel-quiet);color:var(--text);}
html.dark .session-expired__instant{border-color:#2f2f36;background:rgba(255,255,255,0.04);color:var(--base-text);}
.session-theme-control{position:fixed;right:20px;bottom:20px;display:flex;gap:8px;align-items:center;z-index:60;}

.profile-picker{display:flex;flex-direction:column;gap:28px;max-width:940px;margin:0 auto;padding:24px 0 80px;}
.profile-picker__header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.profile-picker__headline{display:flex;flex-direction:column;gap:8px;min-width:240px;flex:1 1 320px;}
.profile-picker__title{margin:0;font-size:30px;font-weight:700;color:var(--text);}
.profile-picker__subtitle{margin:0;font-size:16px;color:var(--muted);line-height:1.5;}
.profile-picker__grid{gap:24px;}
.profile-card{position:relative;cursor:pointer;}
.profile-picker [data-card-grid] .profile-card{
  transition:background .1s ease-out, transform .1s ease-out, box-shadow .1s ease-out, border-color .1s ease-out;
  will-change:transform;
  transform:translateZ(0);
}
.profile-picker [data-card-grid] .profile-card:hover{
  transform:translateY(-1px);
}
.profile-picker [data-card-grid] .profile-card:not(:hover){
  transition-timing-function:ease-in;
  transition-duration:.08s;
}
.profile-card:focus-visible{outline:2px solid var(--brand-2);outline-offset:4px;}
.profile-card--active{border:2px solid var(--brand-2);box-shadow:var(--shadow-lg);}
.profile-card--active:focus-visible{outline-color:var(--brand-2);}
.profile-card--active:hover{border-color:var(--brand-2);}
.profile-card--active .profile-card__cta{color:var(--brand);}
.profile-card .icon{background:var(--panel-quiet);}
.profile-card .icon img,
.profile-card .icon svg{width:32px;height:32px;}
.profile-card__badge{position:absolute;top:18px;right:18px;}
.profile-card__description{margin:0;}
.profile-card .badge{margin-top:0;}
.profile-card__meta{margin-top:0;}
.profile-card__cta{margin-top:auto;font-size:.92rem;font-weight:600;color:var(--brand);display:inline-flex;align-items:center;gap:6px;}
.profile-card__cta span{display:inline-flex;align-items:center;}
html.dark .profile-card__cta{color:var(--brand-2);}
html.dark .profile-card:focus-visible{outline-color:var(--brand-2);}
html.dark .profile-card--active{border:2px solid var(--brand-2);box-shadow:var(--shadow-lg);}
html.dark .profile-card--active .profile-card__cta{color:var(--brand-2);}
.profile-picker__empty{margin:0;padding:36px;border:1px dashed var(--sep);border-radius:18px;text-align:center;color:var(--muted);}
.profile-picker__remember{display:inline-flex;align-items:center;gap:10px;padding:10px 16px;border-radius:999px;background:var(--brand-3);border:1px solid var(--brand-2);font-size:14px;font-weight:600;color:var(--brand-contrast);box-shadow:var(--shadow-sm);}
.profile-picker__remember input{width:18px;height:18px;accent-color:var(--brand);margin:0;}
.profile-picker__remember--locked{opacity:.6;cursor:not-allowed;pointer-events:none;box-shadow:none;}
.profile-picker__remember--locked input{opacity:1;}
html.dark .profile-picker__remember{background:var(--brand-3);color:var(--brand-contrast);border-color:var(--brand-2);box-shadow:var(--shadow);}
html.dark .profile-picker__remember--locked{border-color:rgba(148,163,184,0.35);box-shadow:none;}
.profile-picker__form{display:none;}
.profile-picker--noscript{display:flex;flex-direction:column;gap:24px;max-width:940px;margin:0 auto;padding:24px 0 80px;}
.profile-card--noscript{position:relative;display:flex;flex-direction:column;gap:12px;align-items:center;padding:22px;}
.profile-card--noscript input{position:absolute;opacity:0;pointer-events:none;}
html.dark .profile-card--noscript{border-color:#2f2f36;}


@media (max-width:720px){
  .session-expired{padding:32px 12px 100px;}
  .session-expired__card{padding:28px 22px;border-radius:20px;}
  .session-expired__title{font-size:22px;}
  .session-expired__countdown-ring{width:128px;height:128px;}
  .session-expired__countdown-ring-core{width:100px;height:100px;}
  .session-expired__countdown-number{font-size:40px;}
  .session-theme-control{right:16px;bottom:16px;}
  .profile-picker{padding-top:8px;}
  .profile-picker__title{font-size:26px;}
  .profile-picker__grid{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));}
  .profile-picker__header{flex-direction:column;align-items:stretch;gap:12px;}
  .profile-picker__remember{align-self:flex-end;}
}

@keyframes ring-countdown{
  from{stroke-dashoffset:var(--ring-circumference);}
  to{stroke-dashoffset:0;}
}
@media (prefers-reduced-motion: reduce){
  .session-expired__countdown-progress{animation:none;}
}



.nav-toggle-icon{
  display:inline-block;
  width:20px;
  height:2px;
  border-radius:999px;
  background:currentColor;
  position:relative;
  box-shadow:0 6px 0 currentColor, 0 -6px 0 currentColor;
}
.app-topbar__menu,
.app-topbar__theme,
.app-topbar__profile-toggle{
  width:44px;
  height:44px;
  flex-shrink:0;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--sep);
  background:var(--panel);
  border-radius:12px;
  cursor:pointer;
  transition:color .18s ease, background .18s ease;
}
.app-topbar__menu{
  color:var(--text);
  display:none;
}
.app-topbar__theme{color:var(--brand);}
.app-topbar__theme-label{display:none;}
.app-topbar__theme #themeIconTopbar{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--nav-icon-size);
  height:var(--nav-icon-size);
}
.app-topbar__theme #themeIconTopbar svg{
  width:100%;
  height:100%;
  display:block;
}
.app-topbar__menu:hover,
.app-topbar__menu:focus-visible,
.app-topbar__theme:hover,
.app-topbar__theme:focus-visible,
.app-topbar__profile-toggle:hover,
.app-topbar__profile-toggle:focus-visible{
  background:var(--brand-3);
  color:var(--brand);
  outline:none;
}
html.dark .app-topbar__menu:hover,
html.dark .app-topbar__menu:focus-visible,
html.dark .app-topbar__theme:hover,
html.dark .app-topbar__theme:focus-visible,
html.dark .app-topbar__profile-toggle:hover,
html.dark .app-topbar__profile-toggle:focus-visible{
  background:#3a3a40;
  color:var(--brand-2);
}
.app-topbar__theme,
.app-topbar__menu,
.app-topbar__profile-toggle{box-shadow:0 0 0 1px transparent;}
html.dark .app-topbar__menu,
html.dark .app-topbar__theme,
html.dark .app-topbar__profile-toggle{border-color:#3a3a40;background:#242428;}
.app-topbar__theme span svg{display:block;}
.app-topbar__profile-avatar{width:30px;height:30px;border-radius:50%;object-fit:cover;border:1px solid var(--sep);}
.app-topbar__user{position:relative;display:flex;align-items:center;}
.topbar-user{position:relative;display:flex;}
.topbar-user__trigger{display:flex;align-items:center;gap:14px;padding:6px 14px 6px 6px;border:1px solid var(--sep);background:var(--panel);border-radius:16px;cursor:pointer;color:inherit;min-height:54px;box-shadow:none;transition:background .18s ease,border-color .18s ease,box-shadow .18s ease;}
.topbar-user__trigger:focus-visible,
.topbar-user__trigger:hover{outline:none;border-color:var(--brand-2);box-shadow:0 0 0 1px var(--brand-3);}
html.dark .topbar-user__trigger{background:#242428;border-color:#3a3a40;}
html.dark .topbar-user__trigger:focus-visible,
html.dark .topbar-user__trigger:hover{border-color:var(--brand-2);box-shadow:0 0 0 1px rgba(250,166,103,0.3);}
.topbar-user__avatar{width:50px;height:50px;border-radius:14px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:var(--panel);}
html.dark .topbar-user__avatar{background:#1f2937;}
.topbar-user__avatar-img{width:100%;height:100%;object-fit:cover;border-radius:12px;}
.topbar-user__meta{display:flex;flex-direction:column;align-items:flex-start;line-height:1.1;gap:3px;min-width:0;}
.topbar-user__line{display:block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.topbar-user__line--name{font-weight:700;font-size:15px;}
.topbar-user__line--username{font-size:12px;color:var(--muted);}
html.dark .topbar-user__line--username{color:rgba(232,236,243,0.68);}
.topbar-user__line--role{font-size:12px;font-weight:600;color:var(--brand);}
html.dark .topbar-user__line--role{color:var(--brand-2);}
.topbar-user__caret{width:12px;height:12px;margin-left:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .18s ease;}
.topbar-user__trigger[aria-expanded="true"] .topbar-user__caret{transform:rotate(225deg);}
.topbar-user__menu{position:absolute;top:calc(100% + 10px);right:0;min-width:260px;padding:12px;border-radius:16px;border:1px solid var(--sep);background:var(--panel);box-shadow:var(--shadow);display:flex;flex-direction:column;gap:6px;z-index:150;}
.topbar-user__menu[hidden]{display:none;}
.topbar-user__menu.is-open{display:flex;}
html.dark .topbar-user__menu{background:#1f1f22;border-color:#3a3a40;box-shadow:0 20px 38px rgba(0,0,0,0.45);}
.topbar-user-menu__item{display:flex;align-items:center;gap:12px;width:100%;padding:10px 12px;border:none;background:transparent;text-align:left;border-radius:12px;cursor:pointer;color:inherit;text-decoration:none;transition:background .18s ease,color .18s ease;}
.topbar-user-menu__item:hover,
.topbar-user-menu__item:focus-visible{background:var(--brand-3);outline:none;}
html.dark .topbar-user-menu__item:hover,
html.dark .topbar-user-menu__item:focus-visible{background:rgba(250,166,103,0.12);}
.topbar-user-menu__icon{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:var(--orange-weak);color:var(--orange);}
html.dark .topbar-user-menu__icon{background:rgba(252,166,103,0.1);color:var(--brand-2);}
.topbar-user-menu__icon svg{width:20px;height:20px;display:block;}
.topbar-user-menu__content{display:flex;flex-direction:column;gap:3px;align-items:flex-start;min-width:0;}
.topbar-user-menu__title{font-weight:600;font-size:14px;}
.topbar-user-menu__hint{font-size:12px;color:var(--muted);line-height:1.3;}
html.dark .topbar-user-menu__hint{color:rgba(232,236,243,0.6);}
.topbar-user-menu__item--danger{color:var(--err);}
.topbar-user-menu__item--danger:hover,
.topbar-user-menu__item--danger:focus-visible{background:rgba(220,38,38,0.1);}
html.dark .topbar-user-menu__item--danger{color:#f87171;}
html.dark .topbar-user-menu__item--danger:hover,
html.dark .topbar-user-menu__item--danger:focus-visible{background:rgba(220,38,38,0.15);}

/* Notification bell */
.topbar-notifications{position:relative;display:flex;align-items:center;}
.topbar-notifications__trigger{position:relative;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:1px solid var(--sep);background:var(--panel);border-radius:12px;cursor:pointer;color:var(--text);transition:background .18s ease,border-color .18s ease;}
.topbar-notifications__trigger:hover,.topbar-notifications__trigger:focus-visible{border-color:var(--brand-2);outline:none;}
html.dark .topbar-notifications__trigger{background:#242428;border-color:#3a3a40;color:var(--text);}
html.dark .topbar-notifications__trigger:hover{border-color:var(--brand-2);}
.topbar-notifications__icon{width:20px;height:20px;}
.topbar-notifications__badge{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--err);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center;pointer-events:none;}
.topbar-notifications__dropdown{position:absolute;top:calc(100% + 8px);right:0;width:360px;max-height:420px;background:var(--panel);border:1px solid var(--sep);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,0.12);overflow:hidden;z-index:1000;display:flex;flex-direction:column;}
html.dark .topbar-notifications__dropdown{background:#1e1e22;border-color:#3a3a40;box-shadow:0 8px 24px rgba(0,0,0,0.4);}
.topbar-notifications__header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--sep);}
.topbar-notifications__title{font-weight:700;font-size:14px;}
.topbar-notifications__mark-all{font-size:12px;color:var(--brand);background:none;border:none;cursor:pointer;padding:0;}
.topbar-notifications__mark-all:hover{text-decoration:underline;}
.topbar-notifications__list{overflow-y:auto;flex:1;}
.topbar-notifications__empty{padding:24px 16px;text-align:center;color:var(--muted);font-size:13px;}
.topbar-notifications__item{display:flex;flex-direction:column;gap:2px;width:100%;padding:10px 16px;border:none;border-bottom:1px solid var(--sep);background:transparent;cursor:pointer;text-align:left;color:inherit;transition:background .12s ease;}
.topbar-notifications__item:hover{background:var(--hover);}
.topbar-notifications__item.unread{background:rgba(var(--brand-rgb,250,166,103),0.06);}
html.dark .topbar-notifications__item.unread{background:rgba(250,166,103,0.08);}
.topbar-notifications__item.unread::before{content:'';position:absolute;left:6px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:50%;background:var(--brand);}
.topbar-notifications__item{position:relative;padding-left:20px;}
.topbar-notifications__item-title{font-size:13px;font-weight:600;line-height:1.3;}
.topbar-notifications__item-body{font-size:12px;color:var(--muted);line-height:1.3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.topbar-notifications__item-time{font-size:11px;color:var(--muted);margin-top:2px;}
@media(max-width:480px){.topbar-notifications__dropdown{width:calc(100vw - 32px);right:-16px;}}

.app-topbar__login{font-weight:600;color:var(--brand);text-decoration:none;}
.app-topbar__login:hover,
.app-topbar__login:focus-visible{text-decoration:underline;}


@media (min-width:960px){
  .app-topbar{display:none;}
  .app-shell__main main.container{padding-top:24px;}
}

@media (max-width:959px){
  .app-topbar{
    position:fixed;
    padding:0 18px;
    min-height:64px;
    gap:12px;
  }
  .app-topbar::before{left:0;}
  .app-shell{padding-left:0;}
  .app-shell__main{
    width:100%;
    padding-top:var(--topbar-height, 80px);
  }
  .app-sidebar{display:none;}
  .app-topbar__right{gap:12px;}
  .app-topbar__left{margin-left:0;padding-left:0;}
  .app-topbar__logo{height:48px;max-height:52px;}
  .app-topbar__user{display:none;}
  .app-topbar__menu{display:inline-flex;}
}

@media (max-width:780px){
  .app-topbar{padding:10px 14px;}
  .app-topbar__right{gap:10px;}
  .app-topbar__user{gap:10px;}
}

/* Telas ultra-estreitas (abaixo da capa de um Z Fold/iPhone SE 1): a logo já
   encolheu o quanto dava — some de vez para preservar os controles. */
@media (max-width:300px){
  .app-topbar__brand{display:none;}
}

@media (min-width:960px){
  .mobile-nav,
  .mobile-nav-backdrop{display:none !important;}
}

.photo-gallery-filters{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;}
.photo-gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-top:8px;}
.photo-gallery-card{border:1px solid var(--sep);border-radius:12px;overflow:hidden;background:var(--panel);display:flex;flex-direction:column;min-height:240px;}
.photo-gallery-card__image{position:relative;padding-top:62%;background:var(--panel-muted);}
.photo-gallery-card__image img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}
.photo-gallery-card__meta{padding:12px;display:flex;flex-direction:column;gap:4px;}
.photo-gallery-card__meta-row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;}
.photo-gallery-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;flex-wrap:wrap;}
.photo-gallery-card__download{display:inline-flex;align-items:center;gap:6px;margin-top:4px;padding:6px 12px;border:1px solid var(--sep);border-radius:8px;background:var(--panel);color:var(--fg);font-size:13px;cursor:pointer;transition:background .15s,border-color .15s;}
.photo-gallery-card__download:hover{background:var(--panel-muted);border-color:var(--fg-muted);}
.photo-download-options{display:flex;gap:16px;justify-content:center;flex-wrap:wrap;}
.photo-download-option{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px;border:1px solid var(--sep);border-radius:12px;background:var(--panel);cursor:pointer;transition:border-color .15s,box-shadow .15s;min-width:100px;}
.photo-download-option:hover{border-color:var(--brand);box-shadow:0 0 0 2px color-mix(in srgb,var(--brand) 20%,transparent);}
.photo-download-option:disabled{opacity:.5;cursor:default;box-shadow:none;}
.photo-download-option__preview{width:80px;overflow:hidden;border-radius:6px;background:var(--panel-muted);}
.photo-download-option__preview img{width:100%;height:100%;object-fit:cover;}
.photo-download-option__label{font-size:13px;font-weight:500;color:var(--fg);}
