/* Enterprise Views - NTT Data Dashboard
   Glassmorphism consistent with existing style.css */

/* ── Client Selector ── */
.client-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.client-selector-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.client-selector-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    transform: translateY(-2px);
}

.client-selector-card .client-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
}

.client-selector-card .client-name {
    font-weight: 600;
    font-size: 1rem;
}

.client-selector-card .industry-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.client-branding-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 1rem;
}

.client-branding-area .client-logo-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}

.client-branding-area .client-name-sm {
    font-weight: 500;
    font-size: 0.9rem;
}

.client-branding-area .change-client-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.client-branding-area .change-client-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* ── Enterprise Tab Layout ── */
.enterprise-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.enterprise-nav .tab-btn-enterprise {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.enterprise-nav .tab-btn-enterprise:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

.enterprise-nav .tab-btn-enterprise.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.enterprise-panel {
    display: none;
}

.enterprise-panel.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── Industry Badges ── */
.industry-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.industry-badge.mine { background: rgba(255, 100, 50, 0.2); color: #ff6432; }
.industry-badge.warehouse { background: rgba(255, 200, 50, 0.2); color: #ffc832; }
.industry-badge.crane { background: rgba(100, 200, 255, 0.2); color: #64c8ff; }
.industry-badge.plant { background: rgba(50, 200, 100, 0.2); color: #32c864; }
.industry-badge.logistics { background: rgba(200, 100, 255, 0.2); color: #c864ff; }

/* ── Status Badges ── */
.status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-weight: 500;
}

.status-badge.active { background: rgba(57, 255, 20, 0.15); color: var(--accent-green); }
.status-badge.idle { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); }
.status-badge.maintenance { background: rgba(255, 200, 50, 0.2); color: #ffc832; }
.status-badge.offline { background: rgba(255, 49, 49, 0.15); color: var(--accent-red); }
.status-badge.emergency { background: rgba(255, 0, 0, 0.25); color: #ff0000; }
.status-badge.planning { background: rgba(100, 200, 255, 0.15); color: #64c8ff; }
.status-badge.paused { background: rgba(255, 200, 50, 0.15); color: #ffc832; }
.status-badge.completed { background: rgba(57, 255, 20, 0.15); color: var(--accent-green); }
.status-badge.cancelled { background: rgba(255, 49, 49, 0.15); color: var(--accent-red); }
.status-badge.running { background: rgba(0, 240, 255, 0.2); color: var(--accent-cyan); animation: pulse-glow 1.5s infinite alternate; }
.status-badge.success { background: rgba(57, 255, 20, 0.2); color: var(--accent-green); }
.status-badge.failure { background: rgba(255, 49, 49, 0.2); color: var(--accent-red); }
.status-badge.pending { background: rgba(255, 200, 50, 0.15); color: #ffc832; }

/* ── Severity Indicators ── */
.severity-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical { background: rgba(255, 49, 49, 0.2); color: #ff3131; }
.severity-badge.warning { background: rgba(255, 200, 50, 0.2); color: #ffc832; }
.severity-badge.info { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); }

.severity-severity-card {
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    min-width: 100px;
}

.severity-severity-card.critical { background: rgba(255, 49, 49, 0.1); border: 1px solid rgba(255, 49, 49, 0.2); }
.severity-severity-card.warning { background: rgba(255, 200, 50, 0.1); border: 1px solid rgba(255, 200, 50, 0.2); }
.severity-severity-card.info { background: rgba(0, 240, 255, 0.1); border: 1px solid rgba(0, 240, 255, 0.2); }

/* ── Fleet Vehicle Cards ── */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.vehicle-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    transition: var(--transition-smooth);
}

.vehicle-card:hover {
    border-color: rgba(255,255,255,0.12);
}

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

.vehicle-card .vehicle-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.vehicle-card .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.vehicle-card .status-dot.connected,
.vehicle-card .status-dot.active { background: var(--accent-green); }
.vehicle-card .status-dot.idle { background: var(--accent-cyan); }
.vehicle-card .status-dot.maintenance { background: #ffc832; }
.vehicle-card .status-dot.offline { background: var(--accent-red); }
.vehicle-card .status-dot.emergency { background: #ff0000; animation: pulse-glow 0.5s infinite alternate; }

.vehicle-card .telemetry-mini {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.vehicle-card .telemetry-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.vehicle-card .telemetry-item span {
    color: var(--text-primary);
    font-weight: 500;
}

/* ── Drone Cards ── */
.drone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.drone-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    transition: var(--transition-smooth);
}

.drone-card .battery-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    margin: 0.5rem 0;
    overflow: hidden;
}

.drone-card .battery-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease, background 0.5s ease;
}

.battery-fill.green { background: var(--accent-green); }
.battery-fill.yellow { background: #ffc832; }
.battery-fill.red { background: var(--accent-red); }

/* ── Canvas / Map Containers ── */
.map-canvas-container {
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    position: relative;
}

.map-canvas-container canvas {
    width: 100%;
    height: 100%;
}

/* ── Alert Toast System ── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    animation: toast-slide-in 0.3s ease-out;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.toast-critical { border-left: 3px solid var(--accent-red); }
.toast.toast-warning { border-left: 3px solid #ffc832; }
.toast.toast-info { border-left: 3px solid var(--accent-cyan); }
.toast.toast-success { border-left: 3px solid var(--accent-green); }

.toast .toast-icon { font-size: 1.2rem; }
.toast .toast-content { flex: 1; }
.toast .toast-title { font-weight: 600; font-size: 0.9rem; }
.toast .toast-body { font-size: 0.8rem; color: var(--text-secondary); }
.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
}

/* ── Enterprise Table ── */
.enterprise-table {
    width: 100%;
    border-collapse: collapse;
}

.enterprise-table th {
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.enterprise-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.85rem;
    vertical-align: middle;
}

.enterprise-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ── Enterprise Form ── */
.enterprise-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.enterprise-form .form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    align-items: center;
}

.enterprise-form .form-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.enterprise-form input,
.enterprise-form select,
.enterprise-form textarea {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.enterprise-form input:focus,
.enterprise-form select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.1);
}

.btn-enterprise {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-enterprise:hover {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.btn-enterprise:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-danger-enterprise {
    background: rgba(255, 49, 49, 0.1);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

/* ── Progress Bar ── */
.progress-phase {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-phase .phase-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
}

.progress-phase .phase-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--ntt-future-blue));
    transition: width 0.5s ease;
}

.progress-phase .phase-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
}

/* ── Modal ── */
.enterprise-modal {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 800px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--text-primary);
}

.enterprise-modal::backdrop {
    background: rgba(0,0,0,0.7);
}

/* ── Gauge ── */
.gauge-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.gauge-item {
    text-align: center;
    min-width: 80px;
}

.gauge-item .gauge-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.gauge-item .gauge-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ── Empty state ── */
.empty-enterprise {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    gap: 0.5rem;
}

/* ── Slider styling ── */
input[type="range"].threshold-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"].threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* ── Audit Timeline ── */
.audit-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(255,255,255,0.05);
}

.audit-entry {
    position: relative;
    padding-left: 1rem;
}

.audit-entry::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-cyan);
}

.audit-entry .audit-consultant {
    font-weight: 500;
    font-size: 0.85rem;
}

.audit-entry .audit-action {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.audit-entry .audit-timestamp {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
}

/* ── Detail Panel ── */
.detail-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.detail-panel .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.detail-panel .detail-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.detail-panel .detail-value {
    font-weight: 500;
    font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .client-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .vehicle-grid,
    .drone-grid {
        grid-template-columns: 1fr;
    }
    .enterprise-form .form-row {
        grid-template-columns: 1fr;
    }
}