/* ==========================================================================
   AquaCare CSS - Premium Design System (AquaCare Pro / Field Technician Edition)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --bg-primary: hsl(222, 47%, 11%);
    --bg-secondary: hsl(223, 47%, 7%);
    --accent-teal: hsl(174, 90%, 41%);
    --accent-teal-glow: hsla(174, 90%, 41%, 0.35);
    --accent-cyan: hsl(190, 100%, 45%);
    --accent-cyan-glow: hsla(190, 100%, 45%, 0.35);
    --accent-blue: hsl(205, 100%, 50%);
    --accent-blue-glow: hsla(205, 100%, 50%, 0.35);
    --accent-yellow: hsl(45, 100%, 50%);
    
    /* Status Colors */
    --status-success: hsl(148, 80%, 42%);
    --status-success-bg: hsla(148, 80%, 42%, 0.15);
    --status-warning: hsl(38, 90%, 52%);
    --status-warning-bg: hsla(38, 90%, 52%, 0.15);
    --status-danger: hsl(355, 80%, 55%);
    --status-danger-bg: hsla(355, 80%, 55%, 0.15);

    /* Text Colors */
    --text-main: hsl(210, 40%, 98%);
    --text-muted: hsl(215, 20%, 75%);
    --text-dark: hsl(217, 10%, 45%);

    /* Glassmorphism Styles */
    --glass-bg: rgba(15, 23, 42, 0.45);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-focus: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-radius: 20px;
    
    /* Layout */
    --sidebar-width: 280px;
    --transition-speed: 0.25s;
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

/* ==========================================================================
   [NUEVO] MODO SOL / ALTO CONTRASTE (SUN MODE) OVERRIDES
   ========================================================================== */
body.sun-mode {
    --bg-secondary: hsl(0, 0%, 4%); /* Pure dark background for extreme contrast */
    --bg-primary: hsl(222, 25%, 12%);
    --glass-bg: hsl(222, 20%, 14%);
    --glass-border: rgba(255, 255, 255, 0.25); /* Much thicker and brighter borders */
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    
    --text-main: #ffffff;
    --text-muted: hsl(210, 20%, 90%); /* Ultra bright muted text */
    --text-dark: hsl(210, 10%, 75%);
    
    /* Brighter Status Colors */
    --status-success: hsl(148, 100%, 44%);
    --status-warning: hsl(40, 100%, 50%);
    --status-danger: hsl(355, 100%, 60%);
}

body.sun-mode * {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
}

body.sun-mode .glass-card {
    backdrop-filter: none !important; /* Disable blur to avoid sun washing it out */
    border-width: 2px !important;
}

body.sun-mode .nav-link.active {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

body.sun-mode .custom-range-slider {
    height: 10px !important;
}

body.sun-mode .custom-range-slider::-webkit-slider-thumb {
    width: 26px !important;
    height: 26px !important;
    background-color: #ffffff !important;
    border: 3px solid var(--accent-cyan) !important;
}

body.sun-mode .form-input, body.sun-mode .form-select {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: #000000 !important;
    font-weight: 600 !important;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-secondary);
    background-image: 
        radial-gradient(at 0% 0%, hsla(180, 80%, 15%, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(210, 80%, 15%, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, hsla(222, 47%, 11%, 1) 0px, transparent 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-teal);
}

/* Layout App Container */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all var(--transition-speed) ease;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 2.5rem;
    padding-left: 0.5rem;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--accent-teal-glow));
}

.brand-name {
    font-size: 1.65rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--text-main), hsl(190, 80%, 85%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-link svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(4px);
}

.nav-link.active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(26, 54, 80, 0.4), rgba(15, 68, 77, 0.4));
    border-color: rgba(174, 90, 41, 0.2);
    border: 1px solid rgba(174, 90, 41, 0.15);
    box-shadow: 
        inset 0 0 12px rgba(255, 255, 255, 0.02),
        0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent-teal), var(--accent-cyan));
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent-teal);
}

.nav-link.active svg {
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 5px var(--accent-cyan-glow));
    transform: scale(1.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pool-info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pool-info-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.pool-info-title {
    color: var(--text-dark);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.pool-info-val {
    color: var(--accent-cyan);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 2.5rem 3rem;
    min-height: 100vh;
    transition: all var(--transition-speed) ease;
    width: calc(100% - var(--sidebar-width));
}

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

.header-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-title {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--text-main), hsl(210, 20%, 80%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Header Controls (Sun Mode Toggle) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Custom Sun Mode Switch button */
.sun-mode-toggle-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: var(--glass-shadow);
    transition: all 0.2s ease;
}

.sun-mode-toggle-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.sun-mode-toggle-btn.active {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: #000000;
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.4);
}

.quick-status-badge {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: var(--glass-shadow);
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--status-success);
    box-shadow: 0 0 10px var(--status-success);
    position: relative;
}

.status-indicator-dot.pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.6;
    animation: pulseGlow 1.8s infinite ease-out;
}

.quick-status-text {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Tab Content Visibility */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

/* Glassmorphism Card Base */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    position: relative;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   [NUEVO] DASHBOARD PRO (VISTA RÁPIDA PARA TÉCNICOS EN CAMPO)
   ========================================================================== */

/* Main Grid of Dashboard */
.pro-dashboard-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* "Estado General" Top Card */
.field-diagnostic-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-left: 5px solid var(--accent-cyan);
}

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

.field-diagnostic-title {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Traffic Light Status List */
.field-metrics-traffic-lights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
}

.metric-status-row {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

.metric-status-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.metric-status-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.metric-status-value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-status-val {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.status-dot-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    text-transform: uppercase;
}

/* "Acción Recomendada" Main box */
.recommended-action-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px dashed var(--glass-border-focus);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recommended-action-box.action-crit {
    border-color: var(--status-danger);
    background: rgba(244, 63, 94, 0.03);
}

.recommended-action-box.action-warn {
    border-color: var(--status-warning);
    background: rgba(245, 158, 11, 0.03);
}

.recommended-action-box.action-ok {
    border-color: var(--status-success);
    background: rgba(16, 185, 129, 0.03);
}

.action-box-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.action-box-text {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-main);
}

/* [NUEVO] LARGE POOL VOLUME CARD */
.volume-large-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-left: 5px solid var(--accent-blue);
    background: linear-gradient(135deg, rgba(15, 32, 66, 0.5), rgba(15, 23, 42, 0.45));
}

.volume-large-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.volume-large-number {
    font-size: 3.5rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    color: var(--accent-blue);
    line-height: 1;
    text-shadow: 0 0 20px rgba(0, 150, 255, 0.25);
    margin-bottom: 0.5rem;
}

.volume-large-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.volume-large-shape-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-top: 0.75rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* [NUEVO] DOSIFICACIONES COMPACTAS GRID */
.compact-dosages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.compact-dosage-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1.5px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.compact-dosage-card:hover {
    border-color: var(--glass-border-focus);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.01);
}

.dosage-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dosage-card-icon {
    font-size: 1.35rem;
}

.dosage-card-product {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
}

.dosage-card-qty {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--accent-cyan);
    line-height: 1;
}

.dosage-card-qty span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 0.15rem;
}

.dosage-card-target-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    display: inline-flex;
    align-self: flex-start;
}

/* Chemistry Control Panel in Pro */
.pro-chemistry-card {
    display: flex;
    flex-direction: column;
}

/* Circular Health Meter in Pro */
.pro-health-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.health-gauge-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.health-gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.health-gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 12;
}

.health-gauge-fill {
    fill: none;
    stroke: url(#gauge-gradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.health-percentage-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.health-percentage-number {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    background: linear-gradient(135deg, var(--text-main), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.health-percentage-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 0.25rem;
    letter-spacing: 0.05em;
}

.health-status-badge {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.health-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 240px;
    font-weight: 500;
}

.slider-group-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex-grow: 1;
}

.parameter-slider-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.parameter-slider-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

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

.param-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.param-status-tag {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
}

.param-value-display {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin: 0.75rem 0;
}

.param-num {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.param-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Custom Slider Styling */
.range-slider-wrapper {
    position: relative;
    width: 100%;
}

.custom-range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin: 10px 0;
    transition: background 0.2s ease;
}

.custom-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-main);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.1);
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.custom-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.custom-range-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

.param-range-guides {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 600;
}

/* Quick Actions Box */
.quick-dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.dashboard-action-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
}

.dashboard-action-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.dashboard-action-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

/* Buttons System */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
    color: var(--bg-secondary);
    box-shadow: 0 4px 15px var(--accent-teal-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(174, 90, 41, 0.5);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--status-danger), hsl(355, 80%, 60%));
    color: var(--text-main);
    box-shadow: 0 4px 15px var(--status-danger-bg);
}

.btn-danger:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* ==========================================================================
   Calculadora Tab Styles
   ========================================================================== */

.calc-grid {
    display: grid;
    grid-template-columns: 1.3fr 1.7fr;
    gap: 2rem;
}

/* Pill Toggle Switch */
.unit-toggle-container {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 30px;
    align-self: center;
}

.unit-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-btn.active {
    background: var(--text-main);
    color: var(--bg-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.form-control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
}

.form-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Shape Visualizer Widget */
.shape-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.shape-option {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.shape-option svg {
    width: 32px;
    height: 32px;
    stroke: var(--text-muted);
    stroke-width: 1.8;
    fill: none;
    transition: stroke 0.2s ease;
}

.shape-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.shape-option.active {
    background: rgba(174, 90, 41, 0.15);
    border-color: var(--accent-teal);
    color: var(--text-main);
}

.shape-option.active svg {
    stroke: var(--accent-teal);
    filter: drop-shadow(0 0 3px var(--accent-teal-glow));
}

/* Interactive Volume Result */
.volume-result-panel {
    background: linear-gradient(135deg, rgba(10, 25, 40, 0.6), rgba(10, 40, 50, 0.6));
    border: 1px solid rgba(174, 90, 41, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.volume-val-display h5 {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.volume-val-display div {
    font-size: 2.25rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--accent-teal);
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.volume-val-display span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.no-dosages-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    text-align: center;
    gap: 1rem;
}

.no-dosages-placeholder svg {
    width: 60px;
    height: 60px;
    stroke: var(--text-dark);
    stroke-width: 1.5;
}

/* ==========================================================================
   Bitácora (Logs) Tab Styles
   ========================================================================== */

.logs-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.85fr;
    gap: 2rem;
}

/* Custom Multiselect Checklist Grid */
.checklist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.checkbox-tile {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.checkbox-tile input[type="checkbox"] {
    display: none;
}

.checkbox-tile-indicator {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-tile-indicator::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid var(--bg-secondary);
    border-bottom: 2px solid var(--bg-secondary);
    transform: rotate(-45deg) translate(0.5px, -0.5px);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.checkbox-tile:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.checkbox-tile input[type="checkbox"]:checked + .checkbox-tile-indicator {
    background-color: var(--accent-teal);
    border-color: var(--accent-teal);
    box-shadow: 0 0 8px var(--accent-teal-glow);
}

.checkbox-tile input[type="checkbox"]:checked + .checkbox-tile-indicator::after {
    opacity: 1;
}

.checkbox-tile-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.checkbox-tile input[type="checkbox"]:checked ~ .checkbox-tile-label {
    color: var(--text-main);
}

/* Elegant Logs Timeline & Filter */
.logs-history-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.logs-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
}

.logs-timeline {
    position: relative;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.logs-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.timeline-item {
    position: relative;
}

.timeline-node {
    position: absolute;
    left: -24px;
    top: 24px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 10px var(--accent-cyan);
    z-index: 2;
}

.log-item-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.log-item-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.log-item-date {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.log-item-date-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.log-item-time-text {
    font-size: 0.75rem;
    color: var(--text-dark);
    font-weight: 500;
}

.log-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.log-metric-badge {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
}

.log-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.log-metric-val {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.log-item-actions-box {
    margin-top: 0.75rem;
}

.log-item-actions-title {
    font-size: 0.75rem;
    color: var(--text-dark);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.log-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.log-action-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: var(--accent-cyan);
}

.log-item-notes {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    border-radius: 10px;
    margin-top: 0.75rem;
    border-left: 3px solid var(--accent-teal);
    font-weight: 500;
}

/* ==========================================================================
   Agenda (Tasks) Tab Styles
   ========================================================================== */

.tasks-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.tasks-progress-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem;
}

.progress-radial-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-radial-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-radial-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 14;
}

.progress-radial-fill {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 439.82;
    stroke-dashoffset: 439.82;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-radial-percent {
    position: absolute;
    font-size: 2.75rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

/* Quick Add Task Field */
.add-task-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Tabbed Checklist Categories */
.tasks-categories-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.35rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.task-cat-btn {
    flex-grow: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.task-cat-btn.active {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.task-row-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.2s ease;
}

.task-row-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.task-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    flex-grow: 1;
    user-select: none;
}

.task-checkbox-label input[type="checkbox"] {
    display: none;
}

.task-indicator {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.task-indicator::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid var(--bg-secondary);
    border-bottom: 2px solid var(--bg-secondary);
    transform: rotate(-45deg) translate(0.5px, -0.5px);
    opacity: 0;
    transition: opacity 0.1s ease;
}

.task-checkbox-label input[type="checkbox"]:checked + .task-indicator {
    background-color: var(--accent-teal);
    border-color: var(--accent-teal);
    box-shadow: 0 0 10px var(--accent-teal-glow);
}

.task-checkbox-label input[type="checkbox"]:checked + .task-indicator::after {
    opacity: 1;
}

.task-text-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.task-title-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.task-desc-text {
    font-size: 0.75rem;
    color: var(--text-dark);
    font-weight: 500;
}

.task-checkbox-label input[type="checkbox"]:checked ~ .task-text-info .task-title-text {
    color: var(--text-dark);
    text-decoration: line-through;
}

.task-row-card.completed {
    opacity: 0.75;
}

.task-row-card.custom-created .delete-task-btn {
    display: block;
}

.delete-task-btn {
    background: transparent;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: none;
}

.delete-task-btn:hover {
    color: var(--status-danger);
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   [NUEVO] ASISTENTE AQUACARE (MODULO INTELIGENTE NLP)
   ========================================================================== */
.asistente-chat-card {
    border-left: 5px solid var(--accent-teal);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.asistente-input-wrapper {
    position: relative;
    width: 100%;
}

.asistente-textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem 4.5rem 1.25rem 1.25rem;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.5;
    outline: none;
    width: 100%;
    resize: none;
    transition: all 0.2s ease;
}

.asistente-textarea:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 15px var(--accent-teal-glow);
}

.asistente-btn-send {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-teal);
    color: var(--bg-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.asistente-btn-send:hover {
    transform: scale(1.05);
    background: var(--accent-cyan);
}

.asistente-response-bubble {
    background: linear-gradient(135deg, rgba(13, 27, 42, 0.6), rgba(15, 76, 92, 0.2));
    border: 1.5px solid rgba(174, 90, 41, 0.25);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    animation: slideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.asistente-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-teal-glow);
    border: 1px solid rgba(174, 90, 41, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.asistente-message-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.asistente-message-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent-teal);
}

.asistente-message-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.5;
}

.asistente-instructions-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Troubleshooter Tab */
.diagnostics-tab-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.problem-card-tile {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1.75rem;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.problem-card-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-cyan);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.problem-card-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.problem-card-tile:hover::before {
    opacity: 1;
}

.problem-card-tile.active {
    border-color: var(--accent-teal);
    background: rgba(10, 30, 40, 0.6);
    box-shadow: 0 0 20px rgba(174, 90, 41, 0.15);
}

.problem-card-tile.active::before {
    opacity: 1;
    background: var(--accent-teal);
}

.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.problem-icon-emoji {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.problem-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.problem-description-short {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    font-weight: 500;
}

.problem-severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Interactive Diagnostic Report panel */
.diagnostic-report-panel {
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.report-summary-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.report-summary-item h6 {
    color: var(--text-dark);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.report-summary-item p {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
    font-weight: 600;
}

.report-severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
}

/* Treatment Protocol Checklist */
.treatment-steps-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.treatment-step-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: background-color 0.2s ease;
}

.treatment-step-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.step-number-bubble {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-cyan-glow);
    border: 1px solid rgba(190, 100, 45, 0.3);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    flex-shrink: 0;
}

.step-info {
    flex-grow: 1;
}

.step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.step-instruction {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    font-weight: 500;
}

/* ==========================================================================
   Modals & Notifications Overlay
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 10, 20, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease forwards;
}

.modal-card {
    background: hsl(222, 47%, 13%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--card-radius);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: modalPop 0.3s var(--ease-elastic) forwards;
}

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

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.15);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.toast-success {
    border-left: 4px solid var(--status-success);
}

.toast-error {
    border-left: 4px solid var(--status-danger);
}

.toast-info {
    border-left: 4px solid var(--accent-cyan);
}

/* ==========================================================================
   Responsive Design & Animations
   ========================================================================== */

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
    from { transform: scale(1); opacity: 0.6; }
    to { transform: scale(2.2); opacity: 0; }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .pro-dashboard-grid, .calc-grid, .logs-grid, .tasks-layout {
        grid-template-columns: 1fr;
    }
    
    .field-diagnostic-card {
        grid-column: span 1;
    }
    
    .volume-large-card {
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    
    body {
        padding-bottom: 80px; /* Safe padding for bottom navigation */
    }

    .sidebar {
        width: 100vw;
        height: 65px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
        bottom: 0;
        top: auto;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        background: rgba(10, 15, 30, 0.85);
        backdrop-filter: blur(25px);
        border-radius: 20px 20px 0 0;
    }

    .brand {
        display: none; /* Hide brand logo in mobile bar */
    }

    .nav-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
        height: 100%;
        align-items: center;
    }

    .nav-item {
        width: auto;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-link {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
        align-items: center;
        justify-content: center;
        border-radius: 0;
        background: transparent !important;
        border: none !important;
    }

    .nav-link.active::before {
        display: none;
    }

    .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 30%;
        width: 40%;
        height: 3px;
        background: var(--accent-cyan);
        border-radius: 10px;
        box-shadow: 0 0 8px var(--accent-cyan);
    }

    .nav-link svg {
        width: 22px;
        height: 22px;
    }

    .sidebar-footer {
        display: none; /* Hide footer in bottom bar */
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        width: 100%;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .header-controls {
        align-self: stretch;
        justify-content: space-between;
    }

    .header-title {
        font-size: 1.85rem;
    }

    .slider-group-container {
        grid-template-columns: 1fr;
    }
}
