/* Holter Enterprise — Dashboard Portal Styles */
/* All classes prefixed db- to avoid conflicts with style.css */

/* ── Layout Shell ─────────────────────────────────────────── */

.db-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.db-layout {
    display: flex;
    flex: 1;
    min-height: 0; /* critical: prevents flex child from overflowing */
}

/* ── Top Bar ──────────────────────────────────────────────── */

.db-top-bar {
    background: var(--inverse-surface);
    color: var(--inverse-on-surface);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 rgba(195, 197, 217, 0.15);
    flex-shrink: 0;
}

.db-top-bar-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.db-logo {
    font-family: 'Manrope', sans-serif;
    font-size: 1.0rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--inverse-primary);
    line-height: 1;
    text-decoration: none;
}

.db-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--outline);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.db-support-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--inverse-on-surface);
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(195, 197, 217, 0.3);
    border-radius: 0.375rem;
    text-decoration: none;
    transition: border-color 200ms ease, color 200ms ease;
    white-space: nowrap;
}

.db-support-link:hover {
    border-color: var(--inverse-primary);
    color: var(--inverse-primary);
}

/* ── Sidebar ──────────────────────────────────────────────── */

.db-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(195, 197, 217, 0.15);
}

.db-sidebar-heading {
    padding: 1.5rem 1.2rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--on-surface-variant);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.db-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    color: var(--secondary);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: color 200ms ease, background 200ms ease, border-left-color 200ms ease, transform 200ms ease;
    user-select: none;
}

.db-nav-item:hover:not(.db-nav-item--soon) {
    background: var(--surface-container-low);
    transform: translateX(0.25rem);
}

.db-nav-item.active {
    color: var(--primary);
    background: rgba(0, 62, 199, 0.05);
    border-left-color: var(--primary);
    font-weight: 600;
}

.db-nav-item--soon {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.db-nav-icon {
    flex-shrink: 0;
    fill: currentColor;
}

.db-badge {
    margin-left: auto;
    font-size: 0.6rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
    color: var(--on-primary);
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.db-badge--active {
    background: var(--primary);
}

.db-badge--soon {
    background: var(--surface-container-high);
    color: var(--on-surface-variant);
}

.db-sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(195, 197, 217, 0.15);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--on-surface-variant);
    letter-spacing: 0.03em;
}

.db-sidebar-footer a {
    color: var(--primary);
    text-decoration: none;
    display: block;
    margin-top: 0.3rem;
    transition: color 200ms ease;
}

.db-sidebar-footer a:hover {
    color: var(--on-primary-fixed-variant);
}

/* ── Mobile Tab Bar ───────────────────────────────────────── */

.db-tab-bar {
    display: none; /* shown via media query */
    overflow-x: auto;
    background: var(--surface-container-high);
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.db-tab-bar::-webkit-scrollbar {
    display: none;
}

.db-tab-bar .db-nav-item {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    border-radius: 5px;
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.db-tab-bar .db-nav-item.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 62, 199, 0.05);
    border-left: none;
}

.db-tab-bar .db-nav-icon {
    display: none; /* hide icons in tab bar — labels only */
}

.db-tab-bar .db-badge {
    display: none; /* hide badges in tab bar */
}

/* ── Main Content Area ────────────────────────────────────── */

.db-main {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    background: var(--surface-container-low);
}

.db-main-header {
    margin-bottom: 2rem;
}

.db-main-header h1 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--on-surface);
    margin-bottom: 0.35rem;
}

.db-main-header p {
    color: var(--secondary);
    font-size: 1rem;
}

/* ── Service Panel ────────────────────────────────────────── */

.db-service-panel {
    max-width: 680px;
}

.db-card {
    background: var(--surface-container-lowest);
    border-radius: 0.5rem;
    box-shadow: none;
    border: 1px solid rgba(195, 197, 217, 0.15);
    overflow: hidden;
    transition: box-shadow 200ms ease;
}

.db-card:hover {
    box-shadow: 0 12px 40px rgba(28, 27, 27, 0.06);
}

.db-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.db-card-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.db-card-icon svg {
    fill: #ffffff;
}

.db-card-title {
    flex: 1;
    min-width: 0;
}

.db-card-title h2 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.db-card-title p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.db-status-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.db-status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    animation: db-pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes db-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.db-card-body {
    padding: 2rem;
}

.db-card-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ── Coming Soon Section ──────────────────────────────────── */

.db-coming-soon {
    margin-top: 2.5rem;
    max-width: 680px;
}

.db-coming-soon-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--on-surface-variant);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}

.db-coming-soon-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(195, 197, 217, 0.3);
}

.db-coming-soon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.db-coming-soon-card {
    background: var(--surface-container);
    border: 1px dashed rgba(195, 197, 217, 0.4);
    border-radius: 0.5rem;
    padding: 1.5rem;
    opacity: 0.6;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.db-coming-soon-card .db-cs-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
    display: block;
}

.db-coming-soon-card h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.db-coming-soon-card p {
    font-size: 0.75rem;
    color: var(--secondary);
    line-height: 1.4;
}

/* ── Feature List ─────────────────────────────────────────── */

.db-feature-list {
    list-style: none;
    padding: 0;
    margin-bottom: 0;
}

.db-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--on-surface);
}

.db-feature-list li::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .db-sidebar {
        display: none;
    }

    .db-tab-bar {
        display: flex;
    }

    .db-layout {
        flex-direction: column;
    }

    .db-main {
        padding: 1.5rem 1rem;
    }

    .db-card-header {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1.25rem;
    }

    .db-status-badge {
        margin-left: 0;
    }

    .db-card-body {
        padding: 1.25rem;
    }

    .db-main-header h1 {
        font-size: 1.25rem;
    }

    .db-card-title h2 {
        font-size: 0.95rem;
    }

    .db-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .db-card-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .db-top-bar {
        padding: 0.6rem 1rem;
    }

    .db-logo {
        font-size: 0.95rem;
    }

    .db-support-link {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
    }
}
