/* Main Stylesheet for Triaview-Wewanto */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --font-main: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
    --color-bg: #f9fafb;
    --color-text: #111827;
    --color-primary: #2563eb;
    --color-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-md: 0.375rem;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: #4e73df;
    text-decoration: none;
}

.topnav {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 56px;
    min-height: 56px;
    background-color: #343a40;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    width: 100%;
    max-width: 100%;
}

.topnav a {
    color: #dee2e6;
    font-weight: 600;
    margin: 0 12px;
    line-height: 56px;
}

.topnav a:hover {
    color: #fff;
}

/* 1. Left Section */
.nav-left {
    position: absolute;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dee2e6;
}

.nav-left a {
    color: #dee2e6;
}

/* 3. Right Section */
.nav-right {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dee2e6;
}

.nav-right a {
    color: #dee2e6;
}

.company-label {
    color: #adb5bd;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* ✅ 컨테이너: flex-grow 제거, 폭 100%, 자동 스크롤 허용 */
.container {
    width: 100%;
    max-width: 100%;
    padding: 24px;
    margin: 0 auto;
    overflow: visible;
    /* 내부 스크롤 제거 */
}

.footer {
    padding: 16px;
    font-size: 0.8rem;
    background-color: #f8f9fc;
    text-align: center;
    color: #858796;
    width: 100%;
    max-width: 100%;
}

/* ✅ 모바일 대응 */
@media (max-width: 992px) {
    body {
        font-size: 0.95rem;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        margin: 0 auto;
    }

    .topnav {
        width: 100%;
        justify-content: space-between;
        padding: 0 12px;
        gap: 12px;
    }

    .topnav a {
        font-size: 0.9rem;
        margin: 0 6px;
    }

    .footer {
        font-size: 0.75rem;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        font-size: 0.9rem;
    }

    .topnav {
        flex-wrap: wrap;
    }

    .topnav a {
        font-size: 0.85rem;
    }
}

/* ✅ iPhone 좌우 폭 밀림 차단 */
html,
body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

main,
#content,
.content,
.content-wrapper,
.page,
.container,
.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

img,
canvas,
video {
    max-width: 100% !important;
    height: auto !important;
}

/* ✅ iPhone 안전영역 대응 */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* --- Login Page Styles --- */
.login-page {
    font-family: "Apple SD Gothic Neo", sans-serif;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.login-card input {
    width: 100%;
    padding: 14px;
    margin: 12px 0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    border: 1px solid #ccc;
}

.login-card button {
    width: 100%;
    padding: 14px;
    margin: 12px 0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #000000;
    color: white;
    border: 1px solid #000000;
    cursor: pointer;
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
        max-width: 90%;
    }

    .login-card input,
    .login-card button {
        padding: 12px;
        font-size: 14px;
    }
}

/* --- Consent Page Styles --- */
.consent-page {
    font-family: "Noto Sans CJK KR", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
    background: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.consent-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 720px;
    width: 90%;
    text-align: left;
}

.consent-card h2 {
    text-align: center;
}

.consent-card .user-info {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    color: #333;
}

.consent-card textarea {
    width: 100%;
    height: 240px;
    margin-top: 20px;
    padding: 16px;
    font-size: 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 12px;
    resize: none;
    font-family: inherit;
}

.consent-card label {
    display: block;
    margin-top: 20px;
    font-size: 15px;
}

.consent-card input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 10px;
}

.btn-rounded-primary {
    background-color: #2563eb;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    padding: 14px 20px;
    border-radius: 999px;
    cursor: pointer;
    margin-top: 30px;
    width: 100%;
}

.btn-rounded-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 둥근 기본 버튼과 동일한 스타일 + 좌우 폭만 줄인 버전 */
.btn-rounded-narrow {
    background-color: #2563eb;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    padding: 14px 20px;
    border-radius: 999px;
    cursor: pointer;
    margin-top: 30px;
    width: 50%;
}

.btn-rounded-narrow:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
/* --- Dashboard & Generic Admin Styles --- */

/* Typography */
.greeting {
    font-size: 1.8rem;
    font-weight: 700;
    color: #343a40;
    margin: 20px 0 5px;
}

.sub-greeting {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 25px;
}

/* Dashboard Grid */
.dashboard-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    max-width: 100%;
}

@media (max-width: 992px) {
    .dashboard-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* Base Card */
.card {
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.card.primary {
    background: #007bff;
    color: #fff;
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 12px;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.card-link {
    font-size: .85rem;
    text-decoration: underline;
    color: inherit;
    margin-top: 10px;
    display: inline-block;
}

@media (max-width: 576px) {
    .card {
        padding: 16px;
    }
}

/* Charts & KPI */
.chart-box {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.pie-chart {
    width: min(200px, 80vw);
    aspect-ratio: 1/1;
    height: auto;
    border-radius: 50%;
    border: 8px solid #fff;
    max-width: 100%;
}

@media (max-width: 768px) {
    .chart-box {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .pie-chart {
        width: min(180px, 70vw);
        border-width: 6px;
        margin: 0 auto;
    }
}

@media (max-width: 400px) {
    .pie-chart {
        width: min(150px, 65vw);
        border-width: 5px;
    }
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    text-align: left;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    word-break: keep-all;
}

.kpi-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.kpi-big {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    color: #111827;
}

.kpi-unit {
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
}

.pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pill {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f3f5;
    color: #495057;
}

/* Progress & Sparklines */
.progress-wrap {
    margin-top: 8px;
}

.progress {
    height: 12px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}

.progress>div {
    height: 100%;
    background: #007bff;
}

.spark {
    width: 100%;
    margin-top: 14px;
}

.spark-bars {
    height: 120px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 0 6px;
    border-bottom: 1px dashed #e9ecef;
}

.spark-bars>div {
    width: 100%;
    background: #007bff;
    border-radius: 4px 4px 0 0;
}

.spark-labels {
    display: grid;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: #6c757d;
    text-align: center;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-default {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-size: .9rem;
    min-width: 520px;
}

.table-default th,
.table-default td {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}

.table-default th {
    background-color: #f9f9f9;
    font-weight: bold;
}

/* Badges & Text utils */
.muted {
    color: #6c757d;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .75rem;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #374151;
}

.warn {
    margin-left: 8px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffe8a1;
}

@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }
}

/* --- Admin Register / Form Styles --- */
.top-buttons {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    gap: 10px;
}

.top-buttons button {
    background-color: transparent;
    color: #000000;
    border: 2px solid #000000;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-buttons button:hover {
    background-color: #000000;
    color: white;
}

/* Button Classes */
.button2 {
    padding: 6px 14px;
    color: white;
    background-color: black;
    border: 1.5px solid black;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.button2:hover {
    background-color: #6c757d;
    border: 1.5px solid #6c757d;
    color: white;
}

.button3 {
    padding: 6px 14px;
    background-color: transparent;
    color: #000000;
    border: 1.5px solid #000000;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.button3:hover {
    background-color: #000000;
    color: white;
}

.button4 {
    padding: 6px 14px;
    background-color: #6c757d;
    color: white;
    border: 1.5px solid #6c757d;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.button4:hover {
    background-color: white;
    color: #6c757d;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 18px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1.5px solid #6c757d;
    padding: 8px 18px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: white;
    border: 1.5px solid black;
    color: rgb(0, 0, 0);
}

/* Forms & Modals */
.form-input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background: #fff url("data:image/svg+xml;utf8,<svg fill='gray' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

.modal {
    z-index: 2000;
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.chip {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer
}

.chip:hover {
    background: #f9fafb
}

.chip.active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
    font-weight: 700
}

.text-status {
    margin-right: 8px;
    display: inline-block;
    border-color: #c7d2fe;
    color: #4338ca;
    font-weight: 700
}


/* --- Admin Interview Report Styles --- */

/* Responsive Utils */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}

/* Report Tables */
.clean-table {
    width: 100%;
    border-collapse: collapse;
}

.clean-table thead th {
    font-weight: 600;
    background: #f9fafb;
    border-bottom: 1px solid #e9ecef !important;
    padding: 12px 14px !important;
    text-align: center;
    white-space: nowrap;
}

.clean-table th,
.clean-table td {
    padding: 12px 14px !important;
    border-color: #e9ecef !important;
    vertical-align: top;
    line-height: 1.6;
}

.clean-table td.text-left {
    padding-left: 0 !important;
}

.clean-table tbody tr:hover {
    background: #fafafa;
}

/* Report Columns */
.clean-table .col-no {
    width: 56px;
    text-align: center;
    color: #64748b;
    font-weight: 600;
}

.clean-table .col-q {
    width: 34%;
    text-align: left;
}

.clean-table .col-a {
    text-align: left;
}

.clean-table .col-v {
    width: 160px;
    text-align: center;
}

/* Text Readability */
.clean-table .col-q,
.clean-table .col-a {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    hyphens: auto;
    word-break: keep-all;
}

/* Thumbnails */
.thumb-video {
    width: 140px;
    max-height: 160px;
    border-radius: 8px;
    background: #000;
}

/* Links */
.link-sub {
    color: #0d6efd;
    text-decoration: none;
    font-size: 13px;
}

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

.link-more {
    margin-top: 6px;
    padding: 0;
    background: none;
    border: none;
    color: #0d6efd;
    font-size: 13px;
    cursor: pointer;
}

/* Info Table (Mobile) */
@media (max-width: 768px) {
    .info-table {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 16px;
        border-collapse: separate;
        border-spacing: 0;
    }

    .info-table tr {
        display: contents;
    }

    .info-table th,
    .info-table td {
        display: block;
        width: 100%;
        border: none;
        background: none;
        padding: 8px 0;
        font-size: 15px;
        line-height: 1.4;
    }

    .info-table th {
        font-weight: 600;
        text-align: left;
        color: #333;
    }

    .info-table td {
        font-weight: 600;
        text-align: left;
        color: #333;
    }

    .eval-table {
        font-size: 14px;
    }

    .eval-table td {
        padding: 9px 10px;
    }

    .eval-table thead th {
        padding: 10px;
    }

    .eval-table th:nth-child(3),
    .eval-table td:nth-child(3) {
        width: 64px;
    }

    .eval-table th:nth-child(4),
    .eval-table td:nth-child(4) {
        width: auto;
        line-height: 1.65;
    }

    .eval-table tbody tr:nth-child(odd) td {
        border-top: 1.5px solid #dee2e6;
    }
}

.eval-table td:nth-child(4) {
    width: auto;
    line-height: 1.65;
}


/* --- Admin Pricing Styles --- */
.pricing-wrap {
    max-width: 1200px;
    margin: 8px auto 40px;
    padding: 0 8px;
}

.pricing-intro {
    color: #6b7280;
    margin-top: 6px;
    margin-bottom: 14px
}

.credit-badge {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 10px 0 18px;
    display: inline-flex;
    gap: 8px;
    align-items: center
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

@media (max-width: 992px) {
    .pricing-grid {
        grid-template-columns: 1fr
    }
}

.p-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 360px
}

.p-card.popular {
    border: 2px solid #0d6efd;
    box-shadow: 0 10px 28px rgba(13, 110, 253, .12)
}

.p-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #0d6efd;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px
}

.p-title {
    font-size: 20px;
    margin: 2px 0 4px
}

.p-sub {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 10px
}

.p-price {
    font-size: 26px;
    font-weight: 700;
    margin: 12px 0 16px;
    color: #0d6efd
}

.p-price small {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500
}

.p-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    color: #374151;
    font-size: 14px;
    line-height: 1.55
}

.p-list li {
    position: relative;
    padding-left: 22px;
    margin: 6px 0
}

.p-list li:before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e8f0ff;
    border: 2px solid #0d6efd;
    position: absolute;
    left: 0;
    top: 4px
}

.p-cta {
    margin-top: auto;
    display: block;
    text-align: center;
    text-decoration: none;
    border: 1px solid #0d6efd;
    background: #0d6efd;
    color: #fff;
    border-radius: 10px;
    padding: 11px 14px;
    font-weight: 600
}

.p-cta:active {
    transform: translateY(1px)
}

.p-cta2 {
    margin-top: auto;
    display: block;
    text-align: center;
    text-decoration: none;
    border: 1px solid #0d6efd;
    background: #fff;
    color: #0d6efd;
    border-radius: 10px;
    padding: 11px 14px;
    font-weight: 600
}

.p-cta2:active {
    transform: translateY(1px)
}

.ribbon {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(90deg, #eaf2ff, #f5f9ff);
    border: 1px dashed #c7d8ff;
    color: #304e8a
}

.ribbon a {
    color: #0d6efd;
    text-decoration: none;
    border: 1px solid #0d6efd;
    background: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    margin-left: 8px
}

/* --- Interview / Auth Shared Styles --- */
.interview-body {
    font-family: "Apple SD Gothic Neo", sans-serif;
    background-color: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.interview-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.interview-title {
    margin-bottom: 24px;
    color: #111827;
    font-size: 24px;
    font-weight: bold;
}

.interview-text {
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.interview-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
}

.interview-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.interview-btn:hover {
    background-color: #1d4ed8;
}

.interview-link {
    text-decoration: none;
    color: rgb(184, 178, 178);
    margin: 0 8px;
}


.interview-btn:hover {
    background-color: #1d4ed8;
}


/* --- SuperAdmin & Credits Styles --- */
:root {
    --bg: #f6f7fb;
    --card: #fff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --danger: #dc2626;
    --ok: #16a34a;
}

/* Layout Wrappers */
.hist-wrap,
.sa-wrap {
    max-width: 1200px;
    margin: 12px auto 40px;
    padding: 0 12px;
}

.hist-head,
.sa-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 6px 0 16px;
}

.hist-title,
.sa-title {
    font-size: 28px;
    margin: 0;
    color: var(--text);
    letter-spacing: -.2px;
}

/* SuperAdmin Card */
.sa-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
    padding: 12px;
}

/* Tables (Sticky Headers) */
.sa-table-wrap,
.table-wrap {
    overflow: auto;
}

.sa-table,
.h-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.sa-table thead th,
.h-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    text-align: left;
    padding: 12px;
    font-weight: 700;
    color: #374151;
    z-index: 10;
}

.sa-table tbody td,
.h-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.sticky-col-1 {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 11;
}

.sticky-col-2 {
    position: sticky;
    left: 120px;
    background: #fff;
    z-index: 11;
}

/* Form Elements */
.sa-input {
    height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    outline: none;
}

.sa-btn {
    height: 36px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #111827;
}

.sa-btn:hover {
    background-color: #f9fafb;
}

.sa-btn.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.sa-btn.primary:hover {
    background-color: #1d4ed8;
}

.sa-btn.ghost {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff;
}

.sa-btn.danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

/* Utils */
.delta {
    font-variant-numeric: tabular-nums;
}

.delta.plus {
    color: #2563eb;
    font-weight: 700;
}

.badge-zero {
    background: #fff0f0;
    border: 1px solid #ffd4d4;
    color: #b91c1c;
}

.sa-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

/* Grids */
.company-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.job-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-6 {
    grid-column: span 6;
}

/* --- Interview Room Interface --- */
.interview-room-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 720px;
    width: 90%;
    text-align: center;
    position: relative;
    margin: 16px;
}

.interview-video {
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: black;
}

.interview-timer {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 14px;
    color: #ef4444;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px 10px;
    border-radius: 999px;
}

.int-btn {
    background-color: #2563eb;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    padding: 14px 20px;
    border-radius: 999px;
    cursor: pointer;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Toast & Loading */
#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #10b981;
    color: white;
    padding: 14px 24px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 9999;
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, -60%);
}

#loading {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 10;
}

.dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.dots span {
    width: 12px;
    height: 12px;
    background: #999;
    border-radius: 50%;
    animation: blink 1.4s infinite ease-in-out both;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

#countdownText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 300px;
    font-weight: bold;
    color: #ef4444;
    z-index: 1000;
}

@media (max-width: 480px) {
    #countdownText {
        font-size: 100px
    }
}

/* Mic Indicator Styles (Teams-like) */
#mic-level {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    z-index: 9999;
    display: none;
}

#mic-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00b894, #fdcb6e, #d63031);
    transition: width 0.1s ease-out;
}

#mic-indicator,
#mic-indicator-preview {
    position: absolute;
    left: 10px;
    top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(16, 24, 40, 0.65);
    border-radius: 999px;
    backdrop-filter: blur(4px);
    color: #fff;
    z-index: 20;
    pointer-events: none;
}

#mic-indicator.hidden,
#mic-indicator-preview.hidden {
    display: none;
}

.mic-badge {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    display: grid;
    place-items: center;
    position: relative;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

#mic-indicator.speaking .mic-badge::after,
#mic-indicator-preview.speaking .mic-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: pulse 1.2s ease-out infinite;
}

.bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
}

.bars span {
    width: 3px;
    height: 3px;
    border-radius: 2px;
    background: #9CA3AF;
    transition: height 80ms linear, background-color 120ms ease;
}

.level-1 .bars span {
    background: #34D399;
}

.level-2 .bars span {
    background: #FBBF24;
}

.level-3 .bars span {
    background: #F87171;
}

.sa-form-card {
    margin-bottom: 2rem;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
}

.status-dot.green {
    background: #28a745;
}

.status-dot.orange {
    background: #fb9b25;
}

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

.filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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