/* ============================================
   SPT DESIGN SYSTEM
   Core variables, typography, and component classes
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Backgrounds */
  --spt-bg:              #F4F6F7;
  --spt-bg-light:        #FAFBFC;
  --spt-bg-white:        #FFFFFF;

  /* Brand */
  --spt-teal:            #004C54;
  --spt-teal-light:      #E6F0F1;
  --spt-teal-lighter:    #F0F7F8;
  --spt-mint:            #1DB99A;
  --spt-mint-light:      #E8F8F3;

  /* Text */
  --spt-text:            #1A2B2E;
  --spt-text-secondary:  #6B7C80;
  --spt-text-muted:      #9CAAAD;

  /* Borders */
  --spt-border:          #DDE3E5;
  --spt-border-light:    #EDF0F2;

  /* Status */
  --spt-success:         #22C55E;
  --spt-warning:         #F59E0B;
  --spt-error:           #EF4444;
  --spt-info:            #3B82F6;

  /* Shadows */
  --spt-shadow-card:     0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --spt-shadow-hover:    0 4px 12px rgba(0, 0, 0, 0.08);
  --spt-shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* Border Radius */
  --spt-radius-card:     12px;
  --spt-radius-button:   8px;
  --spt-radius-input:    8px;
  --spt-radius-pill:     9999px;

  /* Typography */
  --spt-font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* ---- Typography ---- */

.spt-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--spt-text);
  line-height: 1.3;
  margin: 0;
}

.spt-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--spt-text);
  line-height: 1.4;
  margin: 0;
}

.spt-subheading {
  font-size: 14px;
  font-weight: 600;
  color: var(--spt-text);
  line-height: 1.4;
  margin: 0;
}

.spt-body {
  font-size: 13px;
  font-weight: 400;
  color: var(--spt-text);
}

.spt-small {
  font-size: 12px;
  font-weight: 400;
  color: var(--spt-text-secondary);
  margin: 0;
}

.spt-table-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--spt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spt-data {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}


/* ---- Cards & Containers ---- */

.spt-card {
  background-color: var(--spt-bg-white);
  border: 1px solid var(--spt-border);
  border-radius: var(--spt-radius-card);
  box-shadow: var(--spt-shadow-card);
  overflow: hidden;
}

.spt-card-padded {
  background-color: var(--spt-bg-white);
  border: 1px solid var(--spt-border);
  border-radius: var(--spt-radius-card);
  box-shadow: var(--spt-shadow-card);
  overflow: hidden;
  padding: 24px;
}

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

.spt-card-body {
  padding: 24px;
}

.spt-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--spt-border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}


/* ---- Tables ---- */

.spt-table {
  width: 100%;
  border-collapse: collapse;
}

.spt-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--spt-text-secondary);
  border-bottom: 1px solid var(--spt-border);
  white-space: nowrap;
}

.spt-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--spt-text);
  border-bottom: 1px solid var(--spt-border-light);
  vertical-align: middle;
}

.spt-table tr:hover {
  background-color: var(--spt-teal-lighter);
}

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

.spt-table thead tr:hover {
  background-color: transparent;
}


/* ---- Buttons ---- */

.spt-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--spt-teal);
  color: #FFFFFF;
  border: none;
  border-radius: var(--spt-radius-button);
  font-family: var(--spt-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.spt-btn-primary:hover {
  background-color: #003840;
  box-shadow: 0 2px 4px rgba(0, 76, 84, 0.2);
  color: #FFFFFF;
  text-decoration: none;
}

.spt-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spt-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--spt-bg-white);
  color: var(--spt-text);
  border: 1px solid var(--spt-border);
  border-radius: var(--spt-radius-button);
  font-family: var(--spt-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.spt-btn-secondary:hover {
  background-color: var(--spt-bg);
  border-color: var(--spt-border);
  text-decoration: none;
}

.spt-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spt-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--spt-teal);
  border: none;
  border-radius: var(--spt-radius-button);
  font-family: var(--spt-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.spt-btn-ghost:hover {
  background-color: var(--spt-teal-light);
  text-decoration: none;
}

.spt-btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spt-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--spt-error);
  color: #FFFFFF;
  border: none;
  border-radius: var(--spt-radius-button);
  font-family: var(--spt-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.spt-btn-danger:hover {
  filter: brightness(0.9);
  color: #FFFFFF;
  text-decoration: none;
}

.spt-btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Size variants */
.spt-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.spt-btn-lg {
  padding: 10px 20px;
  font-size: 14px;
}

.spt-btn-icon {
  padding: 8px;
  line-height: 1;
}


/* ---- Inputs & Forms ---- */

.spt-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--spt-border);
  border-radius: var(--spt-radius-input);
  background-color: var(--spt-bg-white);
  font-family: var(--spt-font);
  font-size: 13px;
  color: var(--spt-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.spt-input:focus {
  outline: none;
  border-color: var(--spt-teal);
  box-shadow: 0 0 0 3px rgba(0, 76, 84, 0.08);
}

.spt-input::placeholder {
  color: var(--spt-text-muted);
}

.spt-input:disabled {
  background-color: var(--spt-bg);
  color: var(--spt-text-muted);
  cursor: not-allowed;
}

.spt-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--spt-text);
  margin-bottom: 6px;
}

.spt-helper {
  font-size: 12px;
  color: var(--spt-text-secondary);
  margin-top: 4px;
}

.spt-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--spt-border);
  border-radius: var(--spt-radius-input);
  background-color: var(--spt-bg-white);
  font-family: var(--spt-font);
  font-size: 13px;
  color: var(--spt-text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7C80' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.spt-select:focus {
  outline: none;
  border-color: var(--spt-teal);
  box-shadow: 0 0 0 3px rgba(0, 76, 84, 0.08);
}

.spt-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--spt-border);
  border-radius: var(--spt-radius-input);
  background-color: var(--spt-bg-white);
  font-family: var(--spt-font);
  font-size: 13px;
  color: var(--spt-text);
  min-height: 80px;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.spt-textarea:focus {
  outline: none;
  border-color: var(--spt-teal);
  box-shadow: 0 0 0 3px rgba(0, 76, 84, 0.08);
}

/* Form layout */
.spt-form-group {
  margin-bottom: 20px;
}

.spt-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.spt-form-section {
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--spt-border-light);
}

.spt-form-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--spt-text-secondary);
  margin-bottom: 16px;
}


/* ---- Badges ---- */

.spt-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--spt-radius-pill);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  gap: 4px;
}

.spt-badge-teal {
  background-color: var(--spt-teal-light);
  color: var(--spt-teal);
}

.spt-badge-mint {
  background-color: var(--spt-mint-light);
  color: #0D7A64;
}

.spt-badge-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16A34A;
}

.spt-badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #D97706;
}

.spt-badge-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

.spt-badge-neutral {
  background-color: rgba(107, 124, 128, 0.1);
  color: var(--spt-text-secondary);
}

.spt-badge-remove {
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
  opacity: 0.6;
}

.spt-badge-remove:hover {
  opacity: 1;
}


/* ---- Status Dots (AT/SH indicators) ---- */

.spt-status-dot {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.spt-status-dot:hover {
  box-shadow: 0 0 0 2px var(--spt-teal-light);
}

.spt-status-unchecked {
  background-color: var(--spt-bg);
  color: var(--spt-text-muted);
  border: 1px solid var(--spt-border);
}

.spt-status-active {
  background-color: var(--spt-mint-light);
  color: #0D7A64;
  border: 1px solid rgba(29, 185, 154, 0.3);
}

.spt-status-inactive {
  background-color: rgba(239, 68, 68, 0.08);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.spt-status-pending {
  background-color: rgba(245, 158, 11, 0.08);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}


/* ---- Page Header ---- */

.spt-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 0;
}

.spt-page-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spt-page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ---- Flash Messages ---- */

.spt-flash {
  padding: 12px 16px;
  border-radius: var(--spt-radius-button);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  animation: spt-flash-slide 0.3s ease;
}

.spt-flash-success {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #16A34A;
}

.spt-flash-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #DC2626;
}

.spt-flash-info {
  background-color: var(--spt-teal-light);
  border: 1px solid rgba(0, 76, 84, 0.15);
  color: var(--spt-teal);
}

@keyframes spt-flash-slide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ---- Top Bar ---- */

.spt-topbar {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 24px;
  background: var(--spt-bg-white);
  border-bottom: 1px solid var(--spt-border);
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 16px;
}

.spt-topbar .mobile-menu-btn {
  display: none;
}

.spt-topbar-left {
  flex: 1;
  min-width: 0;
}

.spt-topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--spt-text);
}

.spt-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.spt-topbar-date {
  font-size: 12px;
  color: var(--spt-text-muted);
  white-space: nowrap;
}

/* Override notification-bell-wrap inside topbar: relative, not fixed */
.spt-topbar .notification-bell-wrap {
  position: relative;
  top: auto;
  right: auto;
  z-index: auto;
}


/* ---- Toggle Switch ---- */

.spt-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.spt-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.spt-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--spt-border);
  transition: 0.2s;
  border-radius: 20px;
}

.spt-toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--spt-bg-white);
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.spt-toggle input:checked + .spt-toggle-slider {
  background-color: var(--spt-mint);
}

.spt-toggle input:checked + .spt-toggle-slider:before {
  transform: translateX(16px);
}


/* ---- Filter Pills ---- */

.spt-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--spt-border);
  border-radius: var(--spt-radius-pill);
  background: var(--spt-bg-white);
  color: var(--spt-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.spt-filter-btn:hover {
  border-color: var(--spt-teal);
  color: var(--spt-teal);
  text-decoration: none;
}

.spt-filter-btn.active {
  background: var(--spt-teal);
  color: #FFFFFF;
  border-color: var(--spt-teal);
}

.spt-filter-btn-danger.active {
  background: var(--spt-error);
  border-color: var(--spt-error);
}


/* ---- Empty State ---- */

.spt-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.spt-empty-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--spt-teal-light);
  border-radius: 50%;
  margin-bottom: 16px;
  color: var(--spt-teal);
}

.spt-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--spt-text);
  margin: 0 0 6px;
}

.spt-empty-desc {
  font-size: 13px;
  color: var(--spt-text-secondary);
  margin: 0 0 20px;
  max-width: 360px;
}


/* ---- Footer ---- */

.spt-footer {
  text-align: center;
  padding: 16px 24px;
  color: var(--spt-text-muted);
  font-size: 12px;
  border-top: 1px solid var(--spt-border-light);
}

.spt-footer p {
  margin: 0;
}


/* ---- Responsive: Topbar ---- */

@media (max-width: 768px) {
  .spt-topbar .mobile-menu-btn {
    display: flex;
  }

  .spt-topbar-date {
    display: none;
  }
}
