:root {
    --db-accent: #ffc107;
    --db-dark: #2a2a2a;
    --db-soft: #f7f7f5;
    --db-border: #e4e4df;
    --db-muted: #707070;
}

.surface-list-body {
    background: #fbfbfa;
}

.surface-list-page {
    background: #fbfbfa;
}

.surface-list-container {
    max-width: 1240px;
}

.database-header {
    align-items: center;
    background: #fff;
    border: 1px solid var(--db-border);
    border-radius: 0.9rem;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    padding: 1.75rem;
}

.database-back {
    color: #606060;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.database-back:hover {
    color: #8a6500;
}

.database-kicker,
.surface-card-label {
    color: #8a6500;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.database-description {
    color: var(--db-muted);
    font-size: 1rem;
}

.surface-count {
    align-items: center;
    background: var(--db-dark);
    border: 1px solid #3f3f3f;
    border-radius: 0.75rem;
    color: #fff;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    min-height: 92px;
    min-width: 112px;
    padding: 0.75rem 1rem;
}

.surface-count strong {
    color: var(--db-accent);
    font-size: 2rem;
    line-height: 1;
}

.surface-count span {
    color: #bcbcbc;
    font-size: 0.76rem;
    margin-top: 0.35rem;
}

.database-content-card {
    background: #fff;
    border: 1px solid var(--db-border);
    border-radius: 0.8rem;
    box-shadow: 0 0.4rem 1.25rem rgba(42, 42, 42, 0.05);
    margin-top: 1.75rem;
    overflow: hidden;
}

.database-toolbar {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    border-bottom: 1px solid var(--db-border);
    padding: 1.25rem 1.5rem;
}

.view-switcher {
    background: #ecece8;
    border: 1px solid var(--db-border);
    border-radius: 0.6rem;
    display: flex;
    padding: 0.25rem;
}

.view-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.4rem;
    color: #686868;
    display: flex;
    font-size: 0.82rem;
    font-weight: 650;
    gap: 0.45rem;
    padding: 0.48rem 0.7rem;
}

.view-button.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(42, 42, 42, 0.12);
    color: var(--db-dark);
}

.grid-icon {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(2, 4px);
}

.grid-icon i {
    border: 1px solid currentColor;
    height: 4px;
    width: 4px;
}

.list-icon {
    display: grid;
    gap: 2px;
}

.list-icon i {
    border-top: 1px solid currentColor;
    display: block;
    width: 11px;
}

.cards-view,
.table-view {
    padding: 1.5rem;
}

.surface-card {
    background: #fff;
    border: 1px solid var(--db-border);
    border-radius: 0.8rem;
    box-shadow: 0 0.4rem 1.25rem rgba(42, 42, 42, 0.05);
    overflow: hidden;
    transition: box-shadow 160ms ease, transform 160ms ease;
}

.surface-card:hover {
    box-shadow: 0 0.9rem 2rem rgba(42, 42, 42, 0.1);
    transform: translateY(-3px);
}

.surface-preview {
    background: var(--db-soft);
    border-bottom: 1px solid var(--db-border);
    height: 230px;
}

.surface-card-body {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 1.25rem;
}

.surface-card-heading {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.surface-card-code,
.table-surface-code {
    background: var(--db-soft);
    border: 1px solid var(--db-border);
    border-radius: 999px;
    color: #555;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.55rem;
}

.surface-card-details {
    margin: 1.1rem 0 1.25rem;
}

.surface-card-details > div {
    border-bottom: 1px solid #ecece8;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 42% 1fr;
    padding: 0.48rem 0;
}

.surface-card-details dt {
    color: var(--db-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.surface-card-details dd {
    font-size: 0.82rem;
    font-weight: 650;
    margin: 0;
    overflow-wrap: anywhere;
}

.surface-card-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: auto;
}

.surface-card-footer > span {
    color: #888;
    font-size: 0.74rem;
}

.surface-view-link {
    color: #745600;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.surface-view-link:hover {
    color: #3d2e00;
}

.database-table-wrap {
    background: #fff;
    overflow-x: auto;
}

.table-view {
    padding: 0;
}

.database-table {
    border-collapse: collapse;
    min-width: 800px;
    width: 100%;
}

.database-table th {
    background: var(--db-dark);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    padding: 0.95rem 1rem;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.database-table td {
    border-bottom: 1px solid #ecece8;
    color: #4e4e4e;
    font-size: 0.88rem;
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.database-table tbody tr:last-child td {
    border-bottom: 0;
}

.database-table tbody tr:hover {
    background: #fffaf0;
}

.table-surface-link {
    align-items: center;
    color: var(--db-dark);
    display: flex;
    font-weight: 700;
    gap: 0.6rem;
    text-decoration: none;
}

.table-surface-code {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
}

.table-action {
    text-align: right;
}

.table-action a {
    align-items: center;
    background: var(--db-accent);
    border-radius: 50%;
    color: #211700;
    display: inline-flex;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    text-decoration: none;
    width: 30px;
}

.empty-state {
    color: var(--db-muted);
    padding: 2.5rem;
    text-align: center;
}

[hidden] {
    display: none !important;
}

@media (max-width: 767.98px) {
    .database-header,
    .database-toolbar {
        align-items: flex-start;
    }

    .database-header {
        padding: 1.25rem;
    }

    .database-header .display-5 {
        font-size: 2.15rem;
    }

    .surface-count {
        min-height: 76px;
        min-width: 88px;
    }

    .surface-count strong {
        font-size: 1.6rem;
    }
}

@media (max-width: 575.98px) {
    .database-toolbar {
        flex-direction: column;
    }

    .view-switcher,
    .view-button {
        flex: 1;
    }

    .view-switcher {
        align-self: stretch;
    }

    .view-button {
        justify-content: center;
    }

    .surface-preview {
        height: 200px;
    }
}
