
/* ===== TNPSC Group 4 – Thanjavur District Administration portal theme ===== */
:root {
  --tn-blue: #003366;
  --tn-blue2: #0a4a82;
  --tn-green: #138808;
  --tn-bg: #f2f5f9;
  --tn-muted: #5d6b7a;
  --tn-line: #dbe3ec;
  --tn-soft: #e8f0f8;
  --tn-amber: #e08a00;
  --tn-red: #c0392b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, "Nirmala UI", "Noto Sans Tamil",
    Latha, Arial, sans-serif;
  background: var(--tn-bg);
  color: #1b2733;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.tn-main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.tn-tricolor {
  height: 5px;
  background: linear-gradient(90deg, #ff9933 33%, #fff 33% 66%, #138808 66%);
}

.tn-header {
  background: linear-gradient(90deg, var(--tn-blue), var(--tn-blue2));
  color: #fff;
  border-bottom: 4px solid var(--tn-green);
}

.tn-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  max-width: 1500px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.tn-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.tn-seal {
  width: 60px;
  height: 66px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  flex: 0 0 auto;
}

.tn-brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.25;
}

.tn-brand span {
  display: block;
  font-size: 12.5px;
  opacity: 0.9;
}

.tn-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.tn-logout {
  background: var(--tn-red);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
}

.tn-logout:hover {
  filter: brightness(1.1);
}

/* ===== Admin layout ===== */

.tn-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px;
  width: 100%;
  flex: 1;
  align-items: start;
}

.tn-sidebar {
  background: var(--tn-blue);
  color: #fff;
  border-radius: 12px;
  padding: 10px;
  align-self: start;
  position: sticky;
  top: 12px;
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.12);
}

.tn-sidebar-heading {
  color: #cbdced;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  padding: 12px 12px 10px;
}

.tn-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tn-sidebar-link,
.tn-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.93;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.tn-sidebar-link:hover,
.tn-sidebar a:hover {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.tn-sidebar-link.active,
.tn-sidebar a.active {
  background: var(--tn-green);
  opacity: 1;
  font-weight: 600;
}

.tn-sidebar-icon {
  width: 22px;
  min-width: 22px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.tn-sidebar-link.tn-sidebar-logout,
.tn-sidebar a.tn-side-logout {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0 0 7px 7px;
  padding-top: 15px;
}

.admin-page {
  width: 100%;
}

.admin-placeholder {
  margin-top: 12px;
  line-height: 1.7;
}

.admin-placeholder p {
  color: var(--tn-muted);
}

.tn-footer {
  background: var(--tn-blue);
  color: #fff;
  text-align: center;
  padding: 18px;
  font-size: 13px;
  line-height: 1.7;
  border: 0;
  box-shadow: none;
  margin: 0;
  width: 100%;
}

footer.tn-footer p {
  margin: 0;
  color: #fff;
}

.flash-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 18px;
}

.flash {
  padding: 11px 14px;
  border-radius: 7px;
  margin: 8px 0 14px;
  background: var(--tn-soft);
  border-left: 4px solid var(--tn-blue2);
}

.flash.success {
  background: #e8f6e8;
  border-left-color: var(--tn-green);
}

.flash.error {
  background: #fdecea;
  border-left-color: var(--tn-red);
}

.flash.warning {
  background: #fff4df;
  border-left-color: var(--tn-amber);
}

/* ===== Active and inactive status indicators ===== */

.status-badge.status-active::before,
.status-pill.status-active::before,
.status.active::before,
.status-badge.status-inactive::before,
.status-pill.status-inactive::before,
.status.inactive::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.status-badge.status-active::before,
.status-pill.status-active::before,
.status.active::before {
  background: var(--tn-green);
}

.status-badge.status-inactive::before,
.status-pill.status-inactive::before,
.status.inactive::before {
  background: var(--tn-amber);
}

.tn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.tn-dot.on {
  background: var(--tn-green);
}

.tn-dot.off {
  background: var(--tn-amber);
}

/* ===== Login page ===== */

.tn-login {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
  width: 100%;
}

.tn-login-banner {
  background: linear-gradient(135deg, #003366, #0a6a8f 65%, #138808);
  color: #fff;
  border-radius: 12px;
  padding: 34px;
  text-align: center;
}

.tn-login-banner img {
  width: 130px;
  height: 140px;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  object-fit: contain;
}

.tn-login-banner h1 {
  font-size: 27px;
  margin: 14px 0 4px;
  color: #fff;
}

.tn-login-banner p {
  margin: 4px 0;
  font-size: 17px;
  color: #fff;
}

.tn-login-banner .tag {
  margin-top: 14px;
  color: #d9f2d6;
  letter-spacing: 1px;
  font-size: 16px;
}

.tn-login-card {
  background: #fff;
  border: 1px solid var(--tn-line);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 4px rgba(0, 51, 102, 0.08);
}

.tn-login-card h2 {
  margin: 0 0 6px;
  color: var(--tn-blue);
  font-size: 19px;
}

.tn-login-card label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tn-muted);
  margin: 12px 0 4px;
}

.tn-login-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--tn-line);
  border-radius: 6px;
  background: var(--tn-bg);
  font: inherit;
}

.tn-login-card button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 0;
  border-radius: 6px;
  background: #1d4ed8;
  color: #fff;
  font: 600 14px "Segoe UI", sans-serif;
  cursor: pointer;
}

.tn-login-card button:hover {
  filter: brightness(1.08);
}

.tn-example {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--tn-soft);
  border-left: 4px solid var(--tn-green);
  font-size: 13px;
  line-height: 1.7;
}

/* ===== Admin dashboard ===== */

.tn-dash {
  max-width: 1300px;
  margin: 0 auto;
  padding: 6px 6px 30px;
}

.tn-dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tn-dash-head h1 {
  margin: 0 0 4px;
  color: var(--tn-blue);
  font-size: 27px;
}

.tn-dash-head p {
  margin: 0;
  color: var(--tn-muted);
}

.tn-btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 7px;
  background: #1d4ed8;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-left: 4px;
}

.tn-btn:hover {
  filter: brightness(1.08);
}

.tn-btn.alt {
  background: var(--tn-soft);
  color: var(--tn-blue);
}

.tn-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.tn-card {
  background: #fff;
  border: 1px solid var(--tn-line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 51, 102, 0.08);
  transition: 0.2s;
  color: inherit;
  text-decoration: none;
  display: block;
}

a.tn-card:hover {
  box-shadow: 0 8px 20px rgba(0, 51, 102, 0.18);
  transform: translateY(-2px);
}

.tn-card small {
  color: var(--tn-muted);
}

.tn-card .n {
  font-size: 32px;
  font-weight: 700;
  color: var(--tn-blue);
}

.tn-card .h {
  font-size: 12.5px;
  color: #1d4ed8;
}

.tn-card.c1 {
  border-top: 3px solid #1d4ed8;
}

.tn-card.c2 {
  border-top: 3px solid var(--tn-green);
}

.tn-card.c3 {
  border-top: 3px solid #7c3aed;
}

.tn-card.c4 {
  border-top: 3px solid var(--tn-amber);
}

.tn-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.tn-card h2 {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--tn-blue);
}

.tn-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--tn-line);
  font-size: 14px;
}

.tn-row:last-child {
  border: 0;
}

.tn-empty {
  color: var(--tn-muted);
  padding: 10px 0;
}

.tn-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 140px;
  margin-top: 22px;
}

.tn-bars div {
  flex: 1;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(#1d4ed8, #6fa0f0);
  position: relative;
  min-height: 3px;
}

.tn-bars div:nth-child(even) {
  background: linear-gradient(#138808, #5cbf50);
}

.tn-bars span {
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--tn-muted);
}

/* ===== Logout confirmation modal ===== */

.tn-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.tn-modal[hidden] {
  display: none !important;
}

.tn-modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 22px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.tn-modal-card h3 {
  margin: 0 0 8px;
  color: var(--tn-blue);
}

.tn-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.tn-modal-actions button,
.tn-modal-actions a {
  padding: 9px 18px;
  border-radius: 6px;
  border: 0;
  font: 600 14px "Segoe UI", sans-serif;
  cursor: pointer;
  text-decoration: none;
}

#tn-cancel {
  background: var(--tn-soft);
  color: var(--tn-blue);
}

#tn-confirm {
  background: var(--tn-red);
  color: #fff;
}

/* ===== Responsive layout ===== */

@media (max-width: 900px) {
  .tn-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tn-grid2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .tn-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .tn-sidebar {
    position: static;
    padding: 8px;
  }

  .tn-sidebar-heading {
    padding: 7px 10px;
  }

  .tn-sidebar-nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tn-sidebar-link,
  .tn-sidebar a {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 10px;
  }

  .tn-sidebar-link.tn-sidebar-logout,
  .tn-sidebar a.tn-side-logout {
    margin: 0;
    border: 0;
    padding-top: 10px;
  }

  .tn-brand strong {
    font-size: 16px;
  }

  .tn-user {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .tn-login {
    grid-template-columns: 1fr;
    margin: 14px auto;
  }
}

@media (max-width: 520px) {
  .tn-cards {
    grid-template-columns: 1fr;
  }

  .tn-header-inner {
    padding: 10px 12px;
  }

  .tn-seal {
    width: 48px;
    height: 54px;
  }

  .tn-brand {
    gap: 9px;
  }

  .tn-brand strong {
    font-size: 14px;
  }

  .tn-brand span {
    font-size: 11px;
  }

  .tn-dash {
    padding: 6px 2px 24px;
  }

  .tn-dash-head h1 {
    font-size: 23px;
  }

  .tn-login {
    padding: 0 10px;
  }

  .tn-login-banner {
    padding: 24px 16px;
  }

  .tn-login-banner h1 {
    font-size: 23px;
  }

  .tn-login-card {
    padding: 17px;
  }

  .tn-btn {
    margin: 4px 2px;
  }
}
