/* ==========================================================================
   Shared Styles — Sciobot-inspired modern design
   ========================================================================== */

/* Page layout — used by LoginLayout (MainLayout has its own scoped CSS) */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page main {
    flex: 1;
    width: 100%;
    margin-bottom: 10px;
}

.page .content {
    padding: 0;
}

/* Login Page
   ========================================================================== */

.login-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f8fafc 0%, #e8edf5 50%, #dde4f0 100%);
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* Brand */
.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 2.25rem;
}

.login-brand-logo {
    height: 32px;
    width: auto;
}

/* Typography */
.login-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.login-subtitle {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0 0 2rem;
    line-height: 1.6;
}

/* Form */
.login-form-group {
    margin-bottom: 1.25rem;
}

.login-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-align: center;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.login-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.login-input::placeholder {
    color: #94a3b8;
    letter-spacing: normal;
    font-weight: 400;
}

/* Error */
.login-error {
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    padding: 0.625rem 1rem;
    background: #fef2f2;
    border-radius: 10px;
    border: 1px solid #fecaca;
    line-height: 1.5;
}

/* Button */
.login-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.login-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* Responsive */
@media (max-width: 480px) {
    .login-page {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 3rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.375rem;
    }

    .login-subtitle {
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   App Header
   ========================================================================== */

.app-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.app-header-brand-logo {
    height: 16px;
    width: auto;
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    position: relative;
}

.app-header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
}

.app-header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.app-header-user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1e293b;
}

.app-header-user-email {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.2;
}

.app-header-user-trigger {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    border-radius: 6px;
}

.app-header-user-trigger:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.app-header-dropdown-icon {
    width: 20px;
    height: 20px;
}

.app-header-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 98;
}

.app-header-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    min-width: 180px;
    z-index: 99;
}

.app-header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.app-header-dropdown-item:hover {
    background: #f1f5f9;
}

.app-header-dropdown-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.page-with-header .content {
    padding-top: 1.5rem;
}

/* ==========================================================================
   App Footer
   ========================================================================== */

.app-footer {
    flex-shrink: 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 0;
}

.app-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-footer-text {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

/* ==========================================================================
   Tests Page
   ========================================================================== */

.tests-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header-with-back,
.page-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header-with-back {
    margin-bottom: 1.5rem;
}

.tests-page .page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-green {
    background: #16a34a;
}

.btn-green:hover {
    background: #15803d;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-watch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.875rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-watch:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-admin-users {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.875rem;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-admin-users:hover {
    background: #6d28d9;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.btn-stop-watch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.875rem;
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-stop-watch:hover {
    background: #ea6c00;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

.btn-stop-watch-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.tests-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-top: 30px;
    margin-bottom: 20px;
}

.tests-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: #64748b;
    font-size: 0.9375rem;
}

.tests-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tests-empty {
    padding: 3rem;
    text-align: center;
    color: #64748b;
}

.tests-empty-hint {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.admin-access-denied {
    padding: 3rem;
    text-align: center;
    color: #dc2626;
    font-weight: 500;
}

.admin-users-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-badge {
    display: inline-flex;
    color: #3b82f6;
}

.admin-badge svg {
    width: 16px;
    height: 16px;
}

.admin-users-code-cell.admin-users-code-masked {
    cursor: pointer;
    user-select: none;
}

/* Admin code reveal modal */
.admin-code-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.admin-code-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.admin-code-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.admin-code-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.admin-code-modal-close {
    padding: 0.35rem;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
}

.admin-code-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.admin-code-modal-close svg {
    width: 20px;
    height: 20px;
}

.admin-code-modal-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-code-modal-code {
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    font-size: 0.9375rem;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    word-break: break-all;
}

.admin-code-modal-copy {
    align-self: flex-start;
}

.tests-table {
    width: 100%;
    border-collapse: collapse;
}

.tests-table thead {
    background: #f1f5f9;
}

.tests-table th {
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tests-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

.tests-table tbody tr:last-child {
    border-bottom: none;
}

.tests-row {
    cursor: pointer;
}

.tests-row:hover {
    background: #f8fafc;
}

.tests-table td {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    color: #1e293b;
    background: #fff;
}

.tests-table-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tests-table-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.tests-table th.tests-table-date,
.tests-table td.tests-table-date {
    text-align: right;
}

.tests-row:hover td {
    background: #f8fafc;
}

.tests-table td:first-child {
    font-weight: 500;
}

/* Table search box */
/* Horizontal scroll for wide tables */
.tests-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-search {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.table-search-inner {
    position: relative;
    max-width: 320px;
}

.table-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.table-search input::placeholder {
    color: #94a3b8;
}

.table-search input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.table-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
}

.table-search input:focus ~ .table-search-icon {
    color: #3b82f6;
}

/* Pagination bar */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #64748b;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.pagination-info-text strong {
    color: #1e293b;
}

.pagination-size-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-size-select label {
    margin: 0;
    font-weight: 500;
    color: #64748b;
}

.pagination-size-select select {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
}

.pagination-size-select select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #3b82f6;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 20px;
    height: 20px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-page {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.pagination-page:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.pagination-page-active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.pagination-page-active:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    font-size: 0.875rem;
    color: #94a3b8;
}

/* State badges for elaborations */
.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.state-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.state-icon.state-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.state-badge.state-waitingforprocessing {
    background: #fef3c7;
    color: #b45309;
}

.state-badge.state-processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.state-badge.state-waitingforrevision {
    background: #e0e7ff;
    color: #4338ca;
}

.state-badge.state-waitingforfeedback {
    background: #fce7f3;
    color: #be185d;
}

.state-badge.state-processingfeedback {
    background: #ede9fe;
    color: #6d28d9;
}

.state-badge.state-completed {
    background: #dcfce7;
    color: #166534;
}

.state-badge.state-waitingforfeedbackrevision {
    background: #e0e7ff;
    color: #4338ca;
}

.state-badge.state-errored {
    background: #fee2e2;
    color: #b91c1c;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.access-denied {
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    font-size: 1rem;
    font-weight: 500;
}

/* Limit exceeded modal */
.limit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.limit-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.limit-modal-box p {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary {
        justify-content: center;
    }
}

/* ==========================================================================
   NewTest Page
   ========================================================================== */

.new-test-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.new-test-page .page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.new-test-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.new-test-card .form-group {
    margin-bottom: 1.5rem;
}

.new-test-card .form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.new-test-card .form-label .required {
    color: #dc2626;
}

.new-test-card .form-label .optional {
    font-weight: 400;
    color: #64748b;
}

.new-test-card .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.new-test-card .form-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.new-test-card .form-input.input-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.new-test-card .form-input.input-invalid:focus {
    border-color: #dc2626;
}

.new-test-card .validation-error {
    display: block;
    color: #dc2626;
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.new-test-card .validation-hint {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.strictness-tiles {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.strictness-tile {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
}

.strictness-tile:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #1e293b;
}

.strictness-tile.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.strictness-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.new-test-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    background: #f8fafc;
    transition: all 0.2s ease;
    min-height: 140px;
}

.new-test-drop-zone:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.new-test-drop-zone.dragging {
    border-color: #3b82f6;
    background: #eff6ff;
}

.drop-zone-inner {
    text-align: center;
    cursor: pointer;
}

.drop-zone-inner.empty,
.drop-zone-inner.has-files {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.drop-zone-inner.has-files {
    width: 100%;
    min-height: 120px;
}

.drop-icon {
    width: 40px;
    height: 40px;
    color: #94a3b8;
}

.drop-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    margin: 0;
}

.drop-hint {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0;
}

.drop-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    padding: 0.5rem;
}

.drop-file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    min-width: 140px;
}

.drop-file-icon {
    width: 36px;
    height: 36px;
    color: #3b82f6;
}

.drop-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    text-align: center;
    word-break: break-word;
    max-width: 140px;
}

.drop-file-size {
    font-size: 0.75rem;
    color: #64748b;
}

.new-test-actions {
    margin-top: 2rem;
}

.new-test-actions .btn-primary .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.section-hint {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 1.5rem;
}

/* Import uživatelů */
.import-info-text {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0 0 1.5rem;
}

.import-upload-section {
    margin-bottom: 1.5rem;
}

.import-actions {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.import-actions .btn-primary .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.image-preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.image-preview-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.image-preview-wrapper {
    width: 280px;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rotation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rot-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.rot-btn:hover {
    background: #3b82f6;
    color: #fff;
}

.rot-btn svg {
    width: 20px;
    height: 20px;
}

.rot-label {
    font-size: 0.75rem;
    color: #64748b;
}

/* Elaboration page */
.elaboration-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.elaboration-state-text {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1.5rem;
}

.elaboration-state-text.elaboration-state-error {
    color: #b91c1c;
}

.elaboration-placeholder {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0;
}

.preview-page-label {
    font-size: 0.75rem;
    color: #64748b;
}

.solution-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.solution-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.solution-step-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.solution-step.completed .solution-step-indicator {
    background: #22c55e;
    color: #fff;
}

.solution-step.processing .solution-step-indicator {
    background: #3b82f6;
}

.solution-step.pending .solution-step-indicator {
    background: #e2e8f0;
    color: #64748b;
}

.step-done {
    font-size: 0.875rem;
    font-weight: 700;
}

.step-num {
    font-size: 0.75rem;
    font-weight: 600;
}

.step-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.solution-step-name {
    font-size: 0.9375rem;
    color: #1e293b;
}

/* ==========================================================================
   Tooltip — reusable across app
   ========================================================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 0.5rem);
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-tooltip]::after {
    content: "";
    bottom: calc(100% + 0.125rem);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-2px);
}

[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(-2px);
}

/* Right-aligned tooltip for elements in top-right corner (avoids overflow clipping) */
.item-edit-btn[data-tooltip]::before {
    left: auto;
    right: 0;
    transform: none;
}

.item-edit-btn[data-tooltip]:hover::before {
    transform: translateY(-2px);
}

.item-edit-btn[data-tooltip]::after {
    left: auto;
    right: 0.5rem;
    transform: none;
}

.item-edit-btn[data-tooltip]:hover::after {
    transform: translateY(-2px);
}

/* ---- Tooltip auto-position variants ---- */

/* Below */
[data-tooltip].tooltip-bottom::before {
    top: calc(100% + 0.5rem);
    bottom: auto;
}
[data-tooltip].tooltip-bottom::after {
    top: calc(100% + 0.125rem);
    bottom: auto;
    border-top-color: transparent;
    border-bottom-color: #1e293b;
}
[data-tooltip].tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(2px);
}
[data-tooltip].tooltip-bottom:hover::after {
    transform: translateX(-50%) translateY(2px);
}

/* Left */
[data-tooltip].tooltip-left::before {
    bottom: auto;
    top: 50%;
    left: auto;
    right: calc(100% + 0.5rem);
    transform: translateY(-50%);
}
[data-tooltip].tooltip-left::after {
    bottom: auto;
    top: 50%;
    left: auto;
    right: calc(100% + 0.125rem);
    transform: translateY(-50%);
    border-top-color: transparent;
    border-left-color: #1e293b;
    border-right-color: transparent;
}
[data-tooltip].tooltip-left:hover::before {
    transform: translateY(-50%) translateX(-2px);
}
[data-tooltip].tooltip-left:hover::after {
    transform: translateY(-50%) translateX(-2px);
}

/* Right */
[data-tooltip].tooltip-right::before {
    bottom: auto;
    top: 50%;
    left: calc(100% + 0.5rem);
    transform: translateY(-50%);
}
[data-tooltip].tooltip-right::after {
    bottom: auto;
    top: 50%;
    left: calc(100% + 0.125rem);
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: #1e293b;
}
[data-tooltip].tooltip-right:hover::before {
    transform: translateY(-50%) translateX(2px);
}
[data-tooltip].tooltip-right:hover::after {
    transform: translateY(-50%) translateX(2px);
}

/* Tooltip above, left-aligned with the icon */
.ts-icon-wrap[data-tooltip]::before {
    bottom: calc(100% + 0.5rem);
    top: auto;
    left: 0;
    transform: none;
    white-space: nowrap;
}
.ts-icon-wrap[data-tooltip]::after {
    bottom: calc(100% + 0.125rem);
    top: auto;
    left: 0.5rem;
    transform: none;
}
.ts-icon-wrap[data-tooltip]:hover::before {
    transform: translateY(-2px);
}
.ts-icon-wrap[data-tooltip]:hover::after {
    transform: translateY(-2px);
}

/* Right-aligned tooltip for feedback edit button (avoids overflow clipping) */
.feedback-edit-icon-btn[data-tooltip]::before {
    left: auto;
    right: 0;
    transform: none;
    white-space: nowrap;
}

.feedback-edit-icon-btn[data-tooltip]:hover::before {
    transform: translateY(-2px);
}

.feedback-edit-icon-btn[data-tooltip]::after {
    left: auto;
    right: 0.5rem;
    transform: none;
}

.feedback-edit-icon-btn[data-tooltip]:hover::after {
    transform: translateY(-2px);
}
