/* ============================================================
   DRPA Veículos — Redesign v4 (minimal, conflict-free)

   RULES:
   - NO broad DataTables overrides (handled by customDT.css + DT BS5 CSS)
   - NO .dt-button, table.dataTable thead/tbody, .paginate_button,
     .dtsb-*, .dtsp-* selectors — let native DT+BS5 CSS handle them
   - Only page-layout, navbar, login, home, profile, footer,
     and well-scoped modal/editor-lightbox styles
   ============================================================ */

/* ======================= 0. VARIABLES ======================= */
:root {
  --navy-darkest: #0a1120;
  --navy-dark: #0f1b2d;
  --navy: #11193d;
  --navy-mid: #1a2332;
  --navy-light: #243352;
  --navy-muted: #30418f;
  --gold: #d4a843;
  --gold-light: #e8c96e;
  --gold-dark: #b8922e;
  --gold-bg: rgba(212,168,67,.08);
  --gold-border: rgba(212,168,67,.25);
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --text-dark: #1a1a2e;
  --text-body: #333333;
  --text-muted: #6c757d;
  --danger: #dc3545;
  --success: #28a745;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --shadow-card: 0 2px 12px rgba(0,0,0,.08);
  --tr: .2s ease;
  --font: 'Inter',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,sans-serif;
}

/* ===================== 1. GLOBAL RESET ====================== */
*,*::before,*::after { box-sizing: border-box }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased }
body, button, input, select, textarea { font-family: var(--font) }
body {
  background: #435165; margin: 0; padding: 0;
  min-height: 100vh; display: flex; flex-direction: column;
  color: var(--text-body); line-height: 1.6;
}
body.loggedin { background: var(--gray-100) }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--text-dark) }

/* =================== 2. CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; height: 8px }
::-webkit-scrollbar-track { background: var(--gray-200); border-radius: 4px }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 4px }
::-webkit-scrollbar-thumb:hover { background: var(--navy) }

/* ======================== 3. LOADER ========================= */
#loader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--navy-darkest); z-index: 99999999999;
  display: flex; align-items: center; justify-content: center;
}
.AGE {
  display: flex; justify-content: center; align-items: center;
  height: 100vh; animation: AGE ease-in-out 1s infinite alternate;
}
.AGE img { filter: drop-shadow(0 0 30px rgba(212,168,67,.3)) }

/* ======================= 4. NAVBAR ========================== */
.navtop {
  background: rgba(15,27,45,.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  height: 64px; width: 100%; border: 0;
  border-bottom: 1px solid rgba(212,168,67,.15);
  position: sticky; top: 0; z-index: 10000;
}
.navtop div {
  display: flex; align-items: center;
  margin: 0 auto; max-width: 1400px; width: 100%; height: 100%;
  padding: 0 24px;
}
.navtop div img {
  height: 38px; width: auto; margin-right: 16px;
  filter: drop-shadow(0 0 8px rgba(212,168,67,.25)); flex-shrink: 0;
}
.navtop div a {
  position: relative; padding: 0 16px; text-decoration: none;
  color: rgba(255,255,255,.7); font-weight: 500; font-size: 14px;
  height: 100%; display: inline-flex; align-items: center;
  transition: color var(--tr); white-space: nowrap;
}
.navtop div a i { font-size: 13px; padding: 0 7px 0 0; opacity: .7; transition: opacity var(--tr) }
.navtop div a::after {
  content: ''; position: absolute; bottom: 0; left: 16px; right: 16px;
  height: 2px; background: var(--gold); border-radius: 2px 2px 0 0;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.navtop div a:hover { color: #fff }
.navtop div a:hover i { opacity: 1 }
.navtop div a:hover::after { transform: scaleX(1) }

/* --- Hamburger menu --- */
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; margin-left: auto; flex-direction: column;
  justify-content: center; gap: 5px; z-index: 10;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: #fff;
  border-radius: 2px; transition: all .3s ease; pointer-events: none;
}
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px) }
.nav-hamburger.active span:nth-child(2) { opacity: 0 }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px) }
/* Desktop: wrapper is invisible */
.nav-links { display: contents }

/* ================ 5. LOGIN / REGISTER FORMS ================= */
.login, .register {
  width: 420px; background: var(--white); box-shadow: var(--shadow-lg);
  margin: 80px auto; border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--gray-200);
}
.login img, .register img {
  max-width: 180px; height: auto; display: block;
  margin: 32px auto 8px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.1));
}
.login h1, .register h1 {
  text-align: center; color: var(--navy); font-size: 20px;
  padding: 20px 0 16px; border-bottom: 1px solid var(--gray-200);
}
.login .links, .register .links {
  display: flex; padding: 0; border-bottom: 1px solid var(--gray-200);
}
.login .links a, .register .links a {
  color: var(--gray-500); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 1; padding: 14px 10px; font-weight: 600; font-size: 14px;
  border-bottom: 3px solid transparent; height: auto; background: none;
  transition: color var(--tr);
}
.login .links a:hover, .register .links a:hover { color: var(--navy) }
.login .links a.active, .register .links a.active {
  border-bottom-color: var(--gold); color: var(--navy);
}
.login form, .register form {
  display: flex; flex-wrap: wrap; justify-content: center;
  padding: 24px 24px 8px;
}
.login form label:not(#rememberme), .register form label:not(#rememberme) {
  display: flex; justify-content: center; align-items: center;
  width: 44px; height: 48px; background: var(--navy); color: #fff;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.login form input[type="password"],
.login form input[type="text"],
.login form input[type="email"],
.register form input[type="password"],
.register form input[type="text"],
.register form input[type="email"] {
  width: calc(100% - 44px); height: 48px;
  border: 1px solid var(--gray-300); border-left: 0;
  margin-bottom: 16px; padding: 0 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px; outline: 0;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.login form input:focus, .register form input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-border);
}
.login form input[type="submit"], .register form input[type="submit"] {
  width: 100%; padding: 14px; margin: 8px 0 16px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border: 0; cursor: pointer; font-weight: 600; color: #fff;
  transition: all var(--tr); border-radius: var(--radius-sm); appearance: none;
}
.login form input[type="submit"]:hover, .register form input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--navy-light), var(--navy-muted));
  box-shadow: 0 4px 12px rgba(17,25,61,.3); transform: translateY(-1px);
}
.login form #rememberme, .register form #rememberme {
  width: 100%; height: auto; padding: 4px 0; background: none;
  color: var(--text-body); justify-content: flex-start;
  font-size: 13px; display: flex; align-items: center;
}
.login form #rememberme input, .register form #rememberme input {
  transform: scale(1.2); margin-right: 8px; accent-color: var(--gold);
}
.login form .msg, .register form .msg {
  padding: 4px 0; width: 100%; font-size: 13px; color: var(--danger); min-height: 20px;
}
.login form .msg a, .register form .msg a { color: var(--gold); text-decoration: underline }
.login form > a, .register form > a {
  text-decoration: none; color: var(--gray-600); width: 100%; padding: 4px 0; font-size: 13px;
}
.login form > a:hover, .register form > a:hover { color: var(--gold) }
.login form .captcha, .register form .captcha {
  display: flex; width: 100%; gap: 12px; margin-bottom: 12px; align-items: center;
}
.login p, .register p {
  padding: 20px 24px; font-size: 14px; color: var(--text-muted); line-height: 1.5;
}

/* ================== 6. CONTENT (LOGGED IN) ================== */
.content {
  max-width: 1200px; width: 100%; margin: 0 auto; padding: 32px 24px;
}
.content h2 {
  margin: 0; padding: 0 0 20px; font-size: 22px;
  border-bottom: 2px solid var(--gray-200); color: var(--navy);
}
.content .block {
  box-shadow: var(--shadow-card); margin: 24px 0; padding: 28px;
  background: var(--white); border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.content .block p {
  padding: 4px 0; margin: 0 0 8px; font-size: 15px;
  color: var(--text-body); line-height: 1.7;
}

/* ======================= 7. HOME ============================ */
.home-hero { display: flex; flex-direction: column; gap: 24px }
.home-greeting-card {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy) 60%, var(--navy-light));
  border-radius: var(--radius-lg); padding: 20px 32px; color: #fff;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(212,168,67,.1);
  display: flex; align-items: center; gap: 8px;
}
.home-greeting-card::before {
  content: ''; position: absolute; top: -60%; right: -10%;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(212,168,67,.1), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.home-greeting-card .greeting-time {
  font-size: 20px; color: var(--gold); font-weight: 600;
}
.home-greeting-card .greeting-name {
  font-size: 20px; font-weight: 700; color: #fff; margin: 0; line-height: 1.3;
}
.home-info-card {
  background: var(--white); border-radius: var(--radius-md);
  padding: 28px 32px; box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200); border-left: 4px solid var(--gold);
}
.home-info-card p { font-size: 15px; color: var(--text-body); line-height: 1.8; margin: 0 }
.home-info-card strong { color: var(--navy); font-size: 17px; display: block; margin-bottom: 12px }
footer.footer-distributed { margin-top: auto }

/* ======================== 8. PROFILE ======================== */
.content.profile { max-width: 800px }
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--gold); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--gold-border);
}
.profile-header-info h3 { font-size: 20px; color: var(--navy); margin: 0 0 2px }
.profile-header-info span { font-size: 13px; color: var(--text-muted); font-weight: 500 }
.content.profile .profile-detail {
  display: flex; align-items: center; padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}
.content.profile .profile-detail:last-of-type { border-bottom: 0 }
.content.profile .profile-detail strong {
  display: inline-block; color: var(--text-muted); min-width: 140px;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.content.profile .profile-btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; border: 2px solid var(--navy); cursor: pointer;
  color: #fff; background: linear-gradient(135deg, var(--navy), var(--navy-light));
  margin: 24px 0 0; padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; transition: all var(--tr); appearance: none;
}
.content.profile .profile-btn:hover {
  background: var(--gold); border-color: var(--gold); color: var(--navy);
  box-shadow: 0 4px 12px rgba(212,168,67,.3); transform: translateY(-1px);
}
.content.profile form label {
  display: block; padding: 14px 0 6px; font-weight: 600; font-size: 13px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
}
.content.profile form input[type="text"],
.content.profile form input[type="password"],
.content.profile form input[type="email"] {
  padding: 12px 14px; width: 100%; max-width: 400px;
  border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 14px; outline: 0;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.content.profile form input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-border);
}

/* ===== 9. VISUALIZADOR — ONLY layout, no DT overrides ======= */
.all-section { overflow: hidden; padding: 16px 0 0 }
#Expropriacoes .containerTable { margin: auto; width: 96%; max-width: 1600px }

/* ===== 10. DETAILS MODAL (#myModal — Bootstrap 5) =========== */
/* Backdrop */
.modal-backdrop { background-color: rgba(10,17,32,.6) !important }
/* Prevent any page-level animation from hitting modal elements */
.modal, .modal-backdrop { animation: none !important }

#myModal .modal-content {
  border-radius: var(--radius-md); border: none;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
#myModal .modal-header {
  background: var(--navy); color: #fff;
  border-bottom: 2px solid var(--gold); padding: 16px 20px;
}
#myModal .modal-header .modal-title { color: #fff; font-weight: 700; font-size: 18px }
#myModal .modal-header .btn-close { filter: invert(1); opacity: .8 }
#myModal .modal-header .btn-close:hover { opacity: 1 }
#myModal .modal-body { padding: 0; max-height: 70vh; overflow-y: auto }
#myModal .modal-footer {
  border-top: 1px solid var(--gray-200); padding: 12px 20px;
  background: var(--gray-50);
}
#myModal .modal-footer .btn-primary {
  background: var(--navy); border-color: var(--navy);
  border-radius: var(--radius-sm); font-weight: 600; padding: 8px 20px;
}
#myModal .modal-footer .btn-primary:hover {
  background: var(--gold); border-color: var(--gold); color: var(--navy);
}
#myModal .modal-footer .btn-secondary {
  border-radius: var(--radius-sm); font-weight: 600; padding: 8px 20px;
}

/* Detail table inside modal */
table#modal-table { width: 100%; border-collapse: collapse }
table#modal-table tr { border-bottom: 1px solid var(--gray-200) }
table#modal-table tr:last-child { border-bottom: 0 }
table#modal-table tr:nth-child(even) { background: var(--gray-50) }
table#modal-table td {
  padding: 12px 16px; font-size: 14px; border: none; vertical-align: middle;
}
table#modal-table td:first-child {
  font-weight: 600; color: var(--navy); width: 35%;
  background: rgba(17,25,61,.04);
  text-transform: uppercase; font-size: 12px; letter-spacing: .03em;
}

/* ===== 11. EDITOR RESPONSIVE MODAL (.dtr-modal) ============= */
div.dtr-modal { z-index: 10001 }
div.dtr-modal-background { background: rgba(10,17,32,.6) !important }
div.dtr-modal-display {
  position: relative;
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  border: none; overflow: hidden; max-width: 700px; max-height: 85vh;
}
div.dtr-modal-content { padding: 0 }
div.dtr-modal-content h2 {
  background: var(--navy); color: #fff; margin: 0;
  padding: 16px 20px; font-size: 18px; border-bottom: 2px solid var(--gold);
}
div.dtr-modal-close {
  position: absolute !important; top: 14px !important; right: 16px !important;
  z-index: 10; color: #fff; font-size: 24px; line-height: 1;
  opacity: .9; cursor: pointer; background: none; border: 0;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--tr);
}
div.dtr-modal-close:hover { opacity: 1; color: var(--navy); background: var(--gold) }
table.dtr-details { width: 100%; border-collapse: collapse }
table.dtr-details tr { border-bottom: 1px solid var(--gray-200) }
table.dtr-details tr:nth-child(even) { background: var(--gray-50) }
table.dtr-details td { padding: 10px 16px; font-size: 13px; vertical-align: middle }
table.dtr-details td:first-child {
  font-weight: 600; color: var(--navy); width: 35%;
  text-transform: uppercase; font-size: 12px; letter-spacing: .03em;
  background: rgba(17,25,61,.03);
}

/* ================ 12. FOOTER ================================ */
footer { width: 100%; margin-top: auto }
.footer-distributed {
  background: linear-gradient(180deg, var(--navy), var(--navy-darkest));
  border-top: 2px solid var(--gold);
  width: 100%; text-align: left; padding: 48px 40px 36px;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right { display: inline-block; vertical-align: top }
.footer-distributed .footer-left { width: 40% }
.footer-distributed h3 { color: #fff; font-size: 18px; margin: 0 }
.footer-distributed .footer-links { color: #fff; margin: 16px 0; padding: 0 }
.footer-distributed .footer-links a {
  display: inline-block; font-weight: 400; text-decoration: none;
  color: inherit; font-size: 14px; transition: color var(--tr);
}
.footer-distributed .footer-links a:hover { color: var(--gold) }
.footer-distributed .footer-company-name { color: var(--gray-600); font-size: 13px }
.footer-distributed .footer-center { width: 35% }
.footer-distributed .footer-center i {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  color: var(--gold); font-size: 20px; width: 40px; height: 40px;
  border-radius: 50%; text-align: center; line-height: 40px;
  margin: 8px 12px; vertical-align: middle; transition: all var(--tr);
}
.footer-distributed .footer-center i:hover { background: var(--gold); color: var(--navy) }
.footer-distributed .footer-center i.fa-envelope { font-size: 16px; line-height: 40px }
.footer-distributed .footer-center p {
  display: inline-block; color: rgba(255,255,255,.85);
  font-weight: 400; vertical-align: middle; margin: 0; font-size: 14px;
}
.footer-distributed .footer-center p span {
  display: block; font-size: 13px; line-height: 2; color: rgba(255,255,255,.6);
}
.footer-distributed .footer-center p a { color: var(--gold) !important }
.footer-distributed .footer-center p a:hover { color: var(--gold-light) !important }
.footer-distributed .footer-links a:before {
  content: "|"; font-weight: 300; font-size: 18px;
  color: rgba(255,255,255,.2); display: inline-block; padding-right: 5px;
}
.footer-distributed .footer-links .link-1:before { content: none }
.footer-distributed .footer-right { width: 20% }
.footer-distributed .footer-company-about {
  line-height: 20px; color: rgba(255,255,255,.5); font-size: 13px;
}
.footer-distributed .footer-company-about span {
  display: block; color: #fff; font-size: 12px; font-weight: 700;
  margin-bottom: 16px; text-transform: uppercase; letter-spacing: .08em;
}
.footer-distributed .footer-icons { margin-top: 20px }
.footer-distributed .footer-icons a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%; font-size: 16px; color: rgba(255,255,255,.7);
  margin-right: 6px; transition: all var(--tr);
}
.footer-distributed .footer-icons a:hover {
  background: var(--gold); border-color: var(--gold); color: var(--navy);
  transform: translateY(-2px);
}

/* =================== 15. RESPONSIVE ========================= */

/* Hamburger activates at 1000px (covers tablets) */
@media (max-width: 1000px) {
  .nav-hamburger { display: flex }
  .navtop { height: auto; min-height: 56px; padding: 10px 16px }
  .navtop > div { flex-wrap: wrap; padding: 0 }
  .navtop > div > img { height: 32px; margin-right: auto }
  .nav-links { display: none !important; width: 100%; flex-direction: column; padding: 8px 0; order: 3 }
  .nav-links.open { display: flex !important }
  .nav-links a {
    padding: 12px 16px !important; height: auto !important;
    width: 100%; font-size: 14px; white-space: normal;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav-links a::after { display: none !important }
  .content { padding: 16px; width: 100%; max-width: 100% }
  .content.profile form input[type="text"],
  .content.profile form input[type="password"],
  .content.profile form input[type="email"] { max-width: 100% }
  /* editor-container is now in admin/editor.html inline styles */
  #Expropriacoes .containerTable { width: 100%; padding: 0 8px }
  .home-greeting-card { padding: 16px 20px }
  .home-greeting-card .greeting-name { font-size: 18px }
  /* Editor fieldsets single column */
  #customForm fieldset { flex-basis: 100% !important }
  /* DT Editor lightbox wider on tablet */
  div.DTED_Lightbox_Wrapper { padding: 12px !important }
}

@media (max-width: 880px) {
  .footer-distributed { padding: 36px 24px }
  .footer-distributed .footer-left,
  .footer-distributed .footer-center,
  .footer-distributed .footer-right {
    display: block; width: 100%; margin-bottom: 32px; text-align: center;
  }
}

@media (max-width: 600px) {
  .login, .register { width: 94%; margin: 40px auto }
  .login img, .register img { max-width: 140px; margin: 24px auto 4px }
  .login form, .register form { padding: 20px 16px 8px }
  .home-greeting-card .greeting-name { font-size: 16px }
  .home-greeting-card .greeting-time { font-size: 16px }
  .profile-header { flex-direction: column; text-align: center }
  .content.profile .profile-detail { flex-direction: column; align-items: flex-start; gap: 4px }
  .content.profile .profile-detail strong { min-width: auto }
  div.DTED_Lightbox_Wrapper { padding: 8px !important }
}

@media (max-width: 400px) {
  .login, .register { width: 96%; margin: 24px auto; border-radius: var(--radius-md) }
  /* editor-container handled by admin inline styles */
}
