/* Global look following revolvermaenner.com: monochrome, square, uppercase accents */
body { background: #f4f4f4; color: #333333; }

.app-drawer-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid #e0e0e0; }
.app-drawer-logo { width: 56px; height: 56px; flex: none; }
.app-brand { text-transform: uppercase; letter-spacing: 0.12em; line-height: 1.2; }

.mud-drawer { border-right: 1px solid #e0e0e0; }
.app-nav-group { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.7rem; color: #666666; }
.mud-nav-link { border-left: 3px solid transparent; border-radius: 0; }
.mud-nav-link.active:not(.mud-nav-link-disabled) { border-left-color: #173145; background-color: #ececec; color: #000000; }
.mud-nav-link.active:not(.mud-nav-link-disabled) .mud-icon-root { color: #000000; }

.mud-paper, .mud-card { border-radius: 2px !important; }
.mud-paper.mud-elevation-0, .mud-card { border: 1px solid #e0e0e0; }
.mud-paper:not(.mud-elevation-0), .mud-card { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }

.mud-button-filled, .mud-button-outlined { border-radius: 0; box-shadow: none; }
.mud-button-filled.mud-button-filled-primary:hover { background-color: #0d1c29; }
.mud-input-outlined-border { border-radius: 0 !important; }
.mud-chip { border-radius: 2px; }

.mud-table-head .mud-table-cell { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; background: #fafafa; }
.mud-main-content h1, .mud-main-content h2 { letter-spacing: 0.02em; }

/* Dashboard rankings: compact, ranked list per portal count */
.ranking-group { border-left: 4px solid var(--ranking-color); background: #fafafa; }
.ranking-group-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--ranking-color); color: #ffffff; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; }
.ranking-group-caption { font-weight: 400; opacity: 0.85; }
.ranking-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 12px; font-size: 0.85rem; border-bottom: 1px solid #ececec; }
.ranking-row:nth-child(even) { background: #ffffff; }
.ranking-rank { width: 1.2rem; color: #999999; font-size: 0.75rem; text-align: right; }
.ranking-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-score { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Drawer: legal footer pinned to the bottom */
.mud-drawer-content { display: flex; flex-direction: column; overflow: hidden; }
.mud-drawer-content > .mud-navmenu { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.mud-drawer-header { flex: none; }
.app-drawer-footer { flex: none; margin-top: auto; padding: 16px; border-top: 1px solid #e0e0e0; font-size: 0.75rem; color: #666666; line-height: 1.6; }
.app-drawer-footer a { color: inherit; }
.app-drawer-footer .legal-links { margin-top: 4px; }

/* Evaluations */
.eval-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.eval-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 24px; }
@media (min-width: 900px) { .eval-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1500px) { .eval-grid { grid-template-columns: repeat(3, 1fr); } }
.eval-card { padding: 24px; border: 1px solid #e0e0e0; }
.eval-card-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid #ececec; }
.eval-card-total { color: #666666; font-size: 0.85rem; white-space: nowrap; }
.eval-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.eval-stat { padding-top: 10px; border-top: 3px solid #999999; text-align: center; }
.eval-stat-value { font-size: 1.5rem; font-weight: 700; color: #173145; line-height: 1.2; }
.eval-stat-label { font-size: 0.8rem; color: #666666; }
.eval-stat-label span { opacity: 0.7; }

/* Admin data grids: scroll horizontally on small screens instead of squeezing columns */
.data-grid .mud-table-container { overflow-x: auto; }
.data-grid .mud-table-root { min-width: 100%; }
.data-grid .mud-table-head .mud-table-cell { white-space: nowrap; }
.data-grid .mud-table-toolbar { height: auto; min-height: 64px; padding: 12px 16px; }
.cell-ellipsis { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* Keep the action column visible while scrolling horizontally */
.data-grid-sticky-actions tbody tr { background-color: #ffffff; }
.data-grid-sticky-actions .mud-table-cell:last-child { position: sticky; right: 0; background-color: inherit; box-shadow: -6px 0 6px -6px rgba(0, 0, 0, 0.18); z-index: 1; }
.data-grid-sticky-actions thead .mud-table-cell:last-child { background-color: #fafafa; z-index: 3; }

.grid-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; width: 100%; }
.grid-toolbar-search { flex: 1 1 280px; max-width: 420px; margin-top: 0; }
.grid-toolbar-count { white-space: nowrap; }

/* Google Places search row */
.places-search { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 16px; align-items: start; }
.places-search-button { height: 56px; padding: 0 28px; }
.places-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 16px; align-items: start; }
.places-actions .places-add-button { height: 56px; padding: 0 28px; white-space: nowrap; }
@media (max-width: 900px) {
    .places-search { grid-template-columns: minmax(0, 1fr) 120px; }
    .places-search-button { grid-column: 1 / -1; }
    .places-actions { grid-template-columns: 1fr; }
}

/* Top bar with menu button only below the permanent-drawer breakpoint (1280px) */
@media (min-width: 1280px) { .app-mobile-bar { display: none !important; } }

/* Grids size to their rows and only scroll once they exceed the available viewport height */
.data-grid-fit .mud-table-container { max-height: calc(100vh - 400px); min-height: 160px; overflow: auto; }
.data-grid-fit-places .mud-table-container { max-height: calc(100vh - 560px); min-height: 200px; }
.grid-toolbar-select { flex: 0 0 200px; margin-top: 0; }
.data-grid .mud-table-pagination { border-top: 1px solid #ececec; }
