:root {
    /* Ultra Premium Dark Theme Colors */
    --bg-base: #06080c;
    --bg-mesh-1: #1a153a;
    --bg-mesh-2: #0d1e3a;
    --bg-mesh-3: #081221;
    
    --glass-bg: rgba(13, 17, 25, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    
    --accent-glow: #3b82f6;
    --accent-electric: #60a5fa;
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* Report Colors (Print/PDF) - Stark & Professional */
    --report-bg: #ffffff;
    --report-text-dark: #0f172a;
    --report-text-body: #334155;
    --report-text-muted: #64748b;
    --report-border: #e2e8f0;
    --report-accent: #1e293b;
    --report-accent-light: #f8fafc;

    /* Typography */
    --font-ui: 'Plus Jakarta Sans', sans-serif;
    --font-serif: 'Playfair Display', serif;
    
    /* Variables */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-glass: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-inner: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --shadow-report: 0 30px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-ui);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Mesh Background */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-base);
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, var(--bg-mesh-1) 0%, transparent 70%);
}
.blob-2 {
    bottom: -20%; right: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, var(--bg-mesh-2) 0%, transparent 70%);
    animation-delay: -5s;
}
.blob-3 {
    top: 40%; left: 40%;
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    opacity: 0.15;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Premium Header */
.app-header {
    display: flex;
    flex-direction: row-reverse; /* Swap: logo to right, buttons/meta to left */
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(6, 8, 12, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.app-header .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.95rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent-electric), var(--accent-glow));
    border-radius: 10px;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.logo span {
    font-weight: 300;
    color: var(--text-secondary);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.autosave-badge {
    opacity: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    font-size: 12px;
    color: #818cf8;
    transition: opacity 0.5s ease;
}

.status-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

/* Premium Control Dock */
.header-controls-dock {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px 8px;
    border-radius: 20px;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

body.light-theme .header-controls-dock {
    background: rgba(15, 23, 42, 0.03) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.header-controls-dock .btn-icon {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
    font-size: 0.95rem !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.header-controls-dock .btn-icon:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: scale(1.05) translateY(0) !important;
}

body.light-theme .header-controls-dock .btn-icon {
    color: rgba(15, 23, 42, 0.6) !important;
}

body.light-theme .header-controls-dock .btn-icon:hover {
    color: rgba(15, 23, 42, 0.9) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.dock-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

body.light-theme .dock-divider {
    background: rgba(0, 0, 0, 0.1);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-electric), var(--accent-glow));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.light-theme .user-name {
    color: rgba(15, 23, 42, 0.7);
}

.btn-logout {
    opacity: 0.7;
}

.btn-logout:hover {
    opacity: 1;
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-electric);
    transform: translateY(-1px);
}

.btn-icon i {
    font-size: 1rem;
    transition: transform 0.4s ease;
}

.btn-icon:hover i {
    transform: rotate(15deg) scale(1.1);
}

.status-indicator {
    width: 8px; height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.header-meta p {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile Tabs Toggle */
.mobile-tabs {
    display: none;
    justify-content: space-around;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(13, 17, 25, 0.4);
}

.tab-btn {
    flex: 1;
    max-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem;
    cursor: pointer;
    border-radius: 20px;
    transition: var(--transition-smooth);
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-btn.active {
    color: var(--accent-electric);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* Specialty Mode Switcher Pills */
.specialty-selector-container {
    position: relative;
    display: flex;
    gap: 0;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    margin-bottom: 1.25rem;
    max-width: 500px;
    overflow: hidden;
}

.specialty-slider-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease, border-color 0.4s ease;
    z-index: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

body.light-theme .specialty-slider-bg {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
    border-color: rgba(79, 70, 229, 0.2);
}

.specialty-selector-container:has(#spec-equine.active) .specialty-slider-bg {
    transform: translateX(100%);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

body.light-theme .specialty-selector-container:has(#spec-equine.active) .specialty-slider-bg {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(16, 185, 129, 0.08));
    border-color: rgba(5, 150, 105, 0.2);
}

.spec-btn {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    border-radius: 10px !important;
    transition: color 0.3s ease;
}

.spec-btn.active {
    color: var(--text-primary) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.spec-btn:not(.active):hover {
    color: var(--text-primary);
}

.spec-btn i {
    font-size: 1rem;
}

/* Spatial Accordion details-summary styles */
.spatial-accordion {
    background: rgba(255, 255, 255, 0.01) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 1.25rem !important;
    overflow: hidden !important;
    transition: var(--transition-smooth) !important;
}

.spatial-accordion[open] {
    background: rgba(13, 17, 25, 0.2) !important;
    box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(99, 102, 241, 0.15) !important;
}

body.light-theme .spatial-accordion[open] {
    background: rgba(255, 255, 255, 0.5) !important;
    border-color: rgba(79, 70, 229, 0.15) !important;
    box-shadow: 0 8px 32px -4px rgba(15, 23, 42, 0.05) !important;
}

.accordion-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1rem 1.25rem !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    user-select: none !important;
    list-style: none !important; /* Hide default arrow */
    transition: background 0.3s ease !important;
}

.accordion-header::-webkit-details-marker {
    display: none !important; /* Hide Safari arrow */
}

.accordion-header .section-title {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-family: var(--font-ui) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

.accordion-header .toggle-icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    color: var(--text-tertiary) !important;
    font-size: 0.95rem !important;
}

.spatial-accordion[open] .accordion-header .toggle-icon {
    transform: rotate(180deg) !important;
    color: var(--accent-electric) !important;
}

.accordion-validation-badge {
    margin-left: auto !important;
    margin-right: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.15rem !important;
    transition: var(--transition-smooth) !important;
}

.validation-icon-valid {
    color: #10b981 !important;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2)) !important;
}

.validation-icon-warning {
    color: #f59e0b !important;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.2)) !important;
}

.accordion-content {
    padding: 1.25rem !important;
    border-top: 1px solid var(--glass-border) !important;
    background: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .accordion-content {
    background: rgba(255, 255, 255, 0.15) !important;
}

.spec-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

/* Layout */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 2rem;
    padding: 2rem 2.5rem;
}

/* Left Column: Form Setup */
.form-section {
    flex: 1.4;
    max-width: 640px;
    min-width: 380px;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass), var(--shadow-inner);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.main-form-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.panel-header-inline {
    padding: 1.5rem 0 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1rem;
}

.panel-header-inline h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.panel-header-inline h2 i {
    color: var(--accent-electric);
}

.panel-header-inline p {
    font-size: 0.825rem;
    color: var(--text-secondary);
}

#report-form {
    padding: 0 2rem 2rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

#report-form::-webkit-scrollbar { width: 6px; }
#report-form::-webkit-scrollbar-track { background: transparent; }
#report-form::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.1); border-radius: 10px; }

.section-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.form-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-electric);
    font-weight: 600;
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border), transparent);
}

.form-section-title:first-child {
    margin-top: 0.5rem;
}

.form-group-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-group-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Floating Label Inputs */
.form-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1rem 0.5rem;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    appearance: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    padding-top: 1.25rem;
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--text-tertiary);
    transition: var(--transition-smooth);
    pointer-events: none;
}

.form-group textarea ~ label {
    top: 1.25rem;
    transform: none;
}

/* Floating label active states */
.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    background: rgba(0,0,0,0.4);
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 1px var(--accent-glow), 0 4px 12px rgba(0,0,0,0.2);
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group select:focus ~ label,
.form-group select:valid ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label,
.form-group label.active {
    top: 0.35rem;
    transform: translateY(0);
    font-size: 0.65rem;
    color: var(--accent-electric);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Dropdown styling */
.form-group select {
    padding-top: 1.2rem;
    padding-bottom: 0.3rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}
.form-group select option {
    background: var(--bg-base);
    color: white;
}

/* Equine Interactive Anatomy Board CSS */
.marking-board-outer {
    background: rgba(0, 0, 0, 0.4);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    user-select: none;
}

.marking-board-container {
    position: relative;
    max-width: 100%;
    cursor: crosshair;
    border-radius: var(--radius-md);
    background: white;
    padding: 0.5rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

#horse-marking-img {
    max-width: 100%;
    display: block;
    height: auto;
    opacity: 0.95;
    user-select: none;
    -webkit-user-drag: none;
}

.pins-overlay-container {
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    pointer-events: none;
}

/* Placed Pin Marker */
.pin-marker {
    position: absolute;
    width: 16px; height: 16px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-ui);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pin-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.6);
}

.pin-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    transform: translate(-50%, -140%);
    pointer-events: none;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Popover click text entry widget */
.pin-popover {
    position: absolute;
    z-index: 250;
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    transform: translate(-50%, -110%);
    box-shadow: var(--shadow-glass);
    width: 250px;
    align-items: center;
    pointer-events: auto;
}

.pin-popover input {
    flex: 1 !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.75rem !important;
    height: 32px !important;
    border-radius: 6px !important;
    border: 1px solid var(--glass-border) !important;
    background: rgba(0,0,0,0.3) !important;
    color: white !important;
}

.pin-popover input:focus {
    outline: none !important;
    border-color: var(--accent-electric) !important;
}

.pin-popover button {
    height: 32px; width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--accent-glow);
    color: white;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.pin-popover button:hover {
    background: var(--accent-electric);
}

/* Placed Pins Legend */
.pins-legend-panel {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.pins-legend-title {
    font-size: 0.85rem;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pins-legend-title i {
    color: var(--accent-electric);
}

.pins-list-empty {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 0.5rem;
}

.pins-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pins-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.825rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.pins-list li .pin-idx {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px; height: 18px;
    line-height: 18px;
    border-radius: 50%;
    text-align: center;
    display: inline-block;
    margin-right: 0.5rem;
}

.pins-list li .btn-remove-pin {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    padding: 0.2rem;
}

.pins-list li .btn-remove-pin:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* Flexion Test Rows */
.flexion-widget-row {
    padding: 1rem;
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.flexion-header {
    font-size: 0.8rem;
    color: var(--accent-electric);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

/* Joint Matrix Grid Inputs */
.joint-grid-builder {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    background: rgba(0,0,0,0.15);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.joint-builder-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 0.4rem;
}

.joint-builder-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.jb-lbl {
    font-size: 0.78rem;
    color: var(--text-secondary);
    width: 140px;
    text-align: right;
    font-weight: 600;
}

.joint-builder-row input {
    flex: 1;
    padding: 0.4rem 0.6rem !important;
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 4px !important;
    color: white !important;
    font-family: var(--font-ui) !important;
    font-size: 0.825rem !important;
    transition: var(--transition-smooth) !important;
}

.joint-builder-row input:focus {
    outline: none !important;
    border-color: var(--accent-electric) !important;
    background: rgba(0,0,0,0.5) !important;
}

.form-actions {
    position: relative;
    padding: 1.25rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    z-index: 10;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

.form-actions-split {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.btn-secondary-action {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
    flex: none !important;
    width: 100% !important;
    padding: 0.8rem 0.5rem !important;
}

.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--text-tertiary) !important;
}


.btn-glow {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 1.1rem 0.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.5), inset 0 1px 1px rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.5s ease;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.btn-glow:hover::before {
    left: 200%;
}

.btn-glow:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px -2px rgba(37, 99, 235, 0.5);
}

/* Right Column: Preview */
.preview-section {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 320px;
}

/* Preview Top Toolbar */
.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(13, 17, 25, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbar-title i {
    color: var(--accent-electric);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

.btn-zoom {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-zoom:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.btn-zoom:active {
    transform: scale(0.9);
}

#zoom-label {
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 44px;
    text-align: center;
    color: var(--text-primary);
}

.btn-zoom-fit {
    border-radius: 12px;
    width: auto;
    padding: 0 0.6rem;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.25rem;
}

/* Perfect Absolute Zoom Viewport */
.report-viewport {
    flex: 1;
    overflow: auto;
    padding: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.report-viewport::-webkit-scrollbar { width: 8px; height: 8px; }
.report-viewport::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.15); border-radius: 10px; }

.report-container {
    transform-origin: top center;
    position: relative;
}

/* Multi-page template switcher */
.report-document {
    display: none;
}

.report-document.template-active {
    display: flex;
}

/* ========================================== */
/* Template 1: Small Animal Sheet */
/* ========================================== */
.report-document {
    background-color: var(--report-bg);
    color: var(--report-text-dark);
    width: 820px !important;
    min-height: 1160px !important;
    box-shadow: var(--shadow-report);
    border-radius: 2px;
    position: absolute;
    top: 0; left: 0;
    transform-origin: top left;
    padding: 4rem 4rem 3rem;
    flex-direction: column;
}

.report-branding-strip {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 6px;
    background: linear-gradient(90deg, #1e293b, #3b82f6, #1e293b);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
}

.clinic-branding {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.clinic-logo-print {
    color: var(--report-accent);
}

.clinic-info-text .serif-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--report-accent);
    margin-bottom: 0.1rem;
    letter-spacing: -0.01em;
}

.clinic-info-text p {
    font-size: 0.85rem;
    color: var(--report-text-muted);
    font-weight: 500;
}

.clinic-info-text .contact-details {
    font-size: 0.75rem;
    margin-top: 0.4rem;
    color: #94a3b8;
}

.report-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.report-ids p {
    font-size: 0.8rem;
    color: var(--report-text-muted);
    margin-bottom: 0.2rem;
}

.report-ids span {
    color: var(--report-text-dark);
    font-weight: 600;
}

.report-title-banner {
    background: var(--report-accent-light);
    border-left: 4px solid var(--report-accent);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-title-banner h1 {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--report-text-dark);
    letter-spacing: 0.02em;
}

.region-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--report-accent);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
}

.report-section {
    margin-bottom: 2.5rem;
}

.patient-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--report-border);
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.data-row {
    display: flex;
    flex-direction: column;
}

.data-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--report-text-muted);
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.data-value {
    font-size: 0.95rem;
    color: var(--report-text-dark);
    font-weight: 500;
}

.report-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.block-heading {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--report-accent);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.block-heading i {
    font-size: 1rem;
    color: var(--report-text-muted);
}

.content-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--report-text-body);
    white-space: pre-wrap;
}

.conclusions-block {
    background: var(--report-accent-light);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--report-border);
}

.conclusions-block .block-heading {
    color: #0f172a;
}

.conclusions-block .content-text {
    font-weight: 500;
    color: #0f172a;
}

.report-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--report-border);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.signature-section {
    width: 280px;
}

.signature-image-placeholder {
    height: 50px;
    margin-bottom: -10px;
}

.signature-line {
    height: 1px;
    background: var(--report-text-dark);
    margin-bottom: 0.5rem;
}

.signature-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--report-text-dark);
    margin-bottom: 0.1rem;
}

.signature-section p {
    font-size: 0.75rem;
    color: var(--report-text-muted);
}

.disclaimer {
    max-width: 400px;
    text-align: right;
}

.disclaimer p {
    font-size: 0.65rem;
    color: #94a3b8;
    line-height: 1.5;
}

.page-number {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--report-text-muted) !important;
}

/* ========================================== */
/* Template 2: Equine Multi-Page Report */
/* ========================================== */
.equine-report-document, .small-animal-report-document {
    background-color: var(--report-bg);
    color: var(--report-text-dark);
    width: 820px !important;
    box-shadow: var(--shadow-report);
    border-radius: 2px;
    position: absolute;
    top: 0; left: 0;
    transform-origin: top left;
    display: none;
    flex-direction: column;
    padding: 0 !important; /* Managed page-by-page */
}

.equine-report-document.template-active, .small-animal-report-document.template-active {
    display: flex !important;
}

.pdf-page {
    width: 820px;
    min-height: 1160px;
    height: 1160px; /* Force consistent page breaks visually */
    background: white;
    padding: 4rem 4rem 3rem;
    position: relative;
    display: flex;
    flex-direction: column;
    border-bottom: 8px dashed var(--report-border);
}

.pdf-page:last-child {
    border-bottom: none;
}

.page-break-before {
    /* Virtual page boundaries on preview screen */
}

.eq-page-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--report-accent);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--report-border);
    padding-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.center-title {
    font-family: var(--font-serif) !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--report-accent) !important;
    letter-spacing: 0.04em !important;
}

.text-center-banner {
    justify-content: center !important;
    gap: 1.5rem;
    flex-direction: column;
    padding: 1.5rem !important;
}

.eq-details-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--report-border);
    padding-bottom: 1.25rem;
}

.eq-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.eq-col p {
    font-size: 0.78rem;
    color: var(--report-text-body);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.eq-col span {
    color: var(--report-text-dark);
    font-weight: 600;
}

.eq-anatomy-print-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.eq-heading-small {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--report-accent);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.eq-subheading-small {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--report-text-dark);
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}

.eq-marking-print-container {
    position: relative;
    max-width: 440px;
    margin: 0.5rem auto 1rem;
    background: white;
    border: 1px solid var(--report-border);
    border-radius: 4px;
    padding: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.eq-print-diagram {
    max-width: 100%;
    display: block;
    height: auto;
}

.print-pins-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--report-border);
    padding-top: 0.75rem;
}

.legend-item-p {
    font-size: 0.75rem;
    color: var(--report-text-body);
    display: flex;
    align-items: center;
}

.legend-badge-p {
    display: inline-block;
    width: 16px; height: 16px;
    line-height: 16px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    text-align: center;
    font-weight: 700;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* Page 2 Clinical Systems & Gaits tables */
.systems-table-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--report-border);
}

.st-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 0.2rem;
    color: var(--report-text-body);
}

.st-lbl {
    color: var(--report-text-muted);
    font-weight: 600;
}

.st-row span:last-child {
    font-weight: 600;
    color: var(--report-text-dark);
}

.clinical-table-print {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.78rem;
}

.clinical-table-print th {
    text-align: left;
    background: var(--report-accent-light);
    padding: 0.4rem 0.6rem;
    border-bottom: 2px solid var(--report-border);
    font-family: var(--font-ui);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--report-text-muted);
}

.clinical-table-print td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--report-border);
    color: var(--report-text-body);
}

.clinical-table-print tr:last-child td {
    border-bottom: 2px solid var(--report-border);
}

.palpation-notes-box {
    padding: 0.75rem 1rem;
    background: var(--report-accent-light);
    border: 1px solid var(--report-border);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.palpation-notes-box p {
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    color: var(--report-text-body);
}

.palpation-notes-box p:last-child {
    margin-bottom: 0;
}

.palpation-notes-box span {
    font-weight: 600;
    color: var(--report-text-dark);
}

/* Page 3 Radiology Matrix */
.radiology-matrix-print {
    margin-bottom: 1.5rem;
}

.joint-table-print td {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.74rem !important;
}

.joint-table-print td strong {
    font-weight: 700;
}

.tendon-scan-print {
    margin-bottom: 1.5rem;
    background: var(--report-accent-light);
    padding: 0.75rem 1rem;
    border: 1px solid var(--report-border);
    border-radius: 4px;
}

.tendon-text-print {
    font-size: 0.8rem;
    color: var(--report-text-dark);
    font-weight: 500;
    white-space: pre-wrap;
}

.eq-synthesis-print-box {
    background: var(--report-accent-light);
    border: 1px solid var(--report-accent);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.synthesis-row-p {
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
}

.synthesis-row-p:last-child {
    margin-bottom: 0;
}

.synthesis-row-p strong {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--report-text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.synthesis-text {
    font-size: 0.825rem;
    line-height: 1.4;
    color: var(--report-text-dark);
    font-weight: 500;
    white-space: pre-wrap;
}

.risk-flex-p {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.risk-flex-p strong {
    display: inline;
    margin-bottom: 0;
}

.eq-risk-badge-p {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.green-badge {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #10b981;
}

.yellow-badge {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #f59e0b;
}

.red-badge {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #ef4444;
}

.equine-footer-print {
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
}

.equine-footer-print .disclaimer {
    max-width: 320px !important;
}

/* Page numbers and absolute print footer layouts */
.print-page-footer {
    position: absolute;
    bottom: 2rem;
    left: 4rem;
    right: 4rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--report-border);
    padding-top: 0.75rem;
    font-size: 0.7rem;
    color: var(--report-text-muted);
    font-weight: 600;
}

/* Premium Settings Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(4, 6, 9, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-large {
    max-width: 720px;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.02);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: var(--accent-electric);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.1); border-radius: 10px; }

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.02);
}

/* Database Modal Search & Records */
.search-modal-body {
    gap: 1.5rem;
}

.search-bar-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-secondary);
    pointer-events: none;
}

#search-db {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.1rem 1.1rem 3.25rem;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

#search-db:focus {
    outline: none;
    border-color: var(--accent-glow);
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.records-container {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.records-container::-webkit-scrollbar { width: 6px; }
.records-container::-webkit-scrollbar-track { background: transparent; }
.records-container::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.1); border-radius: 10px; }

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

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.record-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    padding-right: 1rem;
}

.record-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.record-sub {
    font-size: 0.825rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.record-meta-line {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.record-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-record-action {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-record-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.btn-load:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    color: var(--accent-electric) !important;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #ef4444 !important;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Form Actions Bar (below data entry) */
.form-actions-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-top: 12px;
    flex-shrink: 0;
    z-index: 10;
}

body.light-theme .form-actions-bar {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

body.oled-theme .form-actions-bar {
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.action-btn i {
    font-size: 1.1rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
    transform: scale(0.96);
}

body.light-theme .action-btn {
    background: rgba(15, 23, 42, 0.03) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: var(--text-primary) !important;
}

body.light-theme .action-btn:hover {
    background: rgba(79, 70, 229, 0.06) !important;
    background: rgba(15, 23, 42, 0.06) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

body.oled-theme .action-btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.oled-theme .action-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.action-btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    border-color: transparent !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}

.action-btn-primary:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1) !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255,255,255,0.3) !important;
    transform: translateY(-3px) !important;
}

@media print {
    .form-actions-bar {
        display: none !important;
    }
}

/* ==========================================================================
   Media Queries: Premium Responsiveness & Mobile Adaptations
   ========================================================================== */

@media (max-width: 900px) {
    body {
        overflow: hidden;
    }

    .app-header {
        flex-direction: row-reverse;
        padding: 0.6rem 1rem;
    }
    
    .header-meta {
        gap: 0.4rem;
    }
    
    #header-user-info {
        margin-left: 6px;
        padding-left: 8px;
        border-left: 1px solid rgba(255,255,255,0.08);
    }

    .status-text {
        display: none;
    }

    /* ===== MOBILE TAB BAR — Native App Feel ===== */
    .mobile-tabs {
        display: flex;
        padding: 6px 12px;
        gap: 6px;
        background: rgba(13, 17, 25, 0.6);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--glass-border);
    }

    body.light-theme .mobile-tabs {
        background: rgba(255, 255, 255, 0.8) !important;
        border-bottom-color: rgba(15, 23, 42, 0.06) !important;
    }

    body.oled-theme .mobile-tabs {
        background: rgba(0, 0, 0, 0.8) !important;
        border-bottom-color: rgba(255, 255, 255, 0.04) !important;
    }

    .tab-btn {
        flex: 1;
        max-width: none;
        padding: 8px 0;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-radius: 10px;
        gap: 5px;
    }

    .tab-btn i {
        font-size: 1rem;
    }

    .tab-btn.active {
        background: rgba(99, 102, 241, 0.15);
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
    }

    /* ===== MAIN CONTENT — Full Viewport Fill ===== */
    .main-content {
        flex-direction: column;
        padding: 0;
        gap: 0;
        height: calc(100vh - 100px);
    }

    .form-section, .preview-section {
        flex: 1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 100%;
        border-radius: 0 !important;
    }

    body:not(.show-preview-tab) .preview-section {
        display: none !important;
    }

    body.show-preview-tab .form-section {
        display: none !important;
    }

    /* ===== GLASS PANEL — Edge-to-Edge ===== */
    .glass-panel {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .main-form-card {
        border-radius: 0 !important;
    }

    .panel-header-inline {
        padding: 0.75rem 0 0.6rem;
        margin-bottom: 0.5rem;
    }

    .panel-header-inline h2 {
        font-size: 1rem;
    }

    .panel-header-inline p {
        font-size: 0.75rem;
    }
    
    /* ===== FORM — Compact & Breathable ===== */
    #report-form {
        padding: 0 0.75rem 1rem;
    }

    /* ===== SPECIALTY SELECTOR — Compact Pills ===== */
    .specialty-selector-container {
        margin: 0 0.75rem 0.75rem;
        max-width: 100%;
        border-radius: 10px;
        padding: 3px;
    }

    .spec-btn {
        font-size: 0.72rem;
        padding: 6px 8px;
        border-radius: 8px;
        gap: 4px;
    }

    .spec-btn i {
        font-size: 0.9rem;
    }

    /* ===== ACCORDIONS — Tight & Organized ===== */
    .spatial-accordion {
        margin-bottom: 0.6rem !important;
        border-radius: var(--radius-sm) !important;
    }

    .accordion-header {
        padding: 0.7rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    .accordion-header .section-title {
        font-size: 0.68rem !important;
        gap: 0.35rem !important;
        letter-spacing: 0.05em !important;
    }

    .accordion-header .section-title i {
        font-size: 0.85rem !important;
    }

    .accordion-validation-badge {
        font-size: 0.95rem !important;
        margin-right: 6px !important;
    }

    .accordion-content {
        padding: 0.75rem !important;
    }

    /* ===== FORM FIELDS — Touch-Optimized ===== */
    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-group input, 
    .form-group select, 
    .form-group textarea {
        font-size: 0.82rem;
        padding: 0.75rem 0.65rem 0.3rem;
        border-radius: var(--radius-sm);
        min-height: 42px;
    }
    
    .form-group label {
        left: 0.65rem;
        font-size: 0.82rem;
    }
    
    .form-group input:focus ~ label,
    .form-group input:not(:placeholder-shown) ~ label,
    .form-group select:focus ~ label,
    .form-group select:valid ~ label,
    .form-group textarea:focus ~ label,
    .form-group textarea:not(:placeholder-shown) ~ label,
    .form-group label.active {
        top: 0.15rem;
        font-size: 0.58rem;
    }
    
    .form-group textarea {
        padding-top: 0.85rem;
    }

    .form-group-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }

    .form-group-row .form-group {
        margin-bottom: 0.75rem;
    }

    /* ===== MICRO-STEPPERS — Compact Touch ===== */
    .micro-stepper-group {
        border-radius: 10px !important;
        padding: 2px !important;
    }

    .stepper-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }

    .micro-stepper-group input {
        font-size: 0.85rem !important;
        min-height: 36px !important;
    }

    .stepper-label {
        font-size: 0.55rem !important;
    }

    /* ===== FORM ACTIONS BAR — Compact Bottom Dock ===== */
    .form-actions-bar {
        padding: 8px 12px;
        gap: 6px;
        border-radius: 0 !important;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.7rem;
        border-radius: 10px;
        gap: 4px;
    }

    .action-btn i {
        font-size: 1rem;
    }

    /* ===== PREVIEW ===== */
    .preview-toolbar {
        padding: 0.5rem 0.75rem;
    }
    
    .btn-zoom-fit span {
        display: none;
    }

    .report-viewport {
        padding: 0.5rem;
    }

    /* ===== IMAGE UPLOAD ZONES ===== */
    .image-upload-zone {
        padding: 1rem !important;
        border-radius: var(--radius-sm) !important;
    }

    .image-upload-zone i {
        font-size: 1.5rem !important;
    }

    .image-upload-zone p {
        font-size: 0.72rem !important;
    }

    /* ===== QUICK-FILL CHIPS ===== */
    .quick-fill-section {
        margin-top: 0.5rem;
    }

    .quick-fill-chips {
        gap: 4px;
    }

    .chip {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
    }

    /* ===== DATABASE MODAL ===== */
    .database-filters-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 6px !important;
    }
    
    .database-filters-row .form-group {
        width: 100%;
        margin-bottom: 0 !important;
    }
    
    .database-filters-row button {
        width: 100%;
    }

    .record-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .record-info {
        padding-right: 0;
    }
    
    .record-actions {
        justify-content: flex-end;
        border-top: 1px solid var(--glass-border);
        padding-top: 0.5rem;
    }

    /* ===== TOAST NOTIFICATIONS ===== */
    .toast-container {
        bottom: 12px !important;
        right: 12px !important;
        left: 12px !important;
        max-width: none !important;
    }

    .toast {
        font-size: 0.78rem !important;
    }
}

/* ===== ULTRA-COMPACT: iPhone / Small Phones ===== */
@media (max-width: 480px) {
    .app-header {
        padding: 0.4rem 0.6rem;
        min-height: 44px;
    }

    .logo {
        gap: 0.3rem;
    }

    .logo-icon {
        width: 22px;
        height: 22px;
        border-radius: 5px;
        box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    }
    
    .logo-icon img {
        border-radius: 5px;
    }

    .logo h1 {
        font-size: 0.85rem;
        letter-spacing: -0.01em;
    }

    /* Ultra-compact Control Dock */
    .header-controls-dock {
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        padding: 2px 3px !important;
        border-radius: 10px !important;
        gap: 1px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    body.light-theme .header-controls-dock {
        background: rgba(15, 23, 42, 0.03) !important;
        border-color: rgba(15, 23, 42, 0.06) !important;
    }

    .header-controls-dock .btn-icon {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        width: 26px !important;
        height: 26px !important;
        border-radius: 7px !important;
        font-size: 0.8rem !important;
        padding: 0 !important;
    }

    .header-controls-dock .btn-icon:active {
        background: rgba(255, 255, 255, 0.06) !important;
    }

    .dock-divider {
        height: 12px !important;
        margin: 0 1px !important;
    }

    .user-profile-menu {
        gap: 1px !important;
        margin-left: 1px !important;
        padding-left: 3px !important;
        border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    .user-avatar {
        width: 20px !important;
        height: 20px !important;
        font-size: 8px !important;
        border-width: 1.5px !important;
    }

    .btn-logout {
        width: 22px !important;
        height: 22px !important;
    }

    .user-name,
    #autosave-indicator,
    .status-group {
        display: none !important;
    }

    .main-content {
        height: calc(100vh - 88px);
    }

    /* Even tighter mobile tabs */
    .mobile-tabs {
        padding: 4px 8px;
    }

    .tab-btn {
        padding: 6px 0;
        font-size: 0.72rem;
        border-radius: 8px;
    }

    /* Tighter accordion */
    .accordion-header {
        padding: 0.55rem 0.6rem !important;
    }

    .accordion-content {
        padding: 0.6rem !important;
    }

    /* Compact action bar on phones — icon-only */
    .form-actions-bar {
        padding: 6px 8px;
        gap: 4px;
    }

    .action-btn span {
        display: none;
    }

    .action-btn {
        flex: 0;
        padding: 8px;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .action-btn i {
        font-size: 1.05rem;
    }

    /* Specialty pills even more compact */
    .specialty-selector-container {
        margin: 0 0.5rem 0.5rem;
    }

    .spec-btn {
        font-size: 0.65rem;
        padding: 5px 6px;
    }

    .spec-btn i {
        font-size: 0.8rem;
    }

    /* Stack form-actions-split */
    .form-actions-split {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Print Specific Override */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body { 
        background: white !important; 
        color: black !important;
        overflow: visible !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Container hoisted to body by JS */
    .report-container { 
        transform: none !important; 
        width: 100% !important; 
        height: auto !important; 
        display: block !important; 
        position: static !important; 
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .report-document {
        display: none !important;
    }

    /* Small Animal & Base Document Print Styles */
    .report-document.template-active {
        display: flex !important;
        flex-direction: column !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important; 
        width: 820px !important; 
        min-height: 1160px !important; 
        position: relative !important; 
        transform: none !important;
        padding: 4rem 4rem 3rem !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* Fix double padding in Equine container! */
    .equine-report-document.template-active, .small-animal-report-document.template-active {
        padding: 0 !important;
        background: transparent !important;
        min-height: auto !important;
        display: block !important;
    }

    /* Push Small Animal footer to exact bottom margin */
    .report-document.template-active .report-footer {
        margin-top: auto !important;
    }

    /* Equine Sheet Print Page Break logic */
    .pdf-page {
        border-bottom: none !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        width: 820px !important;
        height: 1160px !important;
        min-height: 1160px !important;
        padding: 4rem 4rem 3rem !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        position: relative !important;
        background: white !important;
    }

    .pdf-page:last-child {
        page-break-after: avoid !important;
    }

    /* Pin Equine Footers to exact bottom margin of each 1160px page */
    .print-page-footer {
        position: absolute !important;
        bottom: 2rem !important;
        left: 4rem !important;
        right: 4rem !important;
        margin: 0 !important;
    }
}

/* ==========================================================================
   Image Upload & Print Plates CSS
   ========================================================================== */

/* Upload Zone */
.image-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}
.image-upload-zone:hover {
    border-color: var(--accent);
    background: rgba(14, 165, 233, 0.05);
}
.image-upload-zone input[type=""file""] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-content {
    pointer-events: none;
}
.upload-content i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.upload-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Upload Preview in Form */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.uploaded-preview-img {
    max-width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Print Image Plates (PDF View) */
.image-plates-block {
    margin-top: 2rem;
    page-break-inside: avoid;
}
.print-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}
.print-plate-img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.25rem;
    background: white;
}


/* ===================================================================
   Quick-Fill Chips (Clinical Template Buttons)
   =================================================================== */
.quick-fill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
    align-items: center;
}

.chip-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
    margin-right: 0.2rem;
    white-space: nowrap;
}

.chip {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chip:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.chip:active {
    transform: translateY(0) scale(0.97);
}

/* Pin Selector and Settings profile button base rules */
#pin-label-selector {
    display: none;
    position: absolute;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 12px;
    z-index: 1000000;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
    width: 220px;
    text-align: center;
    pointer-events: all;
    font-family: var(--font-ui);
}
.pin-selector-title {
    margin: 0 0 10px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    font-weight: 600;
}
.pin-labels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.pin-labels-grid button {
    padding: 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.pin-labels-grid button:hover {
    transform: translateY(-1px);
}
#pin-label-selector button[data-label="Pain"] {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}
#pin-label-selector button[data-label="Swelling"] {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #fb923c;
}
#pin-label-selector button[data-label="Scar"] {
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: #d1d5db;
}
#pin-label-selector button[data-label="Wound"] {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #facc15;
}
#pin-label-selector button[data-label="Splint"] {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}
#pin-label-selector button[data-label="Joint Effusion"] {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}
#btn-cancel-pin {
    background: #374151;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    width: 100%;
    margin-top: 8px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
}
#btn-cancel-pin:hover {
    background: #4b5563;
}
#doctor-profile-fields-container button {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    font-size: 11px;
    transition: var(--transition-smooth);
}
#btn-save-doc-profile {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #818cf8;
}
#btn-save-doc-profile:hover {
    background: rgba(99, 102, 241, 0.3);
}
#btn-delete-doc-profile {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
#btn-delete-doc-profile:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   LIGHT MODE STYLING & VARIABLES (PRO GRADE OVERRIDE)
   ========================================================================== */
body.light-theme {
    /* Main Base Colors - Sophisticated Light Slate Backdrop */
    --bg-base: #f1f5f9;
    --bg-mesh-1: #cbd5e1;
    --bg-mesh-2: #e2e8f0;
    --bg-mesh-3: #cbd5e1;
    
    /* Premium White Glassmorphism Card Properties */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(15, 23, 42, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.6);
    
    /* Interactive Highlight & Electric Accents */
    --accent-glow: rgba(99, 102, 241, 0.06);
    --accent-electric: #4f46e5;
    
    /* Typography Inks - High Contrast Charcoal Colors */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #475569;
    
    /* Standard Shadow Overrides */
    --shadow-glass: 0 20px 40px -10px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.03);
    --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --shadow-report: 0 30px 60px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
}

/* Specific Light Theme Selectors for perfect contrast */
body.light-theme .app-header {
    background: rgba(255, 255, 255, 0.8) !important;
    border-bottom-color: rgba(15, 23, 42, 0.06) !important;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.02) !important;
}

body.light-theme .spec-btn {
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    color: var(--text-tertiary) !important;
}

body.light-theme .spec-btn.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25), inset 0 1px 1px rgba(255,255,255,0.2) !important;
}

body.light-theme .tab-btn {
    color: var(--text-secondary) !important;
}

body.light-theme .tab-btn.active {
    background: rgba(79, 70, 229, 0.1) !important;
    color: #4f46e5 !important;
}

/* Light Theme Form Control Styling */
body.light-theme .form-group input, 
body.light-theme .form-group select, 
body.light-theme .form-group textarea {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme .form-group input:focus, 
body.light-theme .form-group select:focus, 
body.light-theme .form-group textarea:focus {
    background: #ffffff !important;
    border-color: var(--accent-electric) !important;
    box-shadow: 0 0 0 1px var(--accent-electric), 0 4px 12px rgba(79, 70, 229, 0.06) !important;
}

body.light-theme .form-group label {
    color: var(--text-tertiary) !important;
}

body.light-theme .form-group label.active {
    color: var(--accent-electric) !important;
    background: transparent !important;
    padding: 0 !important;
}

body.light-theme .form-group select option {
    background: #ffffff !important;
    color: var(--text-primary) !important;
}

/* Buttons and database styling */
body.light-theme .btn-secondary-action {
    background: rgba(15, 23, 42, 0.03) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    color: var(--text-secondary) !important;
}

body.light-theme .btn-secondary-action:hover {
    background: rgba(15, 23, 42, 0.08) !important;
    color: var(--text-primary) !important;
    border-color: rgba(15, 23, 42, 0.2) !important;
}

body.light-theme .record-item {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .record-item:hover {
    border-color: var(--accent-electric) !important;
    background: rgba(79, 70, 229, 0.03) !important;
}

body.light-theme .record-title {
    color: var(--text-primary) !important;
}

body.light-theme .quick-fill-chips span {
    background: rgba(79, 70, 229, 0.06) !important;
    color: #4f46e5 !important;
    border: 1px solid rgba(79, 70, 229, 0.15) !important;
}

body.light-theme .quick-fill-chips span:hover {
    background: #4f46e5 !important;
    color: #ffffff !important;
}

body.light-theme #search-db {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme #db-filter-species,
body.light-theme #db-filter-date,
body.light-theme #settings-doctor-select {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme #db-filter-species option,
body.light-theme #db-filter-date option,
body.light-theme #settings-doctor-select option {
    background: #ffffff !important;
    color: var(--text-primary) !important;
}

body.light-theme #doctor-profile-fields-container {
    border-color: rgba(15, 23, 42, 0.08) !important;
    background: rgba(15, 23, 42, 0.01) !important;
}

body.light-theme #btn-save-doc-profile {
    background: rgba(79, 70, 229, 0.08) !important;
    border: 1px solid rgba(79, 70, 229, 0.2) !important;
    color: #4f46e5 !important;
}
body.light-theme #btn-save-doc-profile:hover {
    background: rgba(79, 70, 229, 0.15) !important;
}

body.light-theme #btn-delete-doc-profile {
    background: rgba(239, 68, 68, 0.06) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}
body.light-theme #btn-delete-doc-profile:hover {
    background: rgba(239, 68, 68, 0.12) !important;
}

body.light-theme .modal-header,
body.light-theme .modal-footer {
    background: rgba(15, 23, 42, 0.02) !important;
}

/* Equine specialty elements in Light Theme */
body.light-theme .joint-grid-builder {
    background: rgba(15, 23, 42, 0.02) !important;
    border-color: rgba(15, 23, 42, 0.06) !important;
}

body.light-theme .joint-builder-row input {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme .joint-builder-row input:focus {
    background: #ffffff !important;
    border-color: var(--accent-electric) !important;
}

body.light-theme .nerve-blocks-builder {
    border-color: rgba(15, 23, 42, 0.08) !important;
    background: rgba(15, 23, 42, 0.01) !important;
}

body.light-theme #btn-add-block {
    background: rgba(79, 70, 229, 0.06) !important;
    color: #4f46e5 !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
}
body.light-theme #btn-add-block:hover {
    background: rgba(79, 70, 229, 0.12) !important;
    color: #4338ca !important;
}

body.light-theme .pin-popover {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .pin-popover input {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme .pin-popover input:focus {
    border-color: var(--accent-electric) !important;
}

body.light-theme .pin-popover button {
    background: var(--accent-electric) !important;
    color: #ffffff !important;
}
body.light-theme .pin-popover button:hover {
    background: #4338ca !important;
}

body.light-theme #pin-label-selector {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12) !important;
}

body.light-theme #pin-label-selector p {
    color: var(--text-tertiary) !important;
}

body.light-theme #pin-label-selector button {
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.light-theme #btn-cancel-pin {
    background: #cbd5e1 !important;
    color: #334155 !important;
}
body.light-theme #btn-cancel-pin:hover {
    background: #94a3b8 !important;
}

body.light-theme #pin-label-selector button[data-label="Pain"] {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}
body.light-theme #pin-label-selector button[data-label="Pain"]:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

body.light-theme #pin-label-selector button[data-label="Swelling"] {
    background: rgba(249, 115, 22, 0.08) !important;
    color: #ea580c !important;
    border-color: rgba(249, 115, 22, 0.2) !important;
}
body.light-theme #pin-label-selector button[data-label="Swelling"]:hover {
    background: rgba(249, 115, 22, 0.15) !important;
}

body.light-theme #pin-label-selector button[data-label="Scar"] {
    background: rgba(107, 114, 128, 0.08) !important;
    color: #4b5563 !important;
    border-color: rgba(107, 114, 128, 0.2) !important;
}
body.light-theme #pin-label-selector button[data-label="Scar"]:hover {
    background: rgba(107, 114, 128, 0.15) !important;
}

body.light-theme #pin-label-selector button[data-label="Wound"] {
    background: rgba(234, 179, 8, 0.08) !important;
    color: #a16207 !important;
    border-color: rgba(234, 179, 8, 0.2) !important;
}
body.light-theme #pin-label-selector button[data-label="Wound"]:hover {
    background: rgba(234, 179, 8, 0.15) !important;
}

body.light-theme #pin-label-selector button[data-label="Splint"] {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #2563eb !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}
body.light-theme #pin-label-selector button[data-label="Splint"]:hover {
    background: rgba(59, 130, 246, 0.15) !important;
}

body.light-theme #pin-label-selector button[data-label="Joint Effusion"] {
    background: rgba(139, 92, 246, 0.08) !important;
    color: #7c3aed !important;
    border-color: rgba(139, 92, 246, 0.2) !important;
}
body.light-theme #pin-label-selector button[data-label="Joint Effusion"]:hover {
    background: rgba(139, 92, 246, 0.15) !important;
}

body.light-theme .image-upload-zone {
    border-color: rgba(15, 23, 42, 0.15) !important;
    background: #ffffff !important;
}
body.light-theme .image-upload-zone:hover {
    border-color: var(--accent-electric) !important;
    background: rgba(79, 70, 229, 0.03) !important;
}
body.light-theme .image-upload-zone p {
    color: var(--text-secondary) !important;
}
body.light-theme .image-upload-zone p span {
    color: var(--accent-electric) !important;
}

body.light-theme .btn-icon {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: var(--text-primary) !important;
}
body.light-theme .btn-icon:hover {
    background: #ffffff !important;
    border-color: var(--accent-electric) !important;
}

body.light-theme .form-progress-container {
    background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .pins-legend-title {
    color: var(--text-primary) !important;
}

body.light-theme .pins-list li {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
}

/* Custom visual flexion slider CSS styling */
.flexion-slider {
    -webkit-appearance: none;
    height: 6px;
    border-radius: 4px;
    background: linear-gradient(90deg, #10b981 0%, #fb923c 60%, #ef4444 100%) !important;
    outline: none;
    padding: 0 !important;
}

.flexion-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #6366f1;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.flexion-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.flexion-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #6366f1;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.flexion-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Drag and drop image uploader effects */
.image-upload-zone.dragover {
    border-color: #818cf8 !important;
    background-color: rgba(99, 102, 241, 0.08) !important;
}

.uploaded-preview-img-container {
    position: relative;
    display: inline-block;
}

.uploaded-preview-img-delete {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    font-weight: bold;
    border: 1px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Nerve Block Item fields style */
.nerve-block-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    width: 100%;
}
.nerve-block-item select,
.nerve-block-item input {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    padding: 6px !important;
    border-radius: 6px !important;
    font-family: var(--font-ui) !important;
    font-size: 13px !important;
    outline: none !important;
    transition: var(--transition-smooth) !important;
    height: 32px !important;
}

.nerve-block-item select:focus,
.nerve-block-item input:focus {
    border-color: var(--accent-electric) !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

body.light-theme .nerve-block-item select,
body.light-theme .nerve-block-item input {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme .nerve-block-item select:focus,
body.light-theme .nerve-block-item input:focus {
    border-color: var(--accent-electric) !important;
    background: #ffffff !important;
}

/* Delete block button style */
.btn-delete-block {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
    border-radius: 6px !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: var(--transition-smooth) !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}
.btn-delete-block:hover {
    background: rgba(239, 68, 68, 0.25) !important;
}
body.light-theme .btn-delete-block {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: #dc2626 !important;
}
body.light-theme .btn-delete-block:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

/* Toast Notifications styling */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    z-index: 999999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-left: 4px solid var(--accent-electric);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
body.light-theme .toast-notification {
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

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

/* ============================================ */
/* TACTILE MICRO-STEPPERS                       */
/* ============================================ */
.stepper-row {
    gap: 10px !important;
}

.micro-stepper-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stepper-label {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-tertiary) !important;
    padding-left: 2px;
    pointer-events: none;
}

.micro-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.micro-stepper:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.micro-stepper:focus-within {
    border-color: var(--accent-electric);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15), 0 4px 16px rgba(99, 102, 241, 0.1);
}

.stepper-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.stepper-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-electric);
}

.stepper-btn:active {
    transform: scale(0.88);
    background: rgba(99, 102, 241, 0.2);
}

.stepper-dec {
    border-right: 1px solid var(--glass-border);
}

.stepper-inc {
    border-left: 1px solid var(--glass-border);
}

.stepper-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    text-align: center;
    border: none !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    font-family: var(--font-ui) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    padding: 6px 4px !important;
    -moz-appearance: textfield;
    box-shadow: none !important;
    outline: none !important;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper-input-wide {
    min-width: 50px;
}

/* Light theme stepper */
body.light-theme .micro-stepper {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
}

body.light-theme .micro-stepper:hover {
    border-color: rgba(79, 70, 229, 0.25) !important;
}

body.light-theme .micro-stepper:focus-within {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12), 0 4px 16px rgba(79, 70, 229, 0.06) !important;
}

body.light-theme .stepper-btn {
    background: rgba(15, 23, 42, 0.02) !important;
    color: var(--text-secondary) !important;
}

body.light-theme .stepper-btn:hover {
    background: rgba(79, 70, 229, 0.08) !important;
    color: #4f46e5 !important;
}

body.light-theme .stepper-dec {
    border-right-color: rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .stepper-inc {
    border-left-color: rgba(15, 23, 42, 0.08) !important;
}

/* ============================================ */
/* OLED BLACK DARK MODE THEME                   */
/* ============================================ */
body.oled-theme {
    --bg-base: #000000;
    --bg-mesh-1: #0a0015;
    --bg-mesh-2: #00050f;
    --bg-mesh-3: #050008;

    --glass-bg: rgba(8, 8, 12, 0.75);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-highlight: rgba(255, 255, 255, 0.02);

    --accent-glow: #818cf8;
    --accent-electric: #a78bfa;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    --shadow-glass: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-inner: inset 0 1px 1px rgba(255, 255, 255, 0.04);
    --shadow-report: 0 30px 60px -15px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255,255,255,0.03);
}

body.oled-theme .app-header {
    background: rgba(0, 0, 0, 0.7) !important;
    border-bottom-color: rgba(255, 255, 255, 0.04) !important;
}

body.oled-theme .mesh-bg {
    background: #000000 !important;
}

body.oled-theme .blob {
    opacity: 0.25 !important;
}

body.oled-theme .glass-panel {
    background: rgba(8, 8, 12, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

body.oled-theme .spatial-accordion {
    background: rgba(8, 8, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

body.oled-theme .spatial-accordion[open] {
    background: rgba(8, 8, 12, 0.7) !important;
    border-color: rgba(167, 139, 250, 0.12) !important;
}

body.oled-theme .accordion-content {
    background: rgba(0, 0, 0, 0.3) !important;
}

body.oled-theme .form-group input,
body.oled-theme .form-group select,
body.oled-theme .form-group textarea {
    background: rgba(8, 8, 12, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

body.oled-theme .form-group input:focus,
body.oled-theme .form-group select:focus,
body.oled-theme .form-group textarea:focus {
    border-color: var(--accent-electric) !important;
    box-shadow: 0 0 0 1px var(--accent-electric), 0 4px 20px rgba(167, 139, 250, 0.12) !important;
}

body.oled-theme .micro-stepper {
    background: rgba(8, 8, 12, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.oled-theme .micro-stepper:focus-within {
    border-color: var(--accent-electric) !important;
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.12), 0 4px 16px rgba(167, 139, 250, 0.08) !important;
}

body.oled-theme .stepper-btn {
    background: rgba(255, 255, 255, 0.02) !important;
}

body.oled-theme .stepper-btn:hover {
    background: rgba(167, 139, 250, 0.12) !important;
    color: #a78bfa !important;
}

body.oled-theme .header-controls-dock {
    background: rgba(8, 8, 12, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}



body.oled-theme .preview-toolbar {
    background: rgba(0, 0, 0, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

body.oled-theme .specialty-selector-container {
    background: rgba(8, 8, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

body.oled-theme .specialty-slider-bg {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.12), rgba(167, 139, 250, 0.12)) !important;
    border-color: rgba(129, 140, 248, 0.2) !important;
}

body.oled-theme .mobile-tabs {
    background: rgba(0, 0, 0, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

body.oled-theme .tab-btn.active {
    background: rgba(167, 139, 250, 0.1) !important;
    color: #a78bfa !important;
}

body.oled-theme .modal-overlay {
    background: rgba(0, 0, 0, 0.92) !important;
}

body.oled-theme .modal-container {
    background: rgba(8, 8, 12, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.oled-theme .toast-notification {
    background: rgba(12, 12, 18, 0.97) !important;
    border-left-color: #a78bfa !important;
}

body.oled-theme .image-upload-zone {
    border-color: rgba(255, 255, 255, 0.06) !important;
    background: rgba(8, 8, 12, 0.4) !important;
}

body.oled-theme .quick-fill-chips .chip {
    background: rgba(167, 139, 250, 0.08) !important;
    border-color: rgba(167, 139, 250, 0.15) !important;
    color: #a78bfa !important;
}

/* ============================================ */
/* SOFT PAPER LIGHT MODE REFINEMENTS            */
/* ============================================ */

/* Warm paper-white refinements for the light theme */
body.light-theme {
    --bg-base: #fcfbfa !important;
    --bg-mesh-1: #e8e3dc !important;
    --bg-mesh-2: #f0ece7 !important;
    --bg-mesh-3: #e0dbd4 !important;
}

body.light-theme .mesh-bg {
    background: #fcfbfa !important;
}

body.light-theme .blob {
    opacity: 0.35 !important;
}

/* ============================================ */
/* FOCUS-ANIMATED GRADIENT INPUT BORDERS        */
/* ============================================ */
@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    animation: none; /* base - no anim by default, let border handle it */
}

/* Animated gradient border via pseudo-element on focus */
.form-group {
    position: relative;
}

.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #ec4899, #6366f1);
    background-size: 300% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    pointer-events: none;
}

.form-group:focus-within::after {
    opacity: 1;
    animation: gradient-flow 3s ease infinite;
}

/* Adjust for steppers (no bottom gradient since they have their own styling) */
.micro-stepper-group::after {
    display: none !important;
}


