.grade-converter-ui {
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-bg-card: #fff;
    --color-bg-sub: #f8fafc;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --divider: 1px solid var(--color-border);
}

.theme-dark .grade-converter-ui {
    --color-bg-card: #1e293b;
    --color-bg-sub: #0f172a;
    --color-border: #334155;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
}

.grade-converter-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

.main-converter-card {
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Header & Toggle */
.section-header {
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-sub);
    border-bottom: var(--divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    margin: 0;
}

.mode-toggle {
    display: flex;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    padding: 0.25rem;
    border-radius: 0.75rem;
    gap: 0.25rem;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--color-text);
    color: var(--color-bg-card);
}

/* Body */
.converter-body {
    padding: 1.5rem;
    border-bottom: var(--divider);
}

.selection-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--color-border);
}

.input-pane {
    display: none;
}

.input-pane.active {
    display: block;
}

.field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.field-control {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg-sub);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
}

.bulk-textarea {
    min-height: 120px;
    font-size: 0.9rem;
}

.bulk-stats {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-bg-sub);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
}

.stats-main {
    display: flex;
    gap: 1.5rem;
}

.ignored-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    color: var(--color-error);
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--color-primary);
}

.label-with-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.help-tooltip {
    color: var(--color-text-muted);
    cursor: help;
    display: flex;
    align-items: center;
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    transform: translateY(5px) scale(0.95);
    background: #1e293b;
    color: var(--color-bg-card);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    width: 240px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.help-tooltip:hover .tooltip-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 14px;
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* Dashboard */
.results-pane {
    padding: 1.5rem;
}

.pane-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-row {
    display: grid;
    grid-template-columns: 140px 1fr 100px;
    align-items: center;
    padding: 1rem;
    background: var(--color-bg-sub);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    gap: 1.5rem;
}

.target-info {
    font-weight: 800;
}

.progress-strip {
    height: 10px;
    background: var(--color-border);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.pass-mark {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-text);
    opacity: 0.2;
}

.grade-out {
    text-align: right;
    display: flex;
    flex-direction: column;
    cursor: copy;
}

.grade-out .val {
    font-size: 1.5rem;
    font-weight: 900;
}

.grade-out .lbl {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.card-footer {
    padding: 1.5rem;
    background: var(--color-bg-sub);
    border-top: var(--divider);
    display: flex;
    justify-content: center;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: var(--color-primary);
    color: var(--color-bg-card);
    border: none;
    border-radius: 1rem;
    font-weight: 900;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    font-weight: 600;
}
