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

:root {
  --bg: #eef2ff;
  --surface: #ffffff;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --text: #1f2937;
  --muted: #6b7280;
  --success: #15803d;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(79, 70, 229, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
}

body {
  background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 65%);
  color: var(--text);
  min-height: 100vh;
}

.site-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.top-head-jk {
  color: var(--primary-dark);
  margin-bottom: 0.4rem;
}

.top-head {
  color: var(--muted);
  max-width: 840px;
  margin: 0 auto;
  font-size: 0.95rem;
}

.devinfo {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: var(--muted);
}

.devinfo a {
  color: #0284c7;
  text-decoration: none;
  font-weight: 600;
}

.container,
.converter-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#navigation {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.nav-link {
  display: inline-block;
  background: #e0e7ff;
  border-radius: 999px;
  min-width: 120px;
  text-align: center;
  padding: 0.7rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  background: #c7d2fe;
  transform: translateY(-1px);
}

.nav-link.active {
  background: var(--primary);
  color: #fff;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
}

.head {
  align-self: center;
  background: var(--primary-dark);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 1rem;
  margin: 0.25rem 0;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-size: 0.95rem;
  font-weight: 600;
}

#required {
  color: #dc2626;
}

input,
select,
button {
  border-radius: 12px;
  border: 1px solid #c7d2fe;
  padding: 0.75rem 0.8rem;
  font-size: 0.95rem;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

#calBtn,
#shareBtn,
.converter-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

#calBtn:hover,
#shareBtn:hover,
.converter-btn:hover {
  background: var(--primary-dark);
}

#calBtn,
.converter-btn {
  margin-top: 0.25rem;
}

#shareBtn {
  margin-top: 0.8rem;
}

.rent,
.other-rent {
  display: grid;
}

.all-tables,
#rent-tables {
  display: none;
  flex-direction: column;
  width: min(92vw, 760px);
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#reset,
#Newreset {
  align-self: flex-end;
  border: none;
  background: #e5e7eb;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.result {
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.table,
.rent-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
}

.table th,
.table td,
.rent-table th,
.rent-table td {
  border: 1px solid #d1d5db;
  padding: 0.65rem;
  text-align: center;
}

.table th,
.rent-table th {
  background: #eef2ff;
}

#totalAmountPaid {
  color: var(--success);
  font-weight: 700;
}

#backgroundOverlay,
#backgroundOverlayNew {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.35);
  backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.converter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.converter-results {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.result-box {
  background: var(--surface);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 0.9rem;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.08);
}

.result-box p {
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.result-box h3 {
  font-size: 1.15rem;
}

@media (max-width: 760px) {
  .section-grid,
  .compact-grid,
  .converter-grid,
  .converter-results {
    grid-template-columns: 1fr;
  }

  .form {
    padding: 1rem;
  }

  .top-head {
    font-size: 0.85rem;
  }
}

.logs-section {
  gap: 1rem;
}

.logs-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.logs-table-wrap {
  overflow: auto;
  width: 100%;
}

#logsTable {
  width: 100%;
  min-width: 920px;
}

#logsTable pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
}
