/* ============================================================
   Survei Mahasiswa SDGs — Stylesheet v1.0.0
   SDGs-inspired color palette · Modern card UI · Responsive
   ============================================================ */

:root {
    /* SDGs Palette */
    --sms-primary: #0a6e5c;
    --sms-primary-light: #0d9b7a;
    --sms-primary-dark: #064e40;
    --sms-accent: #f59e0b;
    --sms-accent-light: #fbbf24;

    /* Semantic */
    --sms-high: #059669;
    --sms-high-bg: #d1fae5;
    --sms-mid: #d97706;
    --sms-mid-bg: #fef3c7;
    --sms-low: #dc2626;
    --sms-low-bg: #fee2e2;

    /* Gender */
    --sms-male: #3b82f6;
    --sms-male-light: #dbeafe;
    --sms-female: #ec4899;
    --sms-female-light: #fce7f3;

    /* UI */
    --sms-bg: #f0fdf4;
    --sms-surface: #ffffff;
    --sms-border: #e2e8f0;
    --sms-text: #1e293b;
    --sms-text-muted: #64748b;
    --sms-radius: 16px;
    --sms-radius-sm: 10px;
    --sms-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --sms-shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 12px 40px rgba(0,0,0,0.04);
    --sms-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --sms-mono: 'JetBrains Mono', monospace;
}

/* Reset within dashboard */
.sms-dashboard * { box-sizing: border-box; margin: 0; padding: 0; }
.sms-dashboard {
    font-family: var(--sms-font);
    color: var(--sms-text);
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    background: var(--sms-bg);
    min-height: 100vh;
}

/* ─── Header ─── */
.sms-header {
    background: linear-gradient(135deg, var(--sms-primary-dark) 0%, var(--sms-primary) 40%, var(--sms-primary-light) 100%);
    border-radius: var(--sms-radius);
    padding: 40px 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--sms-shadow-lg);
}
.sms-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.sms-header::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    top: -60px;
    right: -40px;
}
.sms-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
}
.sms-header__icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    color: rgba(255,255,255,0.9);
}
.sms-header__icon svg { width: 100%; height: 100%; }
.sms-header__text h2 {
    color: #fff;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
.sms-header__text p {
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ─── Summary Cards ─── */
.sms-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.sms-card {
    background: var(--sms-surface);
    border-radius: var(--sms-radius);
    padding: 24px 20px;
    box-shadow: var(--sms-shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--sms-border);
}
.sms-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sms-shadow-lg);
}
.sms-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}
.sms-card--primary::before { background: var(--sms-primary); }
.sms-card--blue::before { background: var(--sms-male); }
.sms-card--pink::before { background: var(--sms-female); }
.sms-card--green::before { background: var(--sms-high); }

.sms-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sms-card__icon svg { width: 22px; height: 22px; }
.sms-card--primary .sms-card__icon { background: #d1fae5; color: var(--sms-primary); }
.sms-card--blue .sms-card__icon { background: var(--sms-male-light); color: var(--sms-male); }
.sms-card--pink .sms-card__icon { background: var(--sms-female-light); color: var(--sms-female); }
.sms-card--green .sms-card__icon { background: #d1fae5; color: var(--sms-high); }

.sms-card__body { display: flex; flex-direction: column; }
.sms-card__label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sms-text-muted);
    margin-bottom: 4px;
}
.sms-card__value {
    font-family: var(--sms-mono);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--sms-text);
}
.sms-card__sub {
    font-size: 0.78rem;
    color: var(--sms-text-muted);
    margin-top: 2px;
}

/* ─── Sections ─── */
.sms-section {
    background: var(--sms-surface);
    border-radius: var(--sms-radius);
    padding: 28px 24px;
    margin-bottom: 20px;
    box-shadow: var(--sms-shadow);
    border: 1px solid var(--sms-border);
}
.sms-section__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sms-text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}
.sms-section__icon { width: 22px; height: 22px; color: var(--sms-primary); flex-shrink: 0; }

/* ─── Gender Bar ─── */
.sms-gender-section { margin-bottom: 20px; }
.sms-gender-bar {
    display: flex;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
.sms-gender-bar__male {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.sms-gender-bar__female {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.sms-gender-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
}
.sms-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sms-text-muted);
}
.sms-legend i {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}
.sms-legend--male i { background: var(--sms-male); }
.sms-legend--female i { background: var(--sms-female); }

/* ─── Universitas Grid ─── */
.sms-uni-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sms-uni-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: var(--sms-radius-sm);
    border: 1px solid #e2e8f0;
    transition: background 0.2s, transform 0.2s;
}
.sms-uni-item:hover {
    background: #f0fdf4;
    transform: translateX(4px);
}
.sms-uni-item__header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.sms-uni-item__no {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--sms-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.sms-uni-item__name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sms-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sms-uni-item__pct {
    font-family: var(--sms-mono);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--sms-primary);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

/* Progress Bars */
.sms-progress {
    height: 10px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.sms-progress__bar {
    height: 100%;
    border-radius: 6px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.sms-progress__bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: smsShimmer 2.5s ease-in-out infinite;
}
.sms-progress--high { background: linear-gradient(90deg, #059669, #34d399); }
.sms-progress--mid  { background: linear-gradient(90deg, #d97706, #fbbf24); }
.sms-progress--low  { background: linear-gradient(90deg, #dc2626, #f87171); }

@keyframes smsShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ─── Fakultas Table ─── */
.sms-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.sms-filter__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sms-text-muted);
}
.sms-filter__select {
    padding: 8px 36px 8px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: var(--sms-font);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sms-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 220px;
}
.sms-filter__select:focus {
    outline: none;
    border-color: var(--sms-primary);
    box-shadow: 0 0 0 3px rgba(10,110,92,0.12);
}

.sms-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--sms-radius-sm);
    border: 1px solid #e2e8f0;
}
.sms-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 0.85rem;
}
.sms-table thead {
    background: linear-gradient(135deg, var(--sms-primary-dark), var(--sms-primary));
}
.sms-table th {
    padding: 14px 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 2;
}
.sms-table th:last-child { border-right: none; }
.sms-th--no { width: 48px; }
.sms-th--name { text-align: left; min-width: 180px; }
.sms-th--fak { min-width: 100px; }

.sms-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
}
.sms-td--no {
    font-weight: 600;
    color: var(--sms-text-muted);
    text-align: center;
}
.sms-td--name {
    text-align: left;
    font-weight: 600;
    color: var(--sms-text);
}
.sms-td--val { position: relative; }
.sms-td__num {
    font-family: var(--sms-mono);
    font-weight: 600;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 4px;
}
.sms-td--high .sms-td__num { color: var(--sms-high); }
.sms-td--mid .sms-td__num { color: var(--sms-mid); }
.sms-td--low .sms-td__num { color: var(--sms-low); }

.sms-mini-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.sms-mini-bar__fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.sms-table tbody tr {
    transition: background 0.15s;
}
.sms-table tbody tr:hover {
    background: #f0fdf4;
}
.sms-table tbody tr:nth-child(even) {
    background: #f8fafc;
}
.sms-table tbody tr:nth-child(even):hover {
    background: #f0fdf4;
}

.sms-tfoot-row {
    background: linear-gradient(90deg, #f0fdf4, #ecfdf5) !important;
    border-top: 2px solid var(--sms-primary);
}
.sms-tfoot-row td { padding: 14px 12px; }

/* Fakultas column hide/show */
.sms-th--fak.sms-hidden,
.sms-td--val.sms-hidden {
    display: none;
}

/* Color Legend */
.sms-legend-bar {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}
.sms-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sms-text-muted);
}
.sms-legend-item i {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}
.sms-legend-item--high i { background: var(--sms-high); }
.sms-legend-item--mid i { background: var(--sms-mid); }
.sms-legend-item--low i { background: var(--sms-low); }

/* ─── Total Jawaban ─── */
.sms-jawaban-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sms-jawaban-item {
    display: grid;
    grid-template-columns: 220px 1fr 90px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--sms-radius-sm);
    border: 1px solid #e2e8f0;
    transition: background 0.2s, transform 0.2s;
}
.sms-jawaban-item:hover {
    background: #f0fdf4;
    transform: translateX(4px);
}
.sms-jawaban-item--uni {
    background: linear-gradient(90deg, #ecfdf5, #d1fae5);
    border-color: var(--sms-primary);
    border-width: 2px;
}
.sms-jawaban-item--uni:hover {
    background: linear-gradient(90deg, #d1fae5, #a7f3d0);
}
.sms-jawaban-item__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sms-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sms-jawaban-item__bar-wrap {
    height: 10px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.sms-jawaban-item__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--sms-primary), var(--sms-primary-light));
    border-radius: 6px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.sms-jawaban-item--uni .sms-jawaban-item__bar {
    background: linear-gradient(90deg, var(--sms-accent), var(--sms-accent-light));
}
.sms-jawaban-item__total {
    font-family: var(--sms-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sms-primary);
    text-align: right;
}
.sms-jawaban-item--uni .sms-jawaban-item__total {
    color: var(--sms-accent);
}

/* ─── Footer ─── */
.sms-footer {
    text-align: center;
    padding: 20px 0 0;
    color: var(--sms-text-muted);
    font-size: 0.8rem;
}
.sms-footer__ts {
    margin-top: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ─── Error ─── */
.sms-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: var(--sms-radius);
    padding: 32px;
    text-align: center;
    color: #b91c1c;
    font-weight: 600;
}

/* ─── Animations ─── */
.sms-stagger {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.sms-stagger.sms-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .sms-summary { grid-template-columns: repeat(2, 1fr); }
    .sms-uni-item { grid-template-columns: 1fr 1fr auto; }
    .sms-jawaban-item { grid-template-columns: 180px 1fr 80px; }
}

@media (max-width: 768px) {
    .sms-dashboard { padding: 12px 8px 32px; }
    .sms-header { padding: 28px 20px; }
    .sms-header__inner { flex-direction: column; text-align: center; gap: 16px; }
    .sms-header__icon { width: 48px; height: 48px; }
    .sms-header__text h2 { font-size: 1.25rem; }

    .sms-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
    .sms-card { padding: 16px 14px; gap: 12px; }
    .sms-card__value { font-size: 1.5rem; }

    .sms-section { padding: 20px 16px; }
    .sms-section__title { font-size: 1rem; }

    .sms-uni-item {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .sms-uni-item .sms-progress { grid-column: 1 / -1; }

    .sms-filter { flex-direction: column; align-items: stretch; }
    .sms-filter__select { min-width: 100%; }

    .sms-jawaban-item {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .sms-jawaban-item__bar-wrap { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .sms-summary { grid-template-columns: 1fr; }
    .sms-card { flex-direction: row; align-items: center; }
    .sms-gender-bar { height: 36px; }
    .sms-gender-bar__male span,
    .sms-gender-bar__female span { font-size: 0.75rem; }
}

/* ─── Print ─── */
@media print {
    .sms-dashboard { padding: 0; background: #fff; }
    .sms-header { background: #0a6e5c !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sms-card, .sms-section { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    .sms-stagger { opacity: 1 !important; transform: none !important; }
    .sms-progress__bar, .sms-mini-bar__fill, .sms-jawaban-item__bar { transition: none; }
    .sms-filter { display: none; }
}
