:root {
  --bg: #020817;
  --panel: rgba(15, 23, 42, 0.76);
  --sidebar: rgba(7, 18, 37, 0.94);
  --border: rgba(148, 163, 184, 0.18);
  --blue: #2563eb;
  --blue-soft: #3b82f6;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --red-strong: #dc2626;
  --text: #ffffff;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.24), transparent 44%),
    linear-gradient(135deg, #010713, #06152a 70%, #020817);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  padding: 52px 18px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(2, 8, 23, 0.18), rgba(2, 8, 23, 0.36)),
    url("img/background login.png") center / cover no-repeat;
}

.login-shell {
  width: min(760px, 100%);
  display: grid;
  gap: 28px;
  justify-items: center;
}

.login-logo {
  width: min(640px, 90vw);
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.55));
}

.official-logo {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.45));
}

.app-title {
  display: flex;
  align-items: center;
  gap: 24px;
  text-align: left;
}

.parking-mark {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  color: #60a5fa;
  font: 700 52px/1 Poppins, sans-serif;
  border: 3px solid #3b82f6;
  border-radius: 18px;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.45);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Poppins, Inter, sans-serif;
  letter-spacing: 0;
}

.app-title h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.app-title span,
.brand span {
  color: var(--blue-soft);
}

.app-title p,
.form-heading p,
.view-header p,
.dialog-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-card,
.panel,
.record-dialog form {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-card {
  width: min(740px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border-radius: 26px;
}

.form-heading {
  text-align: center;
  margin-bottom: 28px;
}

.form-heading h2 {
  font-size: 32px;
}

.field {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-weight: 500;
}

.field + .field {
  margin-top: 18px;
}

input,
select {
  width: 100%;
  color: var(--text);
  background: rgba(2, 8, 23, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  outline: none;
  min-height: 52px;
  padding: 0 16px;
}

input:focus,
select:focus {
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.password-row,
.plate-row,
.search-input {
  position: relative;
  display: flex;
  align-items: center;
}

.password-row input,
.plate-row input {
  padding-right: 52px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
}

.password-row .icon-button,
.plate-row .icon-button {
  position: absolute;
  right: 5px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: #fff;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.3);
}

.primary-button:hover {
  filter: brightness(1.08);
}

.secondary-button,
.ghost-button {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--border);
}

.danger-button {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fecaca;
}

.full {
  width: 100%;
  margin-top: 22px;
  min-height: 62px;
  font-size: 18px;
}

.form-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #fecaca;
}

.login-hint {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.login-hint span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(2, 8, 23, 0.42);
}

.app-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}

.brand img {
  width: 205px;
  max-width: 100%;
}

.brand p {
  margin: 14px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.side-nav {
  display: grid;
  gap: 12px;
  margin-top: 38px;
}

.nav-item,
.bottom-item,
.logout-button {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  background: transparent;
  border: 0;
}

.nav-item {
  min-height: 58px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  text-align: left;
}

.nav-item img,
.bottom-item img,
.logout-button img,
.search-input img {
  width: 22px;
  height: 22px;
  filter: invert(1);
  opacity: 0.86;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(37, 99, 235, 0.18);
  box-shadow: inset 3px 0 0 #2f8cff;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 18px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
}

.avatar {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  color: white;
  font-weight: 800;
}

.profile-card strong,
.profile-card span,
.profile-card small {
  display: block;
}

.profile-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.profile-card small {
  margin-top: 8px;
  color: var(--muted);
}

.profile-card i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.logout-button {
  padding: 10px 8px;
  font-weight: 700;
}

.content-shell {
  min-width: 0;
  padding: clamp(22px, 4vw, 44px);
}

.mobile-header {
  display: none;
}

.mobile-menu {
  position: absolute;
  left: 14px;
  top: 72px;
  z-index: 30;
  width: min(250px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 18, 37, 0.98);
  box-shadow: var(--shadow);
}

.mobile-menu button {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
}

.mobile-menu button:hover {
  background: rgba(37, 99, 235, 0.18);
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.view-header h2 {
  font-size: clamp(32px, 5vw, 46px);
}

.view-header .primary-button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel {
  border-radius: 20px;
  padding: clamp(16px, 3vw, 26px);
}

.table-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.table-tools label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.table-tools select {
  width: 84px;
}

.compact {
  width: min(290px, 100%);
}

.search-input img {
  position: absolute;
  left: 14px;
}

.search-input input {
  padding-left: 46px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

th,
td {
  padding: 18px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
}

td {
  color: #f8fafc;
  font-size: 14px;
}

.table-footer {
  margin: 18px 0 0;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid currentColor;
}

.badge.valid {
  color: var(--green);
  background: rgba(34, 197, 94, 0.13);
}

.badge.warning {
  color: var(--orange);
  background: rgba(245, 158, 11, 0.14);
}

.badge.danger {
  color: var(--red);
  background: rgba(239, 68, 68, 0.14);
}

.badge.expired {
  color: #ff6b6b;
  background: rgba(220, 38, 38, 0.2);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.mobile-records {
  display: none;
}

.parking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  align-items: start;
}

.parking-table {
  min-width: 760px;
}

.map-side-panel h3 {
  font-size: 22px;
}

.map-side-panel p {
  margin: 8px 0 16px;
  color: var(--muted);
}

.map-canvas {
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 35% 30%, rgba(37, 99, 235, 0.2), transparent 36%),
    rgba(2, 8, 23, 0.72);
}

.large-map {
  min-height: min(68vh, 720px);
}

.picker-map {
  min-height: 320px;
}

.leaflet-container {
  font-family: Inter, sans-serif;
  background: #0f172a;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0f172a;
  color: var(--text);
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}

.ro-plate {
  position: absolute;
  left: 0;
  width: 44px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px 0 0 14px;
  background: #0758ce;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.plate-row input {
  padding-left: 58px;
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 28px;
  align-items: start;
}

.details-list {
  display: grid;
  gap: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.detail-row span:first-child {
  color: var(--muted);
}

.status-card {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 18px;
  padding: 26px;
  border: 1px solid;
}

.status-card.valid {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}

.status-card.expired,
.status-card.missing {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.12);
}

.status-icon {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid currentColor;
  font-size: 52px;
  line-height: 1;
}

.status-card.valid {
  color: var(--green);
}

.status-card.expired,
.status-card.missing {
  color: #ff5b5b;
}

.text-red {
  color: #ff6b6b;
}

.status-card h3 {
  font-size: 30px;
}

.status-card p {
  color: #e2e8f0;
}

.days-big {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(2, 8, 23, 0.28);
  color: inherit;
}

.days-big strong {
  display: block;
  font-size: 40px;
  font-family: Poppins, Inter, sans-serif;
}

.bottom-nav {
  display: none;
}

.record-dialog {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
}

.record-dialog::backdrop {
  background: rgba(2, 8, 23, 0.76);
  backdrop-filter: blur(6px);
}

.record-dialog form {
  padding: 24px;
  border-radius: 22px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.dialog-header h3 {
  font-size: 26px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .field + .field {
  margin-top: 0;
}

.wide {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .login-screen {
    min-height: 100svh;
    padding: 14px;
    align-items: center;
  }

  .login-shell {
    gap: 12px;
  }

  .login-logo {
    width: min(250px, 78vw);
    max-height: 80px;
    object-fit: contain;
  }

  .app-title {
    gap: 10px;
  }

  .app-title h1 {
    font-size: 26px;
  }

  .app-title p {
    display: none;
  }

  .parking-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 26px;
  }

  .login-card {
    padding: 16px;
    border-radius: 18px;
  }

  .form-heading {
    margin-bottom: 14px;
  }

  .form-heading h2 {
    font-size: 24px;
  }

  .form-heading p {
    font-size: 13px;
  }

  .field {
    gap: 6px;
    font-size: 13px;
  }

  .field + .field {
    margin-top: 10px;
  }

  input,
  select {
    min-height: 44px;
    border-radius: 12px;
  }

  .full {
    min-height: 48px;
    margin-top: 10px;
  }

  .form-error {
    min-height: 18px;
    margin-top: 6px;
    font-size: 12px;
  }

  .app-screen {
    grid-template-columns: 1fr;
    padding-bottom: 78px;
  }

  .sidebar {
    display: none;
  }

  .content-shell {
    padding: 18px 14px;
  }

  .mobile-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
  }

  .mobile-header img {
    width: 160px;
  }

  .view-header {
    align-items: stretch;
  }

  .view-header .primary-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    justify-content: center;
    font-size: 0;
    border-radius: 12px;
    aspect-ratio: 1;
  }

  .view-header .primary-button span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 28px;
    line-height: 1;
  }

  .table-tools {
    align-items: stretch;
  }

  .table-tools label span {
    display: none;
  }

  .compact {
    flex: 1;
  }

  .table-wrap {
    display: none;
  }

  .mobile-records {
    display: grid;
    gap: 12px;
  }

  .mobile-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.74);
    border: 1px solid var(--border);
  }

  .mobile-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-card strong {
    display: block;
    font-size: 16px;
  }

  .mobile-card small {
    color: var(--muted);
  }

  .mobile-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 10px 10px;
    background: rgba(2, 8, 23, 0.94);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(18px);
  }

  .bottom-item {
    min-height: 56px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
  }

  .bottom-item.active {
    color: var(--blue-soft);
  }

  .search-panel,
  .result-panel,
  .parking-layout {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    min-height: 330px;
  }

  .large-map {
    min-height: calc(100svh - 220px);
  }

  .search-panel .primary-button {
    width: 100%;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 620px) {
  .app-title {
    text-align: center;
  }

  .login-card,
  .panel {
    border-radius: 18px;
  }

  .login-logo {
    width: min(220px, 72vw);
  }

  .app-title h1 {
    font-size: 23px;
  }

  .parking-mark {
    width: 42px;
    height: 42px;
    font-size: 23px;
  }

  .table-tools {
    flex-direction: row;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}
