:root {
    --bg-main: #0b0e14;
    --bg-card: #121721;
    --bg-panel: #181f2c;
    --border-color: #232c3d;
    --border-hover: #3b82f6;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* * { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
} */

/* Dashboard Container */
.dashboard {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    /* Refined centered layout */
    /* padding: 28px; */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Header */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.shield-badge {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 10px;
    border-radius: var(--radius-md);
    display: flex;
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.brand p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Segmented Control */
.mode-switch {
    background: #090c10;
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: var(--radius-md);
    display: flex;
    gap: 4px;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn.active {
    background: #ff9800;
    color: var(--text-main);
    border: 1px solid #ff9800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Single Workspace Area */
.dash-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.workspace-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    min-height: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Status Banner */
.status-banner {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.status-info {
    display: flex;
    /* align-items: center; */
    gap: 12px;
}

.status-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    flex-shrink: 0; /* Keeps the container a perfect circle */
}

.status-banner h4 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-banner p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.status-banner.passed {
    background: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.3);
}

.status-banner.passed .status-icon-box {
    background: var(--success);
    color: #fff;
}

.status-banner.passed h4 {
    color: var(--success);
}

.status-banner.failed {
    background: var(--error-bg);
    border-color: rgba(239, 68, 68, 0.3);
}

.status-banner.failed .status-icon-box {
    background: var(--error);
    color: #fff;
}

.status-banner.failed h4 {
    color: var(--error);
}

/* View Result Button in Status Banner */
.view-result-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 6px 7px;
    font-size: 0.6rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    margin-left: 42px;
    margin-top: 12px;

}

.view-result-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Dropzone Styles */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(9, 12, 16, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: visible;
    position: relative;
    transition: var(--transition);
    margin: 0 auto;
    width: 100%;
}

.dropzone.mode-photo {
    aspect-ratio: 1 / 1;
    max-width: 260px;
}

.dropzone.mode-sig {
    aspect-ratio: 15 / 4;
    max-width: 320px;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--border-hover);
    background: rgba(59, 130, 246, 0.05);
}

.zone-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px;
}

.cloud-icon {
    color: var(--text-subtle);
    margin-bottom: 8px;
}

.upload-title {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.link-text {
    color: #3b82f6;
    font-weight: 500;
}

.upload-spec {
    font-size: 0.72rem;
    color: var(--text-subtle);
    margin-top: 4px;
}

/* Signature Compact Layout Fixes */
.dropzone.mode-sig .zone-state {
    padding: 6px;
}

.dropzone.mode-sig .cloud-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
}

.dropzone.mode-sig .upload-title {
    font-size: 0.8rem;
    line-height: 1.2;
}

.dropzone.mode-sig .upload-spec {
    font-size: 0.7rem;
    margin-top: 2px;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Loader Spinner */
.loader-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 10px;
}

.processing-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Panel (Swapped inside Workspace) */
.results-panel {
    width: 100%;
}

.specs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.spec-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(9, 12, 16, 0.5);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

.spec-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 2px;
}

.spec-result {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    /* text-align: right; */
}

.spec-val {
    display: flex;
    flex-direction: column;
    /* align-items: flex-end; */
    font-size: 0.85rem;
    font-weight: 600;
}

.val-found.text-pass {
    color: #f8fafc;
}

.val-found.text-fail {
    color: #ef4444;
}

.val-req {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 2px;
}

.check-icon {
    padding-top: 2px;
}

.svg-pass {
    color: var(--success);
}

.svg-fail {
    color: var(--error);
}

#statusIconBox .svg-pass {
    color: #fff;
}
#statusIconBox .svg-fail {
    color: #fff;
}

/* Footer */
.dash-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.primary-btn {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}