/* NSS MPKBY Frontend Portal — nss-frontend.css
   Palette: Saffron · Deep Blue · Gold · Cream
   Lakshmidas M Menon | Choondal.com */

:root {
  --nf-primary:   #1a3a5c;
  --nf-accent:    #c8880a;
  --nf-gold:      #e8a020;
  --nf-saffron:   #f26522;
  --nf-green:     #1e7d40;
  --nf-red:       #b52a2a;
  --nf-orange:    #c96a10;
  --nf-blue:      #1a5c96;
  --nf-light:     #fdf6ec;
  --nf-border:    #c8b89a;
  --nf-bg:        #fffdf8;
  --nf-card-bg:   #ffffff;
  --nf-text:      #2c2416;
  --nf-muted:     #6b5c40;
  --nf-radius:    8px;
  --nf-shadow:    0 2px 12px rgba(26,58,92,.10);
}

/* ── Reset & Base ───────────────────────────────────── */
#nss-fe-app, #nss-fe-app * { box-sizing: border-box; }
#nss-fe-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px; color: var(--nf-text);
  background: var(--nf-bg);
  border: 1px solid var(--nf-border);
  border-radius: var(--nf-radius);
  overflow: hidden;
  margin: 0 auto; max-width: 1200px;
}

/* ── Login / No-Access Cards ─────────────────────────── */
.nss-fe-wrap.nss-fe-center {
  display: flex; align-items: center; justify-content: center;
  min-height: 380px; padding: 2rem;
  background: var(--nf-light);
}
.nss-fe-login-card {
  text-align: center; max-width: 420px; width: 100%;
  background: white; border: 1px solid var(--nf-border);
  border-radius: 12px; padding: 2.5rem 2rem;
  box-shadow: var(--nf-shadow);
}
.nss-fe-login-card .nss-fe-logo { font-size: 3rem; margin-bottom: .5rem; }
.nss-fe-login-card h2 { color: var(--nf-primary); margin: .5rem 0; font-size: 1.3rem; }
.nss-fe-login-card p  { color: var(--nf-muted); margin: .4rem 0; }
.nss-fe-login-card .nss-fe-sub { font-size: .88rem; }
.nss-fe-hint { font-size: .75rem; color: #aaa; margin-top: 1.5rem !important; }

/* ── Header ─────────────────────────────────────────── */
.nss-fe-header {
  background: var(--nf-primary);
  padding: .9rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.nss-fe-header-left  { display: flex; align-items: center; gap: .8rem; }
.nss-fe-logo-icon    { font-size: 2rem; }
.nss-fe-header h1    { margin: 0; font-size: 1.1rem; font-weight: 700; color: #fff; }
.nss-fe-tagline      { font-size: .78rem; color: #c8dff0; display: block; margin-top: 2px; }
.nss-fe-header-right { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.nss-fe-user         { color: #e0ecf8; font-size: .85rem; }
.nss-fe-logout       { color: var(--nf-gold); font-size: .82rem; text-decoration: none; }
.nss-fe-logout:hover { text-decoration: underline; }
.nss-fe-ver          { font-size: .72rem; color: #8ab0cc; }

/* ── Status Bar ─────────────────────────────────────── */
.nss-fe-status {
  background: var(--nf-primary); color: #c8dff0;
  padding: 4px 1.2rem; font-size: .8rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  min-height: 26px; transition: background .3s;
}
.nss-fe-status.ok   { background: var(--nf-green); color: #fff; }
.nss-fe-status.err  { background: var(--nf-red);   color: #fff; }
.nss-fe-status.warn { background: var(--nf-orange); color: #fff; }

/* ── Tab Nav ─────────────────────────────────────────── */
.nss-fe-tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: .7rem 1rem 0; background: var(--nf-light);
  border-bottom: 2px solid var(--nf-border);
}
.nss-fe-tab {
  padding: 7px 14px; background: #ede7d9;
  border: 1px solid var(--nf-border); border-bottom: none;
  border-radius: 6px 6px 0 0; cursor: pointer;
  font-size: .82rem; color: var(--nf-muted);
  transition: all .15s; white-space: nowrap;
}
.nss-fe-tab:hover  { background: #ddd0b8; color: var(--nf-primary); }
.nss-fe-tab.active {
  background: white; color: var(--nf-primary);
  font-weight: 700; border-bottom: 2px solid white;
  margin-bottom: -2px;
}

/* ── Panes ───────────────────────────────────────────── */
.nss-fe-pane { display: none; padding: 1.5rem 1.2rem; background: white; }
.nss-fe-pane.active { display: block; }

/* ── Cards ───────────────────────────────────────────── */
.nss-fe-card { margin-bottom: 1.2rem; }
.nss-fe-card h2 {
  font-size: 1.05rem; color: var(--nf-primary);
  border-bottom: 2px solid var(--nf-accent);
  padding-bottom: .35rem; margin: 0 0 1rem;
}
.nss-fe-card h3 {
  font-size: .9rem; color: var(--nf-muted);
  margin: 1.2rem 0 .6rem; font-weight: 600;
}
.nss-fe-mt { margin-top: 2rem !important; }

/* ── Grids ───────────────────────────────────────────── */
.nss-fe-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.nss-fe-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .9rem; }
@media (max-width: 700px) {
  .nss-fe-grid-2, .nss-fe-grid-3 { grid-template-columns: 1fr; }
}
.nss-fe-field-full { grid-column: 1 / -1; }

/* ── Fields ───────────────────────────────────────────── */
.nss-fe-field { display: flex; flex-direction: column; gap: 4px; }
.nss-fe-field label {
  font-size: .78rem; font-weight: 600; color: var(--nf-muted);
}
.nss-fe-hint-label { font-weight: 400; color: #9e8c70; }
.nss-fe-field input,
.nss-fe-field select,
.nss-fe-field textarea {
  padding: 7px 10px; border: 1px solid var(--nf-border);
  border-radius: 5px; font-size: .9rem; font-family: inherit;
  background: #fafaf7; color: var(--nf-text);
  transition: border-color .15s;
}
.nss-fe-field input:focus,
.nss-fe-field select:focus,
.nss-fe-field textarea:focus {
  outline: none; border-color: var(--nf-primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.12); background: #fff;
}

/* ── Buttons ─────────────────────────────────────────── */
.nss-fe-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border: none; border-radius: 5px;
  cursor: pointer; font-size: .88rem; font-weight: 600;
  transition: all .15s; text-decoration: none;
}
.nss-fe-btn-primary { background: var(--nf-primary); color: #fff; }
.nss-fe-btn-primary:hover { background: #122840; }
.nss-fe-btn-secondary {
  background: var(--nf-light); color: var(--nf-primary);
  border: 1px solid var(--nf-primary);
}
.nss-fe-btn-secondary:hover { background: #ede7d9; }
.nss-fe-btn-success { background: var(--nf-green); color: #fff; }
.nss-fe-btn-success:hover { background: #155c2e; }
.nss-fe-btn-xl { font-size: 1rem; padding: 13px 30px; }

/* ── Actions row ─────────────────────────────────────── */
.nss-fe-actions {
  display: flex; align-items: center; gap: .6rem;
  margin-top: 1rem; flex-wrap: wrap;
}

/* ── Info box ────────────────────────────────────────── */
.nss-fe-infobox {
  background: #eef4fb;
  border-left: 4px solid var(--nf-primary);
  padding: 10px 14px; font-size: .85rem;
  border-radius: 0 5px 5px 0; margin-bottom: 1rem;
}

/* ── Paste area ──────────────────────────────────────── */
.nss-fe-paste {
  width: 100%; font-family: 'Courier New', monospace; font-size: .78rem;
  border: 2px dashed var(--nf-border); border-radius: 5px;
  padding: 8px 10px; background: #fafaf7; resize: vertical;
  color: var(--nf-text);
}
.nss-fe-paste:focus { border-color: var(--nf-primary); outline: none; }

/* ── Tables ──────────────────────────────────────────── */
.nss-fe-table-wrap { overflow-x: auto; margin-top: .8rem; }
.nss-fe-table {
  width: 100%; border-collapse: collapse; font-size: .8rem;
}
.nss-fe-table th {
  background: var(--nf-primary); color: #fff;
  padding: 7px 8px; text-align: left; white-space: nowrap; font-weight: 600;
}
.nss-fe-table td { padding: 5px 8px; border-bottom: 1px solid #ede7d9; vertical-align: middle; }
.nss-fe-table tr:nth-child(even) td { background: var(--nf-light); }
.nss-fe-table tr:hover td { background: #eef4fb; }
.nss-fe-table input, .nss-fe-table select {
  padding: 3px 5px; border: 1px solid #c8b89a; border-radius: 3px;
  font-size: .78rem; background: #fff; width: 80px;
}
.nss-fe-table input[type=text].p-acno  { width: 120px; }
.nss-fe-table input[type=text].p-name  { width: 130px; }
.nss-fe-table input[type=text].p-schedref { width: 80px; }
.nss-fe-empty td {
  text-align: center; color: #9e8c70;
  font-style: italic; padding: 2rem;
}
.nss-fe-del-row {
  background: none; border: none; color: var(--nf-red);
  cursor: pointer; font-size: 1rem; padding: 2px 6px;
}

/* ── Toolbar ─────────────────────────────────────────── */
.nss-fe-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: .6rem;
}

/* ── Totals bar ──────────────────────────────────────── */
.nss-fe-totals {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  padding: 8px 12px; background: var(--nf-light);
  border-radius: 5px; font-size: .85rem; margin-bottom: .5rem;
}

/* ── Report badge ────────────────────────────────────── */
.nss-fe-report-badge {
  padding: 7px 14px; background: #eef4fb;
  border-radius: 5px; font-size: .85rem;
}

/* ── Dashboard grid ──────────────────────────────────── */
.nss-fe-dash-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem;
  margin: 1.2rem 0;
}
@media (max-width: 900px)  { .nss-fe-dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .nss-fe-dash-grid { grid-template-columns: 1fr 1fr; } }

.nss-fe-stat {
  background: white; border: 1px solid var(--nf-border);
  border-radius: 8px; padding: 1rem; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.nss-fe-stat-label { font-size: .74rem; color: var(--nf-muted); margin-bottom: 5px; }
.nss-fe-stat-val   { font-size: 1.4rem; font-weight: 700; color: var(--nf-primary); }
.nss-fe-stat-val.nss-fe-green  { color: var(--nf-green); }
.nss-fe-stat-val.nss-fe-red    { color: var(--nf-red); }
.nss-fe-stat-val.nss-fe-blue   { color: var(--nf-blue); }
.nss-fe-stat-val.nss-fe-orange { color: var(--nf-orange); }

/* ── Generate box ────────────────────────────────────── */
.nss-fe-generate-box {
  margin-top: 1.5rem; padding: 1.5rem;
  background: var(--nf-light);
  border: 2px dashed var(--nf-green);
  border-radius: 8px; text-align: center;
}
.nss-fe-generate-box h3 { color: var(--nf-green); margin-bottom: .4rem; font-size: 1rem; }
.nss-fe-generate-box p  { font-size: .84rem; color: var(--nf-muted); margin-bottom: 1rem; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .nss-fe-header   { flex-direction: column; align-items: flex-start; }
  .nss-fe-tab      { padding: 6px 10px; font-size: .78rem; }
  .nss-fe-pane     { padding: 1rem .8rem; }
  .nss-fe-btn-xl   { font-size: .9rem; padding: 10px 20px; }
}
