/* ============================================================
   DM Office West Tripura - Responsive Light Portal Design System
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --primary-navy: #0b1d51;
  --primary-navy-dark: #071233;
  --accent-gold: #c8952a;
  --accent-gold-hover: #b08120;
  --bg-page: #f0f4f8;
  --bg-card: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --shadow-card: 0 4px 20px rgba(11, 29, 81, 0.07);
  --shadow-hover: 0 8px 25px rgba(11, 29, 81, 0.12);
  --radius-card: 18px;
  --radius-pill: 30px;
  --radius-input: 10px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* ============================================================
   HEADER BANNERS & NAVBARS
   ============================================================ */
.header-banner {
  background: linear-gradient(135deg, var(--primary-navy-dark) 0%, var(--primary-navy) 100%);
  color: #ffffff;
  padding: 28px 20px 24px;
  text-align: center;
  position: relative;
  border-bottom: 4px solid var(--accent-gold);
}

.emblem-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--accent-gold);
  border-radius: 50%;
  margin: 0 auto 14px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 18px rgba(200, 149, 42, 0.45);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.emblem-link:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(200, 149, 42, 0.65);
}

.emblem-link span {
  font-size: 30px;
}

.header-banner h1 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}

.header-banner p {
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Dashboard Top Navigation */
.dash-navbar {
  background: var(--primary-navy);
  color: #ffffff;
  padding: 16px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid var(--accent-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
  gap: 15px;
}

.dash-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
  transition: opacity 0.2s;
}

.dash-brand-link:hover {
  opacity: 0.9;
}

.dash-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1.5px solid #ffffff;
}

.dash-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}

.dash-subtitle {
  font-size: 0.78rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsive Mobile Navigation Bar */
@media (max-width: 640px) {
  .header-banner {
    padding: 20px 14px 18px;
  }

  .header-banner h1 {
    font-size: 1.35rem;
  }

  .header-banner p {
    font-size: 0.72rem;
  }

  .emblem-link {
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
  }

  .emblem-link span {
    font-size: 24px;
  }

  .dash-navbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 14px;
    gap: 12px;
  }
  
  .dash-brand-link {
    justify-content: center;
  }

  .dash-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .dash-actions .btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 0.76rem;
    text-align: center;
  }
}

/* ============================================================
   CONTAINERS & CARDS
   ============================================================ */
.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 30px auto;
  padding: 0 20px;
}

.form-wrapper {
  max-width: 580px;
  margin: 25px auto;
}

@media (max-width: 480px) {
  .main-wrapper {
    padding: 0 12px;
    margin: 15px auto;
  }
  
  .form-wrapper {
    margin: 15px auto;
    padding: 0 4px;
  }
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  border: 1px solid var(--border-light);
  margin-bottom: 25px;
}

@media (max-width: 480px) {
  .card {
    padding: 20px 16px;
    border-radius: 16px;
  }
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
}

.card-badge-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-navy);
  white-space: nowrap;
}

@media (max-width: 380px) {
  .card-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-top-bar .btn {
    width: 100%;
  }
}

/* ============================================================
   FORM CONTROLS & STEP BADGES WITH DIVIDERS
   ============================================================ */
.step-item {
  margin-bottom: 22px;
  padding-bottom: 10px;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
  margin-bottom: 14px;
}

.step-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
  margin-left: 6px;
}

.step-circle {
  width: 22px;
  height: 22px;
  background: var(--primary-navy);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.required {
  color: #ef4444;
}

.pill-options {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.pill-option-btn {
  flex: 1;
  padding: 11px 8px;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-input);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .pill-option-btn {
    font-size: 0.78rem;
    padding: 9px 4px;
  }
}

.pill-option-btn:hover {
  border-color: var(--primary-navy);
  color: var(--primary-navy);
}

.pill-option-btn.active {
  background: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
  box-shadow: 0 4px 10px rgba(11, 29, 81, 0.15);
}

select, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], textarea {
  width: 100%;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-input);
  color: var(--text-dark);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(200, 149, 42, 0.15);
}

select:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.75;
}

/* ============================================================
   STAR RATING SYSTEM
   ============================================================ */
.stars-container {
  text-align: center;
  padding: 10px 0;
}

.stars-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 2.6rem;
  cursor: pointer;
  user-select: none;
}

@media (max-width: 400px) {
  .stars-row {
    font-size: 2.1rem;
    gap: 8px;
  }
}

.stars-row span {
  color: #cbd5e1;
  transition: color 0.15s, transform 0.15s;
}

.stars-row span.active, .stars-row span:hover {
  color: #fbbf24;
  transform: scale(1.15);
}

.rating-caption {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
  min-height: 20px;
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-full {
  width: 100%;
  padding: 13px 24px;
  font-size: 0.95rem;
}

.btn-gold {
  background: var(--accent-gold);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(200, 149, 42, 0.3);
}

.btn-gold:hover {
  background: var(--accent-gold-hover);
  box-shadow: 0 6px 16px rgba(200, 149, 42, 0.4);
}

.btn-navy {
  background: var(--primary-navy);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(11, 29, 81, 0.2);
}

.btn-navy:hover {
  background: #162a6f;
}

.btn-outline-gold {
  background: transparent;
  border: 1.5px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-outline-gold:hover {
  background: rgba(200, 149, 42, 0.1);
}

.btn-outline-white {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-sm {
  padding: 7px 16px;
  font-size: 0.82rem;
}

/* ============================================================
   DASHBOARD FILTER BAR & GRID
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.level-pills {
  display: flex;
  gap: 8px;
}

@media (max-width: 600px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .level-pills {
    width: 100%;
  }

  .dash-pill-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 0.78rem;
    text-align: center;
  }
}

.dash-pill-btn {
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.dash-pill-btn:hover, .dash-pill-btn.active {
  background: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
}

.dash-pill-btn:disabled, .dash-pill-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--primary-navy);
  font-weight: 700;
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 50%;
  height: 3px;
  background: var(--accent-gold);
  border-radius: 2px;
}

.cumulative-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 600px) {
  .cumulative-summary-grid { grid-template-columns: 1fr; }
}

.stat-box {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.stat-box.accent-blue::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-navy);
}

.stat-box.accent-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gold);
}

.stat-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin: 6px 0 2px;
}

.stat-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Office Summary Cards */
.office-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
  margin-bottom: 35px;
}

@media (max-width: 500px) {
  .office-summary-grid {
    grid-template-columns: 1fr;
  }
}

.office-stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.office-card-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 6px;
}

.office-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
}

.score-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-navy);
}

.score-text span {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.response-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.star-rating-display {
  color: #fbbf24;
  font-size: 0.9rem;
  margin-top: 4px;
}

.card-bottom-bar {
  height: 4px;
  background: var(--primary-navy);
  border-radius: 2px;
  margin-top: 14px;
  width: 100%;
}

/* Data Table */
.data-table-container {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  border: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: auto;
}

.data-table th {
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border-light);
  background: #f8fafc;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

/* Date, Office, Rating columns stay compact and on one line */
.data-table td:nth-child(1),
.data-table td:nth-child(2),
.data-table td:nth-child(3),
.data-table th:nth-child(1),
.data-table th:nth-child(2),
.data-table th:nth-child(3) {
  white-space: nowrap;
}

/* Feedback column wraps onto multiple lines instead of truncating */
.data-table td:nth-child(4),
.data-table th:nth-child(4) {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.55;
  width: 100%;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: #f8fafc;
}

/* ============================================================
   PAGINATION CONTROLS
   ============================================================ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 10px;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary-navy);
  color: var(--primary-navy);
}

.page-btn.active {
  background: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  font-size: 0.85rem;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-input);
  font-size: 0.88rem;
  margin-bottom: 20px;
  display: none;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  display: block;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  display: block;
}

.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer strong {
  color: var(--primary-navy);
}

.hidden {
  display: none !important;
}