/* ============================================================
   TSNE Component Library — shared UI elements for dark theme
   ============================================================ */

/* ============ TOAST BANNERS ============ */
.toast {
    padding: 12px 18px;
    margin-bottom: 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s var(--layout-ease);
}

.toast--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.toast--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.toast--info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.toast--warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: #facc15;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ POSITION BADGES ============ */
.pos-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pos-badge--qb  { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.pos-badge--rb  { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.pos-badge--wr  { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.pos-badge--te  { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.pos-badge--k   { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.pos-badge--def { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }
.pos-badge--dl,
.pos-badge--lb,
.pos-badge--db  { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }

/* ============ CARDS ============ */
.card {
    position: relative;
    padding: 20px;
    background: var(--layout-surface, #18181b);
    border: 1px solid var(--layout-border, rgba(255,255,255,0.08));
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    border-color: var(--layout-border-strong, rgba(255,255,255,0.14));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card--interactive {
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.card--highlight {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.05);
}

/* ============ STAT CARDS ============ */
.stat-card {
    padding: 16px;
    background: var(--layout-surface, #18181b);
    border: 1px solid var(--layout-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    text-align: center;
    transition: background 0.2s ease;
}

.stat-card:hover {
    background: var(--layout-surface-2, #1f1f23);
}

.stat-card__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--layout-text, #f5f5f7);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card__label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--layout-text-dim, #71717a);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============ SEVERITY BADGES ============ */
.severity-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.severity-badge--high   { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.severity-badge--medium { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.severity-badge--low    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

/* ============ ROLE BADGES ============ */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.role-badge--commissioner    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.role-badge--cocommissioner  { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

/* ============ STATUS BADGES ============ */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge--draft      { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.status-badge--inprogress { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.status-badge--completed  { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.status-badge--publishing { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

/* ============ TABLES ============ */
.data-table {
    width: 100%;
    font-size: 14px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--layout-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    overflow: hidden;
}

.data-table thead {
    background: var(--layout-surface, #18181b);
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--layout-text-muted, #a1a1aa);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--layout-border, rgba(255,255,255,0.08));
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--layout-border, rgba(255,255,255,0.08));
    color: var(--layout-text, #f5f5f7);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ============ SECTION DIVIDERS ============ */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
}

.section-divider__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--layout-text-dim, #71717a);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.section-divider__line {
    flex: 1;
    height: 1px;
    background: var(--layout-border, rgba(255,255,255,0.08));
}

/* ============ FORM ELEMENTS ============ */
.form-field {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--layout-text-muted, #a1a1aa);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--layout-surface, #18181b);
    border: 1px solid var(--layout-border, rgba(255,255,255,0.08));
    border-radius: 8px;
    color: var(--layout-text, #f5f5f7);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--layout-text-dim, #71717a);
}

/* ============ BUTTONS ============ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--layout-red, #e63946);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.25);
}

.btn-primary:hover {
    background: var(--layout-red-soft, #f06674);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(230, 57, 70, 0.35);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--layout-text, #f5f5f7);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--layout-border, rgba(255,255,255,0.08));
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--layout-border-strong, rgba(255,255,255,0.14));
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ============ FILTER TABS ============ */
.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--layout-surface, #18181b);
    border: 1px solid var(--layout-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    margin-bottom: 16px;
}

.filter-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--layout-text-muted, #a1a1aa);
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.filter-tab:hover {
    color: var(--layout-text, #f5f5f7);
    background: rgba(255, 255, 255, 0.05);
}

.filter-tab--active {
    color: #fff !important;
    background: var(--layout-red, #e63946) !important;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    border: 1px dashed var(--layout-border, rgba(255,255,255,0.08));
    border-radius: 12px;
}

.empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--layout-text-muted, #a1a1aa);
    margin-bottom: 8px;
}

.empty-state__desc {
    font-size: 14px;
    color: var(--layout-text-dim, #71717a);
    max-width: 360px;
    margin: 0 auto;
}

/* ============ LOADING SPINNER ============ */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--layout-border, rgba(255,255,255,0.08));
    border-top-color: var(--layout-red, #e63946);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ PAGE HEADER ============ */
.page-header {
    margin-bottom: 24px;
}

.page-header__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--layout-text, #f5f5f7);
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}

.page-header__subtitle {
    font-size: 14px;
    color: var(--layout-text-dim, #71717a);
    margin: 0;
}

/* ============ TRANSITIONS ============ */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
