* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}
body {
    background: #f8f9fa;
    color: #1f2937;
    min-height: 100vh;
}
a {
    color: #2563eb;
    text-decoration: none;
}

/* AUTH SCREEN (login) */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 75% 15%, rgba(37, 99, 235, 0.08), transparent 50%),
        radial-gradient(circle at 10% 85%, rgba(124, 58, 237, 0.07), transparent 50%);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(17, 24, 39, 0.08);
}
.auth-logo {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}
.auth-sub {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 28px;
}
.field {
    margin-bottom: 18px;
}
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    transition: 0.2s;
}
.field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
}
.draft-image-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0 0;
}
.draft-video-note {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #2563eb;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
}
.btn-block {
    width: 100%;
    padding: 13px 0;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.btn-block:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
.auth-back {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #9ca3af;
}
.auth-back:hover {
    color: #6b7280;
}

/* APP SHELL */
.app-shell {
    display: flex;
    min-height: 100vh;
}
.app-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #111827;
    color: #e5e7eb;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}
.app-logo {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 32px;
    letter-spacing: -0.3px;
}
.app-logo span {
    background: linear-gradient(90deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.app-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.app-nav a {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 8px;
    transition: 0.2s;
}
.app-nav a.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.app-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.app-logout {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}
.app-logout:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.app-main {
    flex: 1;
    padding: 40px 48px;
    max-width: 1100px;
}
.app-main h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.app-main .page-sub {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 32px;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.stat-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 2px;
}
.stat-card .stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}
.chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.chart-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
    min-width: 0;
}
.chart-card h3 {
    font-size: 15px;
    color: #111827;
}
.chart-sub {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}
.chart-legend b {
    color: #111827;
    font-weight: 600;
}
.chart-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
}
.chart-wrap {
    position: relative;
    height: 360px;
}
.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}
.empty-panel {
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
}
.empty-panel h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}
.empty-panel p {
    color: #6b7280;
    font-size: 14px;
}

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}
.page-header .heading-group h1 {
    margin-bottom: 4px;
}
.page-header .heading-group .page-sub {
    margin-bottom: 0;
}
.btn-solid {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}
.btn-solid:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* PROJECT CARD GRID */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.project-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.project-card.is-archived {
    opacity: 0.6;
}
.project-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.project-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.project-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-card-title {
    flex: 1;
    min-width: 0;
}
.project-card-title h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-active {
    background: #ecfdf5;
    color: #059669;
}
.badge-archived {
    background: #f3f4f6;
    color: #6b7280;
}
.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
}
.project-card-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.chip-btn {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.15s;
}
.chip-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.chip-btn.chip-danger {
    color: #b91c1c;
}
.chip-btn.chip-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}
.chip-btn.chip-primary {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border: none;
    color: #fff;
    font-weight: 600;
}
.chip-btn.chip-primary:hover {
    opacity: 0.92;
}
.chip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.sync-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.sync-badge.sync-fresh {
    background: #ecfdf5;
    color: #059669;
}
.sync-badge.sync-stale {
    background: #fef3c7;
    color: #92400e;
    cursor: help;
}
.sync-badge.sync-unavailable {
    background: #f3f4f6;
    color: #9ca3af;
}

/* DRAWER (create/edit project) */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    display: flex;
    justify-content: flex-end;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.drawer-panel {
    width: 100%;
    max-width: 520px;
    background: #f8f9fa;
    height: 100%;
    overflow-y: auto;
    padding: 32px;
    transform: translateX(24px);
    transition: transform 0.2s;
}
.drawer-overlay.open .drawer-panel {
    transform: translateX(0);
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.drawer-header h2 {
    font-size: 20px;
    margin-bottom: 0;
}
.drawer-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
}
.drawer-close:hover {
    color: #111827;
}
.form-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 24px 0 12px;
}
.form-section-title:first-of-type {
    margin-top: 0;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    resize: vertical;
    min-height: 70px;
    transition: 0.2s;
}
.field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field .hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
}
.drawer-footer {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}
.drawer-footer .btn-solid {
    flex: 1;
    justify-content: center;
}
.btn-cancel {
    flex: 0 0 auto;
    padding: 12px 20px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.btn-cancel:hover {
    background: #f9fafb;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}
.filter-bar select,
.filter-bar input {
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    color: #374151;
    background: #fff;
}
.filter-bar input {
    flex: 1;
    min-width: 220px;
}
.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: #2563eb;
}

/* DRAFT LIST */
.draft-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.draft-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}
.draft-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.badge-platform {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}
.draft-project {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.draft-date {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
}
.draft-headline {
    font-size: 16px;
    margin-bottom: 6px;
}
.draft-caption {
    font-size: 13px;
    color: #4b5563;
    white-space: pre-wrap;
    margin-bottom: 10px;
}
.hashtag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.hashtag-chip {
    font-size: 12px;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
}
.draft-image {
    display: block;
    max-width: 280px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* NEWS SOURCES (project edit drawer) */
.source-list {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}
.source-item-label {
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.source-item-empty {
    font-size: 13px;
    color: #9ca3af;
    list-style: none;
    padding: 4px 0;
}
.source-add-row {
    display: flex;
    gap: 8px;
}
.source-add-row input,
.source-add-row select {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
}

/* HISTORY / CRON LOG */
.cron-log-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cron-log-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}
.cron-log-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.cron-log-date {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
}
.cron-log-empty {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}
.cron-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cron-log-table td {
    padding: 8px 10px;
    border-top: 1px solid #f3f4f6;
    color: #374151;
}
.cron-log-table tr:first-child td {
    border-top: none;
}

/* DASHBOARD (v2): layered cards, headline figures, per-app table */
body.is-dashboard {
    background: #f3f5f8;
}
.db-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 40px 56px;
}
.db-main .num,
.db-main td.num {
    font-variant-numeric: tabular-nums;
}
.db-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.db-title h1 {
    font-size: 26px;
    letter-spacing: -0.4px;
}
.db-finding {
    font-size: 15px;
    color: #374151;
    margin-top: 2px;
}
.db-finding b {
    color: #157347;
    font-weight: 600;
}
.db-fresh {
    font-size: 12px;
    color: #5f6672;
    background: #fff;
    border: 1px solid #e3e7ec;
    border-radius: 999px;
    padding: 6px 12px 6px 26px;
    position: relative;
}
.db-fresh:empty {
    display: none;
}
.db-fresh::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    border-radius: 50%;
    background: #22a06b;
    box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.18);
}

/* Elevation: one soft, layered shadow on resting cards, nothing louder. */
.db-kpis,
.db-card {
    background: #fff;
    border: 1px solid #e3e7ec;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px -8px rgba(16, 24, 40, 0.08);
}

/* Headline figures: one card, four cells split by hairlines. */
.db-kpis {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
    margin-bottom: 16px;
    overflow: hidden;
}
.db-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 24px 22px;
    border-left: 1px solid #edf0f3;
    min-width: 0;
}
.db-kpi:first-child {
    border-left: none;
}
.db-kpi-lead {
    background: #111827;
    color: #fff;
}
.db-kpi-label {
    font-size: 13px;
    font-weight: 500;
    color: #5f6672;
}
.db-kpi-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #111827;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.db-kpi-lead .db-kpi-label {
    color: #b8c0cc;
}
.db-kpi-lead .db-kpi-value {
    font-size: 34px;
    color: #fff;
}
.db-kpi-lead .db-kpi-sub {
    color: #b8c0cc;
}
.db-kpi-sub {
    font-size: 12px;
    color: #5f6672;
}
.db-kpi-sub b {
    font-weight: 600;
}
.db-up {
    color: #157347;
}
.db-down {
    color: #c4242a;
}
.db-skel {
    display: inline-block;
    width: 96px;
    height: 0.9em;
    border-radius: 6px;
    background: #eceff3;
    vertical-align: middle;
}
.db-kpi-lead .db-skel {
    background: rgba(255, 255, 255, 0.12);
}

/* Card grid: five columns, 16px gutters; revenue takes 3, by-app 2. */
.db-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}
.db-span-2 {
    grid-column: span 3;
}
.db-span-side {
    grid-column: span 2;
}
.db-span-3 {
    grid-column: 1 / -1;
}
.db-card {
    padding: 20px 22px 18px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.db-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.db-card h2 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}
.db-card-sub {
    font-size: 13px;
    color: #5f6672;
}
.db-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12px;
    color: #4b5563;
    padding-top: 4px;
}
.db-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.db-legend i,
.db-app i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.db-legend-row {
    margin: -4px 0 10px;
}
.db-chart {
    position: relative;
    flex: 1;
}
.db-chart-rev {
    min-height: 280px;
}
.db-chart-growth {
    flex: none;
    height: 340px;
}

/* Segmented controls on the growth card. */
.db-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.db-seg {
    display: inline-flex;
    background: #f1f3f6;
    border-radius: 10px;
    padding: 3px;
}
.db-seg button {
    border: none;
    background: none;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.db-seg button:hover {
    color: #111827;
}
.db-seg button[aria-pressed="true"] {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}
.db-seg button:focus-visible {
    outline: 2px solid #2a78d6;
    outline-offset: 1px;
}

/* By-app card. */
.db-share {
    display: flex;
    gap: 2px;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef1f4;
    margin-bottom: 14px;
}
.db-share span {
    display: block;
    height: 100%;
}
.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.db-table th {
    font-size: 12px;
    font-weight: 500;
    color: #5f6672;
    text-align: left;
    padding: 0 0 8px;
}
.db-table th.num,
.db-table td.num {
    text-align: right;
    padding-left: 8px;
    white-space: nowrap;
}
.db-table td {
    padding: 11px 0;
    border-top: 1px solid #f0f2f5;
    color: #111827;
    vertical-align: top;
}
.db-table tbody tr:not(.db-total):hover td {
    background: #f8fafc;
}
.db-app {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.db-share-pct {
    display: block;
    font-size: 12px;
    color: #5f6672;
    padding-left: 16px;
}
.db-total td {
    font-weight: 600;
    border-top: 1px solid #dfe3e8;
}
.db-muted {
    color: #6b7280;
}

/* Keeping users card. */
.db-kept-lead {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 12px;
}
.db-kept-lead .num {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-right: 4px;
}
.db-note {
    font-size: 12px;
    color: #5f6672;
    margin-top: auto;
    padding-top: 12px;
}

/* Content card. */
.db-link {
    font-size: 13px;
    font-weight: 500;
}
.db-content-body {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 2fr;
    gap: 16px;
}
.db-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f6f8fa;
    border-radius: 12px;
    align-self: start;
}
.db-mini div {
    padding: 14px 16px;
}
.db-mini dt {
    font-size: 12px;
    color: #5f6672;
}
.db-mini dd {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}
.db-projects {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.db-projects a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #edf0f3;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.db-projects a:hover {
    border-color: #d5dbe3;
    background: #f8fafc;
}
.db-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.db-proj-text {
    min-width: 0;
}
.db-proj-text b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.db-proj-text small {
    display: block;
    font-size: 12px;
    color: #5f6672;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-empty {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #5f6672;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
}

@media (max-width: 1100px) {
    .db-kpis {
        grid-template-columns: 1fr 1fr;
    }
    .db-kpi:nth-child(3) {
        border-left: none;
    }
    .db-kpi:nth-child(n + 3) {
        border-top: 1px solid #edf0f3;
    }
    .db-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .db-span-2,
    .db-span-3,
    .db-span-side {
        grid-column: auto;
    }
    .db-content-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Phone: the sidebar folds into a top bar with a scrolling nav row. */
@media (max-width: 760px) {
    .app-shell {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 12px;
        padding: 12px 16px;
    }
    .app-logo {
        margin-bottom: 0;
        flex: 1;
    }
    .app-nav {
        order: 3;
        flex: 0 0 100%;
        flex-direction: row;
        overflow-x: auto;
        gap: 2px;
    }
    .app-nav a {
        white-space: nowrap;
        padding: 8px 12px;
    }
    .app-logout {
        padding: 6px 10px;
    }
    .app-main,
    .db-main {
        padding: 20px 16px 40px;
    }
    .db-title h1 {
        font-size: 22px;
    }
    .db-kpi {
        padding: 16px;
    }
    .db-kpi-value {
        font-size: 22px;
    }
    .db-kpi-lead .db-kpi-value {
        font-size: 26px;
    }
    .db-card {
        padding: 16px;
    }
    .db-chart-growth {
        height: 240px;
    }
    .db-chart-rev {
        min-height: 240px;
    }
    .db-mini dd {
        font-size: 18px;
    }
}
