/* AGROFOCO PORTAL THEME v1 */
:root {
  --portal-navy: #071a3d;
  --portal-navy-2: #0b2c61;
  --portal-blue: #1266e8;
  --portal-cyan: #20b7d0;
  --portal-ink: #102342;
  --portal-muted: #60708a;
  --portal-line: #d7e3f2;
  --portal-surface: rgba(255, 255, 255, .96);
  --portal-shadow: 0 22px 60px rgba(5, 30, 74, .13);
  --portal-radius: 24px;
}

body.theme-public,
body.theme-client,
body.theme-admin {
  min-height: 100vh;
  color: var(--portal-ink);
  background:
    radial-gradient(circle at 91% 7%, rgba(32, 183, 208, .14), transparent 28%),
    radial-gradient(circle at 4% 96%, rgba(18, 102, 232, .1), transparent 30%),
    #f5f8fc;
  font-family: "Segoe UI", Arial, sans-serif;
}

.theme-public > header,
.theme-client .topbar,
.theme-client .bar,
.theme-admin .admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  min-height: 78px;
  padding: 12px max(24px, calc((100vw - 1220px) / 2));
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 24px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .13);
  color: #fff;
  background: linear-gradient(100deg, rgba(5, 24, 58, .98), rgba(12, 52, 102, .96));
  box-shadow: 0 12px 34px rgba(3, 20, 50, .16);
  backdrop-filter: blur(18px);
}

.theme-public > header .logo-agrofoco,
.theme-client .brand img,
.theme-client .brand-logo,
.theme-admin .brand img {
  width: 205px;
  height: 50px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.theme-public > header > p { display: none; }
.theme-public > header nav,
.theme-client .user-area,
.theme-client .topbar nav,
.theme-client .bar .back,
.theme-admin .admin-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.theme-public > header nav a,
.theme-client .topbar a:not(.brand),
.theme-client .bar a,
.theme-client .logout,
.theme-admin .admin-nav a,
.theme-admin .admin-nav button {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .06);
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s, background .2s, border-color .2s;
}

.theme-public > header nav a:hover,
.theme-public > header nav a[aria-current="page"],
.theme-client .topbar a:not(.brand):hover,
.theme-client .bar a:hover,
.theme-client .logout:hover,
.theme-admin .admin-nav a:hover,
.theme-admin .admin-nav button:hover {
  color: #fff;
  border-color: rgba(32, 183, 208, .72);
  background: linear-gradient(135deg, rgba(18, 102, 232, .82), rgba(32, 183, 208, .7));
  transform: translateY(-1px);
}

.theme-client .topbar-inner { display: contents; }
.theme-client .user-chip {
  color: #fff;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
}

.theme-public > section,
.theme-public > main,
.theme-client main,
.theme-admin main,
.theme-admin .admin-main {
  width: min(1180px, calc(100% - 34px));
  margin-inline: auto;
}

.theme-public > section {
  margin-top: clamp(30px, 5vw, 68px);
  margin-bottom: clamp(42px, 7vw, 88px);
  padding: clamp(28px, 5vw, 62px);
  border: 1px solid rgba(205, 220, 240, .9);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow);
}

.theme-public h1,
.theme-public h2,
.theme-client h1,
.theme-client h2,
.theme-admin h1,
.theme-admin h2 { color: var(--portal-navy); letter-spacing: -.035em; }

.theme-client main,
.theme-admin main,
.theme-admin .admin-main { padding-top: clamp(34px, 6vw, 66px); padding-bottom: 70px; }

.theme-client .choice,
.theme-client .property-card,
.theme-client .doc-card,
.theme-client .card,
.theme-admin .card,
.theme-admin .panel,
.theme-admin .user-card,
.theme-admin table {
  border-color: var(--portal-line);
  border-radius: 20px;
  background: var(--portal-surface);
  box-shadow: 0 15px 42px rgba(5, 30, 74, .09);
}

.theme-client button,
.theme-client .button,
.theme-client .btn,
.theme-admin button,
.theme-admin .button,
.theme-admin .btn {
  border-radius: 12px;
  font-weight: 800;
}

.theme-client input,
.theme-client select,
.theme-client textarea,
.theme-admin input,
.theme-admin select,
.theme-admin textarea {
  border-color: #cbdaf0;
  border-radius: 11px;
}

.theme-admin .admin-header { grid-template-columns: 220px 1fr; }
.theme-admin .admin-header .admin-title { color: rgba(255,255,255,.72); }

@media (max-width: 860px) {
  .theme-public > header,
  .theme-client .topbar,
  .theme-client .bar,
  .theme-admin .admin-header {
    min-height: 68px;
    padding: 9px 16px;
    grid-template-columns: 155px 1fr;
    gap: 10px;
  }
  .theme-public > header .logo-agrofoco,
  .theme-client .brand img,
  .theme-client .brand-logo,
  .theme-admin .brand img { width: 150px; height: 42px; }
  .theme-public > header nav { gap: 5px; overflow-x: auto; }
  .theme-public > header nav a { min-height: 38px; padding: 0 10px; font-size: .78rem; white-space: nowrap; }
  .theme-client .user-chip { display: none; }
  .theme-admin .admin-nav a:not(:last-child) { display: none; }
}

@media (max-width: 560px) {
  .theme-public > header { display: flex; justify-content: space-between; }
  .theme-public > header nav a { display: none; }
  .theme-public > header nav a[aria-current="page"],
  .theme-public > header nav a:last-child { display: inline-flex; }
  .theme-public > section { width: calc(100% - 24px); padding: 23px; border-radius: 19px; }
}
