/* Design System matches SpecHelp™ Guidelines */
:root {
  --bg-main: #F8FAFC;
  --bg-card: #ffffff;
  --text-primary: #18181A;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --color-primary: #E10600;
  --color-primary-hover: #b80500;
  --border-card: rgba(226, 232, 240, 0.8);
  --radius-card: 16px;
  --radius-btn: 8px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03);
  --notice-bg: #fffbeb;
  --notice-border: #fcd34d;
  --notice-text: #92400e;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 32px 20px 60px;
  font-size: 14px;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header Profile Card */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-card);
  padding: 28px 32px 0;
  position: relative;
}

.profile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar-box {
  position: relative;
  width: 76px;
  height: 76px;
}

.avatar-img {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 30px;
  font-weight: 700;
}

.status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.identity-info h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.identity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}

.profile-exit-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  gap: 32px;
  border-top: 1px solid #f1f5f9;
  padding: 0;
}

.tab-btn {
  background: none;
  border: none;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--color-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
}

/* Grid Layout */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 880px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Standard Content Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-card);
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Buttons */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.05s;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid #cbd5e1;
  padding: 7px 15px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #f8fafc;
}

.btn-success {
  background-color: #10b981;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.btn-success:hover {
  background-color: #059669;
}

/* Key-Value Rows */
.field-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-row {
  display: flex;
  font-size: 13px;
  line-height: 1.5;
}

.field-label {
  width: 140px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.field-value {
  color: var(--text-primary);
  font-weight: 500;
  flex-grow: 1;
  word-break: break-word;
}

/* Notice / Warning Card */
.notice-card {
  background: var(--notice-bg);
  border: 1px dashed var(--notice-border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.notice-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #d97706;
  border-radius: 8px;
  color: #d97706;
  font-weight: bold;
  font-size: 15px;
}

.notice-content {
  flex-grow: 1;
}

.notice-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--notice-text);
  margin-bottom: 4px;
}

.notice-text {
  font-size: 13px;
  color: #b45309;
  line-height: 1.5;
}

.notice-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.notice-link:hover {
  text-decoration: underline;
}

/* Search and Filters */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-primary);
  width: 320px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--color-primary);
}

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

.pill-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-btn:hover, .pill-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--color-primary);
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-verified {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-pending {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-blue {
  background: #eff6ff;
  color: #2563eb;
}

/* Process Cards in Grid */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.process-card {
  background: #ffffff;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}

.process-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.process-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.process-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 6px;
}

.process-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.process-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.process-meta-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  margin-bottom: 16px;
}

.process-actions {
  display: flex;
  gap: 8px;
}

/* Table Styles */
.table-container {
  overflow-x: auto;
}

.npa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.npa-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.npa-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: top;
}

.npa-table tr:hover td {
  background: #fafafa;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-ext {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
}

.file-ext.docx { background: #dbeafe; color: #1d4ed8; }
.file-ext.xlsx { background: #dcfce7; color: #15803d; }
.file-ext.png, .file-ext.jpg { background: #fef3c7; color: #b45309; }

/* Modal Sub-tabs */
.modal-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 28px;
  background: #f8fafc;
}

.modal-nav-btn {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.modal-nav-btn:hover {
  color: var(--text-primary);
}

.modal-nav-btn.active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom-color: var(--color-primary);
  background: #fff;
}

/* Article Typography */
.article-body {
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
}

.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  color: #0f172a;
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.article-body h2 { font-size: 18px; border-bottom: 1px solid #f1f5f9; padding-bottom: 6px; }
.article-body h3 { font-size: 16px; }

.article-body p {
  margin-bottom: 16px;
}

.article-body ul, .article-body ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body blockquote {
  border-left: 4px solid var(--color-primary);
  background: #f8fafc;
  padding: 12px 18px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
  color: #475569;
  font-style: italic;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.article-body th, .article-body td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}

.article-body th {
  background: #f1f5f9;
  font-weight: 600;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}
