/* ============================================
   UBS Marketing Control Panel – Demo Styles
   Dark modern dashboard theme
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette */
    --bg-dark: #1a1d23;
    --bg-card: #242830;
    --bg-sidebar: #1e2128;
    --bg-header: #15171c;
    --border-color: #2e3340;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-muted: #6b7280;
    --accent-blue: #4a9eff;
    --accent-green: #34d399;
    --accent-yellow: #fbbf24;
    --accent-red: #f87171;
    --hover-bg: #2d3341;
    --active-bg: #3b4252;
    
    /* Sizing */
    --header-height: 56px;
    --sidebar-width: 220px;
    --footer-height: 32px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-dark);
}

/* ============================================
   Top Header
   ============================================ */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.header-left .logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 0.5px;
}

.header-center h1 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.header-right .user-chip {
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ============================================
   App Container (Sidebar + Main)
   ============================================ */
.app-container {
    display: flex;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    margin-top: var(--header-height);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 16px 0;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--active-bg);
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pill {
    background: var(--accent-blue);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   Top Row Layout
   ============================================ */
.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Pipeline List */
.pipeline-list, .task-list {
    list-style: none;
    padding: 12px 18px;
}

.pipeline-list li, .task-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
}

.pipeline-list li:last-child, .task-list li:last-child {
    border-bottom: none;
}

.pipeline-list .pipeline-name {
    color: var(--text-primary);
}

.pipeline-list .pipeline-count {
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--accent-green);
    font-weight: 600;
}

/* Task List */
.task-priority {
    margin-right: 10px;
}

.task-priority.high { color: var(--accent-red); }
.task-priority.medium { color: var(--accent-yellow); }
.task-priority.low { color: var(--accent-green); }

.task-list li {
    justify-content: flex-start;
}

/* ============================================
   Bottom Row Layout
   ============================================ */
.bottom-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    flex: 1;
}

/* Table Card */
.table-card {
    display: flex;
    flex-direction: column;
}

.table-wrapper {
    flex: 1;
    overflow: auto;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
}

.accounts-table th {
    text-align: left;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.accounts-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.accounts-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.accounts-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.1);
}

.accounts-table tbody tr:hover {
    background: var(--hover-bg);
}

.accounts-table tbody tr.selected {
    background: var(--active-bg);
    border-left: 3px solid var(--accent-blue);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(52, 211, 153, 0.2);
    color: var(--accent-green);
}

.status-badge.at-risk {
    background: rgba(248, 113, 113, 0.2);
    color: var(--accent-red);
}

.status-badge.prospect {
    background: rgba(74, 158, 255, 0.2);
    color: var(--accent-blue);
}

/* Summary Panel */
.summary-panel {
    display: flex;
    flex-direction: column;
}

.summary-content {
    padding: 18px;
    flex: 1;
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 40px 0;
}

.summary-content .summary-item {
    margin-bottom: 16px;
}

.summary-content .summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-content .summary-value {
    font-size: 14px;
    color: var(--text-primary);
}

.summary-content .summary-value.highlight {
    color: var(--accent-blue);
    font-weight: 600;
}

.summary-content .summary-note {
    background: var(--bg-dark);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-yellow);
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ============================================
   Footer
   ============================================ */
.app-footer {
    height: var(--footer-height);
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Utility Classes
   ============================================ */
.loading {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .bottom-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .top-row {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 60px;
    }
    
    .nav-item span:not(.nav-icon) {
        display: none;
    }
    
    .nav-icon {
        margin-right: 0;
    }
    
    .nav-item {
        justify-content: center;
    }
}
