/* static/css/apps-list.css
   Theme-friendly + consistent with layout/theme variables
*/

/* page header */
.title { margin: 0 0 6px; color: var(--text, #111); }
.subtitle { margin: 0; color: var(--muted, #666); }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

/* card (consistent) */
.card {
    background: var(--card, #fff);
    color: var(--text, #111);
    border: 1px solid var(--border, rgba(0,0,0,0.10));
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

/* buttons (keep consistent with rest of app) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid var(--border, rgba(0,0,0,0.12));
    cursor: pointer;
    background: transparent;
    color: var(--text, #111);
    white-space: nowrap;
    transition: transform 120ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
    background: var(--text, #111);
    color: var(--card, #fff);
}

.btn.ghost {
    background: transparent;
}

.btn.danger {
    border-color: rgba(220, 38, 38, 0.55);
    background: rgba(220, 38, 38, 0.12);
    color: rgb(185, 28, 28);
}

/* Banner */
.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.banner-title {
    font-weight: 900;
    margin-bottom: 2px;
}

.banner-sub {
    color: var(--muted, #666);
}

.banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stat {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border, rgba(0,0,0,0.10));
    background: rgba(127,127,127,0.06);
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted, #666);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 900;
    margin-top: 4px;
}

/* Filters */
.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text, #111);
}

.field input,
.field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(0,0,0,0.15));
    background: var(--card, #fff);
    color: var(--text, #111);
    box-sizing: border-box;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

/* Empty */
.empty {
    text-align: center;
    padding: 28px 16px;
}

.empty-title {
    font-weight: 900;
    margin-bottom: 6px;
    color: var(--text, #111);
}

.empty-sub {
    color: var(--muted, #666);
    margin-bottom: 14px;
}

/* List */
.list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.app-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.app-main { min-width: 0; }

.app-title {
    min-width: 0;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.company, .role {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dot { opacity: 0.4; }

.app-meta { margin-top: 8px; }

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 0.8rem;
    border: 1px solid var(--border, rgba(0,0,0,0.12));
    background: rgba(127,127,127,0.08);
}

.app-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Dark theme tweaks */
body.theme-dark .card {
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

body.theme-dark .btn.primary {
    background: #f2f2f2;
    color: #111;
}

body.theme-dark .btn.danger {
    background: rgba(255, 80, 110, 0.12);
    border-color: rgba(255, 80, 110, 0.25);
    color: #ff8aa0;
}

/* Responsive */
@media (max-width: 960px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: 1fr; }
    .filter-actions { justify-content: flex-start; }
    .page-header { flex-direction: column; align-items: stretch; }
    .app-row { flex-direction: column; align-items: stretch; }
    .app-actions { justify-content: flex-start; flex-wrap: wrap; }
}