/* ================================
   Platform Control Center Styles
   Distinct visual theme for SuperAdmin
   ================================ */

/* Platform Layout */
.platform-layout {
    background-color: #f8f9fa;
}

.platform-layout .navbar {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.platform-layout .platform-navbar .navbar-brand {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.platform-layout .platform-navbar .brand-icon {
    color: #60a5fa;
}

.platform-layout .platform-navbar .brand-text {
    color: #fff;
    margin-left: 0.75rem;
}

.platform-layout .platform-navbar .menu-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.platform-layout .platform-navbar .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Platform Sidebar */
.platform-sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.1);
}

.platform-sidebar .platform-brand {
    display: flex;
    align-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.platform-sidebar .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.platform-sidebar .brand-text {
    margin-left: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: #f1f5f9;
}

.platform-sidebar .nav-item {
    color: #cbd5e1;
    margin: 0.25rem 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.platform-sidebar .nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.platform-sidebar .nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    font-weight: 500;
}

.platform-sidebar .nav-icon {
    color: currentColor;
}

.platform-sidebar .nav-divider {
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    margin: 1rem 0.75rem;
}

.platform-sidebar .logout-btn {
    color: #f87171;
}

.platform-sidebar .logout-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #ef4444;
}

/* Platform Dashboard Specific */
.platform-dashboard {
    padding: 2rem;
}

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

.dashboard-header h3 {
    font-size: 1.75rem;
    color: #1e293b;
    margin: 0;
}

.dashboard-header .text-muted {
    color: #64748b !important;
    font-size: 0.95rem;
}

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.kpi-icon.bg-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.kpi-icon.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.kpi-icon.bg-info {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
}

.kpi-icon.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1;
}

.kpi-sublabel {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Job Status Panel */
.job-status-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.panel-header h5 {
    margin: 0;
    color: #1e293b;
}

.job-table {
    margin: 0;
}

.job-table thead {
    background: #f8fafc;
}

.job-table thead th {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    border: none;
}

.job-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.job-table tbody tr:last-child td {
    border-bottom: none;
}

.job-table tbody tr:hover {
    background: #f8fafc;
}

.job-table .badge {
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    font-size: 0.8rem;
}

.badge.bg-success-subtle {
    background: #d1fae5;
    color: #065f46;
}

.badge.bg-danger-subtle {
    background: #fee2e2;
    color: #991b1b;
}

/* Execution Statistics */
.execution-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

/* Platform Page Generic */
.platform-page {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h3 {
    font-size: 1.75rem;
    color: #1e293b;
    margin: 0;
}

.page-header .text-muted {
    color: #64748b !important;
    font-size: 0.95rem;
}

.coming-soon-panel {
    background: #fff;
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.coming-soon-panel .display-1 {
    font-size: 4rem;
}

/* User Profile in Navbar */
.platform-navbar .user-profile-container {
    position: relative;
}

.platform-navbar .user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-navbar .user-profile:hover {
    background: rgba(255, 255, 255, 0.15);
}

.platform-navbar .user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.platform-navbar .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.platform-navbar .user-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1;
}

.platform-navbar .user-role-badge {
    background: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-navbar .chevron-icon {
    color: #fff;
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

.platform-navbar .chevron-icon.open {
    transform: rotate(180deg);
}

/* Dropdown Backdrop */
.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}

/* User Dropdown Menu */
.platform-navbar .user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-navbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    transition: all 0.2s ease;
    text-align: left;
}

.platform-navbar .dropdown-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.platform-navbar .dropdown-item svg {
    color: #6b7280;
}

.platform-navbar .dropdown-item:hover svg {
    color: #374151;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* Metrics Page Styles */
.metrics-section {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.metrics-section h5 {
    color: #f1f5f9;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.metric-box {
    background: #0f172a;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #334155;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: #94a3b8;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jobs-metrics-panel {
    background: #0f172a;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.jobs-metrics-panel .table {
    margin-bottom: 0;
}

.jobs-metrics-panel .table thead {
    background: #1e293b;
    border-bottom: 2px solid #334155;
}

.jobs-metrics-panel .table thead th {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jobs-metrics-panel .table tbody tr {
    border-bottom: 1px solid #334155;
    transition: background-color 0.2s ease;
}

.jobs-metrics-panel .table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.jobs-metrics-panel .table tbody td {
    color: #e2e8f0;
    padding: 1rem;
    vertical-align: middle;
    border: none;
}

.metric-panel {
    background: #0f172a;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #334155;
    height: 100%;
}

.metric-panel h6 {
    color: #f1f5f9;
    font-size: 0.95rem;
}

.subscription-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subscription-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subscription-label {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subscription-value {
    color: #94a3b8;
    font-weight: 600;
}

.subscription-bar {
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.subscription-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.activity-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.activity-item i {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
}

.activity-content {
    flex: 1;
}

.activity-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1;
}

.activity-label {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.metric-value-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.metric-panel .metric-label {
    color: #94a3b8;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Progress bars in metrics */
.jobs-metrics-panel .progress {
    background-color: #1e293b;
    border-radius: 4px;
}

.jobs-metrics-panel .progress-bar {
    border-radius: 4px;
}

/* Button in metrics page header */
.page-header .btn-outline-primary {
    color: #60a5fa;
    border-color: #60a5fa;
    background: transparent;
    transition: all 0.3s ease;
}

.page-header .btn-outline-primary:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
    .platform-dashboard,
    .platform-page {
        padding: 1rem;
    }

    .kpi-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .metric-value-large {
        font-size: 1.8rem;
    }

    .activity-item {
        flex-direction: column;
        text-align: center;
    }
}
