/* Lightweight admin UI built on the same palette and layout language as Andi. */

.admin-page {
    color: #0f172a;
}

.admin-heading,
.admin-detail-heading,
.admin-panel-heading,
.admin-plan-panel,
.admin-list-row,
.admin-navigation,
.admin-filters {
    display: flex;
    align-items: center;
}

.admin-heading,
.admin-detail-heading,
.admin-panel-heading,
.admin-plan-panel {
    justify-content: space-between;
    gap: 20px;
}

.admin-heading h1,
.admin-detail-heading h1 {
    margin: 2px 0 4px;
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.admin-heading p,
.admin-detail-heading p,
.admin-panel p,
.admin-list-row small {
    margin: 0;
    color: #64748b;
}

.admin-eyebrow {
    color: #2563eb !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.admin-navigation {
    gap: 6px;
    margin: 22px 0;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .04);
}

.admin-navigation a {
    padding: 9px 14px;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.admin-navigation a.is-active {
    background: #eff6ff;
    color: #2563eb;
}

.admin-stats,
.admin-grid,
.admin-info-grid {
    display: grid;
    gap: 16px;
}

.admin-stats {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 18px;
}

.admin-stat-card,
.admin-panel,
.admin-table-wrap,
.admin-info-grid > div {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.admin-stat-card {
    padding: 20px;
}

.admin-stat-card span,
.admin-info-grid span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.admin-stat-card strong {
    display: block;
    margin: 6px 0;
    font-size: 34px;
}

.admin-stat-card small {
    color: #94a3b8;
}

.admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-panel {
    margin-bottom: 18px;
    overflow: hidden;
}

.admin-panel-heading,
.admin-plan-panel {
    padding: 18px 20px;
}

.admin-panel-heading {
    border-bottom: 1px solid #f1f5f9;
}

.admin-panel h2 {
    margin: 0 0 3px;
    font-size: 18px;
}

.admin-panel-heading a,
.admin-table a,
.admin-back {
    color: #2563eb;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.admin-list-row {
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    padding: 13px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a;
    text-decoration: none;
}

.admin-list-row:last-child {
    border-bottom: 0;
}

.admin-list-row > span:first-child,
.admin-table td:first-child {
    min-width: 0;
}

.admin-list-row strong,
.admin-list-row small,
.admin-table strong,
.admin-table small {
    display: block;
}

.admin-list-row small,
.admin-table small {
    margin-top: 3px;
    font-size: 12px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-badge-pro {
    background: #dcfce7;
    color: #15803d;
}

.admin-badge-free {
    background: #f1f5f9;
    color: #64748b;
}

.admin-filters {
    gap: 10px;
    margin-bottom: 16px;
}

.admin-filters input[type="search"],
.admin-filters select {
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.admin-filters input[type="search"] {
    min-width: 260px;
    flex: 1;
}

.admin-filters input[type="submit"],
.admin-button-primary,
.admin-button-secondary {
    min-height: 44px;
    padding: 0 17px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.admin-button-primary,
.admin-filters input[type="submit"] {
    display: inline-flex;
    align-items: center;
    background: #2563eb;
    color: #fff;
}

.admin-button-secondary {
    background: #f1f5f9;
    color: #475569;
}

.admin-filters > a {
    color: #64748b;
    font-size: 13px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: #64748b;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.admin-detail-heading {
    margin: 14px 0 20px;
}

.admin-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.admin-info-grid > div {
    padding: 16px;
}

.admin-info-grid strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.admin-definition-list {
    margin: 0;
    padding: 8px 20px 14px;
}

.admin-definition-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}

.admin-definition-list dt {
    color: #64748b;
}

.admin-definition-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.admin-empty {
    padding: 24px 20px;
    color: #94a3b8;
    text-align: center;
}

@media (max-width: 760px) {
    .admin-area header {
        align-items: flex-start;
    }

    .admin-area header nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .admin-stats,
    .admin-grid,
    .admin-info-grid {
        grid-template-columns: 1fr;
    }

    .admin-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-filters input[type="search"] {
        width: 100%;
        min-width: 0;
    }

    .admin-detail-heading,
    .admin-plan-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}
