/* ====================================================
   NAGSDAC Secretary Department Portal
   secretary.css
   ==================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

.sec-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: #102d31;
  background: #102d31;
  -webkit-font-smoothing: antialiased;
}

.sec-skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.sec-skip:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.6rem 1rem;
  background: #f4c84a;
  color: #102d31;
  font-weight: 800;
  border-radius: 5px;
  z-index: 1000;
}

/* ====================================================
   AUTH SCREEN
   ==================================================== */

.sec-auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    linear-gradient(160deg, rgba(10, 28, 31, 0.92) 0%, rgba(16, 45, 49, 0.85) 100%),
    url('/assets/nagsdac-family-worship.jpg') center / cover no-repeat;
}

.sec-auth-card {
  width: min(440px, 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
}

/* Brand header inside card */
.sec-auth-brand {
  padding: 2rem 2rem 1.75rem;
  background: #102d31;
  text-align: center;
  color: #fff;
}

.sec-auth-brand img {
  display: block;
  margin: 0 auto 1rem;
  opacity: 0.92;
}

.sec-auth-brand strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.sec-auth-brand span {
  display: block;
  font-size: 1.2rem;
  font-weight: 850;
  color: #fff;
}

.sec-access-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #dce5e4;
}

.sec-access-summary span {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0.5rem;
  color: #466164;
  background: #f6faf9;
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sec-admin-access {
  margin: 1rem 1.25rem;
  padding: 1rem;
  border: 1px solid #cae6e4;
  border-radius: 8px;
  background: #f3fbfa;
  color: #17373b;
}

.sec-admin-access strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 850;
}

.sec-admin-access p {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #4c676a;
}

.sec-admin-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.sec-admin-access-actions .sec-btn-primary,
.sec-admin-access-actions .sec-btn-ghost {
  width: auto;
  min-height: 42px;
  padding: 0.7rem 0.95rem;
  font-size: 0.72rem;
}

/* Tabs */
.sec-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-bottom: 1px solid #e0e9e8;
}

.sec-tab {
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  color: #7a9295;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.sec-tab.is-active,
.sec-tab[aria-selected="true"] {
  color: #102d31;
  border-bottom-color: #79d4d0;
}

.sec-tab:hover {
  color: #102d31;
}

/* Tab panels */
.sec-tab-panel {
  background: #fff;
}

/* Auth forms */
.sec-auth-form {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sec-forgot {
  font-size: 0.78rem;
  color: #576b6e;
  text-decoration: none;
  margin-top: -0.25rem;
  align-self: flex-start;
}
.sec-forgot:hover {
  color: #102d31;
  text-decoration: underline;
}

.sec-hint {
  margin: -0.5rem 0 0;
  font-size: 0.78rem;
  color: #576b6e;
}

.sec-setup {
  border: 1px solid #dce5e4;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.84rem;
  color: #576b6e;
}

.sec-setup summary {
  cursor: pointer;
  font-weight: 600;
  color: #102d31;
}

.sec-setup .sec-label {
  margin-top: 0.75rem;
}

.sec-auth-help {
  padding: 1.1rem 2rem 1.5rem;
  margin: 0;
  background: #fff;
  font-size: 0.8rem;
  text-align: center;
  color: #7a9295;
  border-top: 1px solid #edf2f1;
}

.sec-auth-help a {
  color: #102d31;
  font-weight: 700;
  text-decoration: none;
}
.sec-auth-help a:hover {
  text-decoration: underline;
}

/* ====================================================
   SHARED FORM ELEMENTS
   ==================================================== */

.sec-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.83rem;
  font-weight: 700;
  color: #102d31;
}

.sec-label-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: #7a9295;
  margin-top: -0.1rem;
}

.sec-optional {
  font-size: 0.75rem;
  font-weight: 500;
  color: #7a9295;
}

.sec-input,
.sec-select,
.sec-textarea {
  min-width: 0;
  width: 100%;
  padding: 0 0.85rem;
  height: 46px;
  border: 1.5px solid #c5d4d3;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #102d31;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.sec-textarea {
  height: auto;
  padding: 0.7rem 0.85rem;
  resize: vertical;
}

.sec-input:focus,
.sec-select:focus,
.sec-textarea:focus {
  border-color: #79d4d0;
  outline: none;
  box-shadow: 0 0 0 3px rgba(121, 212, 208, 0.25);
}

.sec-input::placeholder,
.sec-textarea::placeholder {
  color: #9fb5b7;
}

.sec-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23576b6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.sec-char-count {
  align-self: flex-end;
  font-size: 0.72rem;
  color: #9fb5b7;
  margin-top: -0.15rem;
}

.sec-char-count.is-near {
  color: #d97706;
}

.sec-char-count.is-max {
  color: #b91c1c;
}

/* Buttons */
.sec-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 7px;
  background: #79d4d0;
  color: #102d31;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.sec-btn-primary:hover {
  background: #5bbfbb;
}

.sec-btn-primary:active {
  transform: scale(0.98);
}

.sec-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sec-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0 0.85rem;
  border: 1px solid #c5d4d3;
  border-radius: 5px;
  background: transparent;
  color: #576b6e;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.sec-btn-ghost:hover {
  border-color: #79d4d0;
  color: #102d31;
}

.sec-btn-ghost svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sec-btn-quiet {
  padding: 0.3rem 0.65rem;
  border: 1px solid #c5d4d3;
  border-radius: 4px;
  background: transparent;
  color: #7a9295;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.sec-btn-quiet:hover {
  color: #b91c1c;
  border-color: #b91c1c;
}

/* Status messages */
.sec-status {
  margin: 0;
  min-height: 1.3em;
  font-size: 0.83rem;
  color: #576b6e;
}

.sec-status.is-error {
  color: #b91c1c;
}

.sec-status.is-success {
  color: #166534;
}

/* ====================================================
   DASHBOARD HEADER
   ==================================================== */

.sec-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 62px;
  background: #102d31;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sec-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 850;
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.sec-brand img {
  opacity: 0.9;
  flex-shrink: 0;
}

.sec-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.sec-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.sec-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sec-nav-admin {
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.sec-user-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.sec-user-name {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.8);
}

.sec-role-pill {
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(121, 212, 208, 0.2);
  color: #79d4d0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sec-role-pill.is-admin {
  background: rgba(244, 200, 74, 0.2);
  color: #f4c84a;
}

.sec-role-pill.is-secretary {
  background: rgba(121, 212, 208, 0.2);
  color: #79d4d0;
}

.sec-signout {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.sec-signout:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* ====================================================
   DASHBOARD MAIN
   ==================================================== */

.sec-main {
  background: #eef3f2;
  min-height: calc(100vh - 62px);
  padding: 2.5rem 1.25rem 4rem;
}

.sec-main-wrap {
  max-width: 1060px;
  margin: 0 auto;
}

/* Welcome */
.sec-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.sec-welcome h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  color: #102d31;
  line-height: 1.15;
}

.sec-welcome p {
  margin: 0;
  color: #576b6e;
  font-size: 0.92rem;
}

.sec-status-legend {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

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

.sec-metrics article {
  min-width: 0;
  border: 1px solid #dce5e4;
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 45, 49, 0.05);
}

.sec-metrics span,
.sec-list-count {
  color: #576b6e;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.sec-metrics strong {
  display: block;
  margin: 0.25rem 0 0.2rem;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  line-height: 1;
}

.sec-metrics small {
  display: block;
  color: #7a9295;
  font-size: 0.76rem;
  line-height: 1.35;
}

/* Status pills */
.sec-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sec-pill.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.sec-pill.is-published {
  background: #dcfce7;
  color: #166534;
}

.sec-pill.is-declined {
  background: #fee2e2;
  color: #991b1b;
}

.sec-pill.is-new {
  background: #dbeafe;
  color: #1e40af;
}

.sec-pill.is-contacted {
  background: #dcfce7;
  color: #166534;
}

.sec-pill.is-closed {
  background: #e5e7eb;
  color: #374151;
}

/* Workspace grid */
.sec-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Cards */
.sec-card {
  background: #fff;
  border: 1px solid #dce5e4;
  border-radius: 10px;
  overflow: hidden;
}

.sec-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0;
}

.sec-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #79d4d0;
}

.sec-card-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #102d31;
}

.sec-card-intro {
  margin: 0.4rem 0 0;
  font-size: 0.83rem;
  color: #576b6e;
}

/* Announcement form */
.sec-ann-form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sec-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.sec-attachment-hint {
  margin: -0.35rem 0 0.15rem;
  color: #7a9295;
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 650;
}

.sec-form-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

/* Announcement list */
.sec-list-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px)) minmax(100px, 1fr);
  gap: 0.75rem;
  align-items: end;
  border-bottom: 1px solid #edf2f1;
  padding: 0.85rem 1.5rem;
  background: #f8fbfa;
}

.sec-admin-filter {
  padding: 0;
  border: 0;
}

.sec-list-count {
  justify-self: end;
  padding-bottom: 0.72rem;
}

.sec-ann-list {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sec-empty {
  padding: 2rem 0;
  text-align: center;
  color: #7a9295;
  font-size: 0.88rem;
  margin: 0;
}

/* Announcement cards in list */
.sec-ann-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e0e9e8;
  border-radius: 7px;
  background: #fafcfb;
  transition: border-color 0.15s;
}

.sec-ann-item:hover {
  border-color: #b9d4d3;
}

.sec-ann-item-body {
  flex: 1;
  min-width: 0;
}

.sec-ann-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.sec-ann-dept {
  font-size: 0.72rem;
  font-weight: 700;
  color: #576b6e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sec-ann-item strong {
  display: block;
  font-size: 0.92rem;
  color: #102d31;
  margin-bottom: 0.2rem;
}

.sec-ann-item p {
  margin: 0;
  font-size: 0.82rem;
  color: #576b6e;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sec-ann-item-dates {
  font-size: 0.72rem;
  color: #9fb5b7;
  margin-top: 0.3rem;
}

.sec-ann-item-submitter {
  font-size: 0.72rem;
  color: #9fb5b7;
}

.sec-ann-media-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.sec-ann-media-links a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0.32rem 0.52rem;
  border: 1px solid #c9e7e5;
  border-radius: 4px;
  color: #1f6f72;
  background: #eff8f7;
  font-size: 0.72rem;
  font-weight: 850;
  text-decoration: none;
  text-transform: uppercase;
}

.sec-ann-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sec-ann-review-select {
  height: 32px;
  padding: 0 1.8rem 0 0.6rem;
  border: 1px solid #c5d4d3;
  border-radius: 4px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23576b6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
  color: #102d31;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
}

.sec-connections-card {
  grid-column: 1 / -1;
}

.sec-connections-card > .sec-status {
  margin: 0.7rem 1.5rem 0;
}

.sec-connection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 1rem 1.5rem 1.5rem;
}

.sec-connection-item {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid #e0e9e8;
  border-radius: 7px;
  background: #fafcfb;
}

.sec-connection-item strong {
  color: #102d31;
  font-size: 1rem;
}

.sec-connection-item p {
  margin: 0;
  color: #576b6e;
  font-size: 0.84rem;
}

.sec-connection-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sec-connection-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.25rem 0.55rem;
  border: 1px solid #cce0df;
  border-radius: 999px;
  color: #102d31;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.sec-connection-date {
  color: #7a9295;
  font-size: 0.74rem;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */

@media (max-width: 820px) {
  .sec-workspace {
    grid-template-columns: 1fr;
  }

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

  .sec-list-controls {
    grid-template-columns: 1fr;
  }

  .sec-list-count {
    justify-self: start;
    padding-bottom: 0;
  }

  .sec-connection-list {
    grid-template-columns: 1fr;
  }

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

  .sec-nav a:not(.sec-nav-admin) {
    display: none;
  }

  .sec-user-name {
    display: none;
  }
}

@media (max-width: 560px) {
  .sec-header {
    padding: 0 1rem;
  }

  .sec-auth-form {
    padding: 1.5rem 1.25rem;
  }

  .sec-auth-brand {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .sec-auth-help {
    padding: 1rem 1.25rem 1.25rem;
  }

  .sec-access-summary,
  .sec-metrics {
    grid-template-columns: 1fr;
  }

  .sec-main {
    padding: 1.5rem 0.75rem 3rem;
  }

  .sec-card-head {
    padding: 1.25rem 1.25rem 0;
  }

  .sec-ann-form {
    padding: 1rem 1.25rem 1.25rem;
  }

  .sec-ann-list {
    padding: 0.75rem 1.25rem 1.25rem;
  }

  .sec-welcome {
    flex-direction: column;
    gap: 0.75rem;
  }

  .sec-ann-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .sec-ann-item-actions {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
  }
}
