/* Orbit ISP Management - Design System Stylesheet */

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

:root {
    --bg-main: #060913;
    --bg-card: rgba(13, 20, 38, 0.65);
    --bg-card-hover: rgba(18, 27, 51, 0.8);
    --border-glass: rgba(255, 255, 255, 0.07);
    --border-glass-focus: rgba(6, 182, 212, 0.4);
    
    --text-main: #f3f4f6;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    /* Neon Palettes */
    --color-cyan: #06b6d4;
    --color-emerald: #10b981;
    --color-blue: #3b82f6;
    --color-amber: #f59e0b;
    --color-crimson: #ef4444;
    --color-purple: #a855f7;
    
    /* Glow Shadows */
    --glow-cyan: 0 0 15px rgba(6, 182, 212, 0.35);
    --glow-emerald: 0 0 15px rgba(16, 185, 129, 0.35);
    --glow-blue: 0 0 15px rgba(59, 130, 246, 0.35);
    --glow-crimson: 0 0 15px rgba(239, 68, 68, 0.35);
    
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body, .main-dashboard-wrapper {
    position: relative;
    min-height: 100vh;
    background: radial-gradient(circle, rgba(6, 9, 19, 0.88) 20%, rgba(6, 9, 19, 0.96) 100%), 
                url('/static/img/space-bg.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
    color: #f1f5f9; /* Color de texto claro por defecto para contraste */
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Asegurar que las tarjetas de los paneles, tablas y contenedores mantengan legibilidad */
.dashboard-card, .panel-container, .bg-sidebar, .card, .glass-card {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

h1, h2, h3, h4, .brand-name {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Decorative Background Glows */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.background-decor .circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(130px);
    opacity: 0.18;
}

.background-decor .circle-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-cyan) 0%, rgba(6,182,212,0) 70%);
    top: -100px;
    left: -50px;
}

.background-decor .circle-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-purple) 0%, rgba(168,85,247,0) 70%);
    bottom: -150px;
    right: -100px;
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-cyan);
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.5));
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.logo-text span {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 16px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-main);
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Layout Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Glass Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-medium);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
}

.card-icon {
    width: 24px;
    height: 24px;
}

.c-cyan { color: var(--color-cyan); filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.4)); }
.c-emerald { color: var(--color-emerald); filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.4)); }
.c-blue { color: var(--color-blue); filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.4)); }
.c-amber { color: var(--color-amber); filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.4)); }
.c-crimson { color: var(--color-crimson); filter: drop-shadow(0 0 5px rgba(239, 104, 104, 0.4)); }
.c-purple { color: var(--color-purple); filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.4)); }

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* UI Elements & Controls */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control, select, textarea, 
input[type="text"], input[type="tel"], input[type="datetime-local"], 
input[type="password"], input[type="url"], input[type="date"], input[type="number"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition-fast);
}

.form-control:focus, select:focus, textarea:focus, input:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Row-based Form (compact) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-cyan);
    color: var(--text-dark);
}

.btn-primary:hover {
    background: #0891b2;
    box-shadow: var(--glow-cyan);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-emerald {
    background: var(--color-emerald);
    color: var(--text-dark);
}

.btn-emerald:hover {
    background: #059669;
    box-shadow: var(--glow-emerald);
}

.btn-danger {
    background: var(--color-crimson);
    color: var(--text-main);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--glow-crimson);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* KPI Badge / Quick Info */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--color-cyan); }
.kpi-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }
.kpi-icon.crimson { background: rgba(239, 68, 68, 0.15); color: var(--color-crimson); }

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

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Monitoring Real Time Panel */
.monitor-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.monitor-item {
    display: grid;
    grid-template-columns: 200px 1fr 150px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.monitor-item:last-child {
    border-bottom: none;
}

.monitor-tech {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.monitor-tech h3 {
    font-size: 15px;
    font-weight: 600;
}

.monitor-tech span {
    font-size: 12px;
    color: var(--text-muted);
}

.monitor-task {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.monitor-task .client {
    font-weight: 500;
    font-size: 14px;
}

.monitor-task .info {
    font-size: 12px;
    color: var(--text-muted);
}

.monitor-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background: rgba(156, 163, 175, 0.15); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.3); }
.badge-travel { background: rgba(59, 130, 246, 0.15); color: var(--color-blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-progress { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--color-crimson); border: 1px solid rgba(239, 68, 68, 0.3); }

.monitor-time {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}

/* Custom Table style */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-glass);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Console logs simulation styling */
.console-box {
    margin-top: 24px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid var(--border-glass);
    border-bottom: none;
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
}

.console-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-emerald);
}

.console-dots {
    display: flex;
    gap: 6px;
}

.console-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.console-body {
    background: rgba(7, 10, 20, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 0 0 12px 12px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.console-line {
    line-height: 1.4;
    display: flex;
    gap: 8px;
}

.console-line .timestamp {
    color: var(--text-muted);
}

.console-line .tag {
    font-weight: bold;
}

.tag-alerta { color: var(--color-amber); }
.tag-reporte { color: var(--color-cyan); }
.tag-email { color: var(--color-purple); }

.console-line .content {
    white-space: pre-wrap;
    color: #cbd5e1;
}

/* Technician View (Mobile Optimized) */
.mobile-view {
    max-width: 576px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-header {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.mobile-tech-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.task-list-title {
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

.mobile-task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.mobile-task-card.active {
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

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

.mobile-task-type {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
}

.mobile-task-time {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.mobile-task-detail {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    font-size: 14px;
    align-items: center;
}

.mobile-task-detail i {
    color: var(--color-cyan);
}

.mobile-task-detail.notes {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--color-cyan);
    align-items: flex-start;
}

.mobile-task-actions {
    margin-top: 8px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0b0f19;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow-card);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 12px;
}

.close-modal {
    float: right;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

/* Material items list in modal */
.material-selector-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.material-selection-row {
    display: grid;
    grid-template-columns: 1fr 100px 40px;
    align-items: center;
    gap: 10px;
}

/* Pulsing led */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.pulse-dot.active {
    background-color: var(--color-emerald);
    box-shadow: 0 0 8px var(--color-emerald);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.tabs-header {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 10px;
}

.tab-trigger {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: inherit;
    font-weight: 500;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.tab-trigger.active {
    color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.08);
}

.tab-content {
    display: none;
}

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

/* stock adjustments style */
.stock-adjust-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.stock-adjust-row:last-child {
    border-bottom: none;
}

.stock-adjust-info h4 {
    font-size: 14px;
    font-weight: 500;
}

.stock-adjust-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.stock-adjust-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-adjust-actions input {
    width: 70px;
    text-align: center;
}

/* Media Queries */
@media (max-width: 968px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }
    .monitor-item {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .monitor-status {
        grid-column: span 2;
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
    .app-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Membership Stacking Warning Styles */
.billing-section-ok {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}
.billing-section-ok span:not(.badge), .billing-section-ok h4, .billing-section-ok #profile-plan-with-price {
    color: #34d399 !important;
}
.billing-section-ok #billing-vencimiento {
    color: #34d399 !important;
}
.billing-section-warn {
    background: rgba(244, 63, 94, 0.08) !important;
    border: 1px solid rgba(244, 63, 94, 0.2) !important;
}
.billing-section-warn span:not(.badge), .billing-section-warn h4, .billing-section-warn #profile-plan-with-price {
    color: #fb7185 !important;
}
.billing-section-warn #billing-vencimiento {
    color: #fb7185 !important;
}

/* Interactive Stock Table Rows */
.stock-row-interactive {
    cursor: pointer;
    transition: var(--transition-fast);
}

.stock-row-interactive:hover td {
    background: rgba(6, 182, 212, 0.08) !important;
}

.stock-row-interactive.active-row td {
    background: rgba(6, 182, 212, 0.12) !important;
}

.stock-row-interactive.active-row {
    border-left: 3px solid var(--color-cyan);
}

/* Chart Period Selector Buttons */
.btn-period {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
}

.btn-period:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.btn-period.active {
    background: var(--color-cyan) !important;
    color: var(--text-dark) !important;
    font-weight: 600;
}

/* Google Maps Dark Mode CSS Filter — only applied dynamically via JS on baselayerchange */
.google-dark-filter {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%) !important;
}

/* Premium Styling for Next Destination Tooltip */
.next-dest-tooltip {
    background-color: #020617 !important;
    border: 1px solid #22c55e !important;
    color: #22c55e !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    padding: 3px 6px !important;
}
.next-dest-tooltip::before {
    border-top-color: #22c55e !important;
}

