/* ===== Classification Level Colors ===== */
.classification-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-radius: 999px;
    border: 1.5px solid;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* UNCLASSIFIED - Green */
.classification-badge.unclassified,
.cl-unclassified {
    color: #1a6b37;
    background: linear-gradient(135deg, #d4f0e0 0%, #e8f5e9 100%);
    border-color: #2d8a4e;
}

/* CONFIDENTIAL - Blue */
.classification-badge.confidential,
.cl-confidential {
    color: #0d47a1;
    background: linear-gradient(135deg, #c8defc 0%, #e3f2fd 100%);
    border-color: #1565c0;
}

/* SECRET - Red */
.classification-badge.secret,
.cl-secret {
    color: #b71c1c;
    background: linear-gradient(135deg, #ffd0d0 0%, #ffebee 100%);
    border-color: #c62828;
}

/* TOP SECRET - Orange */
.classification-badge.top-secret,
.cl-top-secret {
    color: #bf360c;
    background: linear-gradient(135deg, #ffdcb8 0%, #fff3e0 100%);
    border-color: #e65100;
}

/* ===== SCG Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1.5px solid;
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.status-badge.draft {
    color: #555;
    background: #f0f0f0;
    border-color: #bbb;
}

.status-badge.under-review {
    color: #6d4c00;
    background: #fff8e1;
    border-color: #f9a825;
}

.status-badge.signed {
    color: #1a6b37;
    background: #d4f0e0;
    border-color: #2d8a4e;
}

.status-badge.superseded {
    color: #0d47a1;
    background: #e3f2fd;
    border-color: #1565c0;
}

.status-badge.archived {
    color: #888;
    background: #f5f5f5;
    border-color: #ccc;
    text-decoration: line-through;
}

/* ===== Classification Statement Badge (full marking) ===== */
.marking-statement {
    white-space: nowrap;
    text-align: center;
    line-height: 1.4;
    font-size: 0.7rem;
}

/* ===== Classification Entry Row Styling ===== */
.entry-row {
    display: grid;
    grid-template-columns: 60px 1fr auto 90px auto;
    gap: var(--space-md);
    align-items: start;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition);
}

.entry-row:hover {
    background: var(--color-primary-light);
}

.entry-row:last-child {
    border-bottom: none;
}

.entry-item-id {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.867rem;
    color: var(--color-text-muted);
}

.entry-description {
    font-size: 0.933rem;
    line-height: 1.5;
}

.entry-reason {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

.entry-actions {
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}

/* ===== Section Styling ===== */
.scg-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
    overflow: hidden;
}

.scg-section:hover {
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f2f7 100%);
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.section-header:hover {
    background: linear-gradient(180deg, #eceef5 0%, #e4e7f0 100%);
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.section-number {
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.933rem;
    color: var(--color-primary);
    min-width: 2.5rem;
}

.section-title {
    font-weight: 600;
    font-size: 1rem;
}

.section-entry-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-left: var(--space-sm);
}

.section-body {
    padding: 0;
}

.section-description {
    padding: var(--space-md) var(--space-lg);
    font-size: 0.867rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border-light);
}

.subsection {
    margin: var(--space-sm) var(--space-md) 0 var(--space-xl);
    border-left: 3px solid var(--color-primary-light);
    padding-left: var(--space-sm);
}

.subsection .scg-section {
    box-shadow: none;
    border-color: var(--color-border-light);
}

.subsection .section-header {
    background: linear-gradient(180deg, #f4f6fb 0%, #edf0f8 100%);
}

/* ===== Classification Level Indicators ===== */
.level-bar {
    width: 4px;
    border-radius: 2px;
    align-self: stretch;
}

.level-bar.unclassified { background: #2d8a4e; }
.level-bar.confidential { background: #1565c0; }
.level-bar.secret { background: #c62828; }
.level-bar.top-secret { background: #e65100; }

/* ===== Downgrade Arrow ===== */
.downgrade-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding: 2px 0;
}

.downgrade-arrow {
    font-size: 0.9rem;
}

/* ===== Comparison Diff Highlighting ===== */
.diff-changed {
    background: #fff9c4;
    border: 1px solid #f9a825;
    border-radius: var(--radius-sm);
    padding: 0 2px;
}

.diff-added {
    background: #e8f5e9;
    border: 1px solid #66bb6a;
    border-radius: var(--radius-sm);
    padding: 0 2px;
}

.diff-removed {
    background: #ffebee;
    border: 1px solid #ef5350;
    border-radius: var(--radius-sm);
    padding: 0 2px;
    text-decoration: line-through;
}

.diff-missing {
    color: var(--color-text-muted);
    font-style: italic;
}

/* ===== SCG Card List ===== */
.scg-card-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.scg-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: visible;
    position: relative;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.scg-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-border);
}

.scg-card-locked {
    opacity: 0.75;
}

.scg-card-left-bar {
    width: 5px;
    flex-shrink: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.scg-card-left-bar.unclassified    { background: #2d8a4e; }
.scg-card-left-bar.confidential    { background: #1565c0; }
.scg-card-left-bar.secret          { background: #c62828; }
.scg-card-left-bar.top-secret      { background: #e65100; }

.scg-card-body {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.scg-card-top {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.scg-card-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.scg-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

.scg-card-title:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.scg-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.scg-card-meta-item {
    color: var(--color-text-muted);
}

.scg-card-meta-sep {
    color: var(--color-border);
    font-size: 0.7rem;
}

/* ===== SCG Card Lineage ===== */
.scg-card-lineage {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: var(--space-xs) 0 0;
    padding: 0.35rem 0.6rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-border);
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.lineage-link {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.lineage-link:hover {
    color: var(--color-primary);
}

.lineage-icon {
    font-weight: 700;
    opacity: 0.5;
}

.lineage-name {
    font-weight: 600;
    color: var(--color-text);
}

.lineage-link:hover .lineage-name {
    color: var(--color-primary);
}

.lineage-rev {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    opacity: 0.7;
}

.lineage-successors {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.scg-card-purpose {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: var(--space-xs) 0 0;
}

.scg-card-actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}
