:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface2: #243044;
    --text: #e8eef7;
    --muted: #8b9cb3;
    --accent: #3d9cf5;
    --accent2: #5ce1a3;
    --danger: #f05d5d;
    --border: #2d3a4f;
    --radius: 10px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    --font-ar: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

body.locale-rtl {
    font-family: var(--font-ar);
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Keyboard accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(61, 156, 245, 0.65);
    outline-offset: 3px;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header,
.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, rgba(26, 35, 50, 0.98), rgba(26, 35, 50, 0.94));
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    min-height: 44px;
    min-width: 44px;
    padding: 0.45rem 0.6rem;
}

.nav-toggle-icon {
    display: block;
    width: 18px;
    height: 12px;
    position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
}

.nav-toggle-icon::before {
    top: 0;
    box-shadow: 0 5px 0 0 var(--text);
}
.nav-toggle-icon::after {
    bottom: 0;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 50;
}

.drawer {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
}

.drawer-panel {
    pointer-events: auto;
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(320px, 86vw);
    background: var(--surface);
    border-inline-start: 1px solid var(--border);
    padding: 1rem;
    overflow: auto;
    transform: translateX(-102%);
    transition: transform 160ms ease;
}

html[dir="rtl"] .drawer-panel {
    transform: translateX(102%);
    border-inline-start: none;
    border-inline-end: 1px solid var(--border);
}

body.is-drawer-open .drawer-panel {
    transform: translateX(0);
}

body.is-drawer-open {
    overflow: hidden;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.drawer-logo {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.drawer-close {
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    min-height: 44px;
    min-width: 44px;
    font-size: 1.4rem;
    line-height: 1;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

html[dir="rtl"] .drawer-nav {
    align-items: flex-end;
}

.drawer-nav a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0.35rem 0.2rem;
    color: var(--accent);
}

.drawer-nav a:hover {
    text-decoration: none;
    color: var(--text);
}

.drawer-logout {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    margin-top: 0.5rem;
}

.drawer-lang {
    margin-top: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
}

html[dir="rtl"] .drawer-lang {
    justify-content: flex-end;
}

.drawer-lang a {
    width: auto;
    min-height: auto;
    padding: 0.2rem 0;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
}

.drawer-lang a.is-active {
    color: var(--accent);
    font-weight: 600;
}

.drawer-lang a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.drawer-lang .lang-switch-sep {
    color: var(--border);
    user-select: none;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: 0.2px;
}

.nav-main,
.nav-admin {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
}

.nav-main a,
.nav-admin a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav-main a:hover,
.nav-admin a:hover {
    text-decoration: none;
    color: var(--text);
    background: rgba(36, 48, 68, 0.55);
}

.nav-admin a.is-active {
    color: var(--text);
    background: rgba(61, 156, 245, 0.16);
    border-color: rgba(61, 156, 245, 0.28);
}

.nav-admin a.is-active:hover {
    background: rgba(61, 156, 245, 0.22);
    border-color: rgba(61, 156, 245, 0.4);
}

.nav-main a:focus-visible,
.nav-admin a:focus-visible {
    outline: 2px solid rgba(61, 156, 245, 0.65);
    outline-offset: 3px;
}

.nav-main a.nav-admin {
    color: var(--accent);
    border: 1px solid rgba(61, 156, 245, 0.35);
}

.admin-header .nav-admin {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
    mask-image: none;
}

.drawer-nav a.is-active {
    color: var(--text);
    text-decoration: none;
    background: rgba(61, 156, 245, 0.12);
    border-radius: 10px;
    padding-inline: 0.5rem;
}

.nav-admin .inline-form {
    margin: 0;
}

.nav-admin .btn-ghost {
    padding: 0.35rem 0.75rem;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    margin-inline-start: 0.25rem;
}

.lang-switch a {
    color: var(--muted);
    text-decoration: none;
}

.lang-switch a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.lang-switch a.is-active {
    color: var(--accent);
    font-weight: 600;
}

.lang-switch-sep {
    color: var(--border);
    user-select: none;
}

.admin-lang-switch {
    margin-inline-end: 0.5rem;
}

.breadcrumb-sep {
    margin: 0 0.35rem;
    color: var(--muted);
}

.main-content {
    padding: 2rem 0 3rem;
}

.narrow {
    max-width: 420px;
}

.lead {
    color: var(--muted);
    font-size: 1.05rem;
}

h1 {
    margin-top: 0;
    font-size: 1.75rem;
}

h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.1rem;
}

.home-title {
    margin: 0;
}

.section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.section-header h2 {
    margin-top: 0;
}

.section-header-link {
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.2rem 0.35rem;
    border-radius: 8px;
}
.section-header-link:hover {
    color: var(--text);
    text-decoration: underline;
}
.section-header-link:focus-visible {
    outline: 2px solid rgba(61, 156, 245, 0.65);
    outline-offset: 3px;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.alert-error {
    background: rgba(240, 93, 93, 0.12);
    border-color: rgba(240, 93, 93, 0.35);
}
.alert-success {
    background: rgba(92, 225, 163, 0.1);
    border-color: rgba(92, 225, 163, 0.35);
}

.card-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.card a {
    color: var(--text);
    font-weight: 600;
}

/* Services page */
.services-suggest-card {
    margin: 0 0 1rem;
    padding: 1.1rem;
    border-radius: calc(var(--radius) + 4px);
    background:
        radial-gradient(900px 260px at 25% 10%, rgba(61, 156, 245, 0.22), transparent 60%),
        radial-gradient(700px 240px at 85% 30%, rgba(92, 225, 163, 0.12), transparent 55%),
        var(--surface);
}

.services-suggest-card-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.services-suggest-card-copy {
    flex: 1 1 420px;
    min-width: min(520px, 100%);
}

.services-suggest-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
}

.services-suggest-card-subtitle {
    margin: 0;
}

.services-suggest-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

/* Home page */
.home-hero {
    background:
        radial-gradient(900px 260px at 25% 10%, rgba(61, 156, 245, 0.25), transparent 60%),
        radial-gradient(700px 240px at 85% 30%, rgba(92, 225, 163, 0.14), transparent 55%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 1.25rem;
}

.home-hero-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.home-hero-copy {
    flex: 1 1 420px;
    min-width: min(520px, 100%);
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-end;
}

.home-hero-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.home-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.home-section.section {
    margin-top: 0;
}

.card.card-link {
    padding: 0;
    overflow: hidden;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.card-link-a {
    display: block;
    padding: 1rem;
    color: var(--text);
    min-height: 44px;
}

.card.card-link:hover {
    transform: translateY(-1px);
    border-color: rgba(61, 156, 245, 0.35);
}

.card-link-a:hover {
    text-decoration: none;
}

.list-services-home .service-row {
    background: rgba(26, 35, 50, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}

.list-services-home .service-row:last-child {
    margin-bottom: 0;
}

.service-row-title {
    flex: 1 1 auto;
    min-width: min(280px, 100%);
}

.service-row-meta {
    flex: 0 1 auto;
}

.service-row-votes {
    margin-inline-start: auto;
    white-space: nowrap;
}

.list-services {
    list-style: none;
    padding: 0;
    margin: 0;
}
.list-services li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.list-services a {
    font-weight: 600;
    color: var(--text);
}

.vote-pill {
    font-size: 0.85rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
}
.vote-pill .up {
    color: var(--accent2);
    font-weight: 600;
}
.vote-pill .down {
    color: var(--danger);
    font-weight: 600;
}

.service-detail .vote-summary {
    display: flex;
    gap: 1rem;
    font-size: 1.1rem;
}
.service-detail .up {
    color: var(--accent2);
}
.service-detail .down {
    color: var(--danger);
}

.form-stack label,
.form-inline label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
}
.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.form-inline label {
    margin: 0;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    margin-top: 0.35rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font: inherit;
}

.file-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.35rem;
    padding: 0.6rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
}

.file-input input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-input-btn {
    padding: 0.45rem 0.9rem;
    border-color: rgba(61, 156, 245, 0.35);
}

.file-input-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(520px, 60vw);
}

.pwa-icon-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(36, 48, 68, 0.85), rgba(36, 48, 68, 0.6));
}

.pwa-icon-preview {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.pwa-icon-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.pwa-icon-remove {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.pwa-icon-remove input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.sort-label {
    margin-inline-start: 0.5rem;
    margin-inline-end: 0.5rem;
}

.form-break {
    display: none;
    flex-basis: 100%;
    height: 0;
}

.input-inline {
    width: auto !important;
    min-width: 8rem;
}
.input-inline.wide {
    min-width: 12rem;
}

.filters-row {
    flex-wrap: nowrap;
    gap: 0.5rem;
}
.filters-row .filter-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.filters-row .search-field {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.filters-row .search-field .search-clear {
    position: absolute;
    inset-inline-end: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}
.filters-row .search-field .search-clear:hover {
    border-color: var(--border);
    color: var(--text);
}
.filters-row .search-field.has-value .search-clear {
    display: inline-flex;
}
.filters-row .search-field input[type="text"] {
    padding-inline-end: 2.2rem;
}
.filters-row .search-btn {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font: inherit;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    margin-top: 0;
    line-height: 1.2;
}
.filters-row .search-btn:hover {
    border-color: rgba(61, 156, 245, 0.35);
}
.filters-row .filter-group + .filter-group {
    margin-inline-start: 1.25rem;
}
.filters-row input[type="text"],
.filters-row select {
    width: auto;
    margin-top: 0;
}
.filters-row .input-inline.wide {
    min-width: 10rem;
}
.filters-row input[type="text"].input-inline.wide {
    flex: 1 1 260px;
    min-width: 14rem;
}
.filters-row select.input-inline {
    flex: 0 0 auto;
}
.filters-row .filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    margin-top: 0;
}
.filters-row .filters-toggle input[type="checkbox"] {
    margin: 0;
}

.btn {
    display: inline-block;
    font: inherit;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    background: var(--surface2);
    color: var(--text);
}
.btn-primary {
    background: var(--accent);
    color: #061018;
    font-weight: 600;
}
.btn-up {
    background: rgba(92, 225, 163, 0.25);
    border-color: rgba(92, 225, 163, 0.45);
}
.btn-down {
    background: rgba(240, 93, 93, 0.2);
    border-color: rgba(240, 93, 93, 0.45);
}
.btn-danger {
    background: rgba(240, 93, 93, 0.25);
    border-color: rgba(240, 93, 93, 0.45);
}
.btn-success {
    background: rgba(92, 225, 163, 0.25);
    border-color: rgba(92, 225, 163, 0.45);
}
.btn-info {
    background: rgba(61, 156, 245, 0.25);
    border-color: rgba(61, 156, 245, 0.45);
}
.btn-warn {
    background: rgba(255, 199, 0, 0.25);
    border-color: rgba(255, 199, 0, 0.45);
}
.btn-ghost {
    background: transparent;
    border-color: var(--border);
}
.btn-small {
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
}

.inline-form {
    display: inline;
    margin-inline-end: 0.35rem;
}

/* Ensure filter forms keep flex layout (override inline-form) */
.inline-form.form-row {
    display: flex;
}

.filters-row + .card-grid {
    margin-top: 1rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}
.comment-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.layout-public {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.layout-admin {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.layout-admin .admin-main {
    flex: 1 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.stat-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.stat-card-link:hover {
    transform: translateY(-1px);
    border-color: rgba(61, 156, 245, 0.35);
}
.stat-card-link:focus-visible {
    outline: 2px solid rgba(61, 156, 245, 0.65);
    outline-offset: 3px;
}
.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table th,
.data-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th {
    text-align: start;
    background: var(--surface2);
    color: var(--muted);
    font-weight: 600;
}
.data-table tr:last-child td {
    border-bottom: none;
}

.data-table td.actions {
    white-space: nowrap;
    display: table-cell;
    vertical-align: middle;
    text-align: start;
    min-width: 260px;
}
.data-table td.actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.data-table td.actions .input-inline {
    margin-top: 0;
}
.data-table td.actions .btn {
    white-space: nowrap;
}
.data-table td.actions > button,
.data-table td.actions > form {
    margin: 0 0.15rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.actions form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.actions .inline-form {
    display: flex;
}

.actions .input-inline {
    margin-top: 0;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 1rem;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 38px;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    text-decoration: none;
}

.pagination a:hover {
    color: var(--text);
    border-color: rgba(61, 156, 245, 0.35);
    text-decoration: none;
}

.pagination a.is-active {
    background: rgba(61, 156, 245, 0.18);
    border-color: rgba(61, 156, 245, 0.45);
    color: var(--text);
    font-weight: 700;
}

.reaction-btn {
    border-color: rgba(139, 156, 179, 0.25);
}

.reaction-btn .reaction-emoji {
    margin-inline-end: 0.35rem;
}

.reaction-like {
    border-color: rgba(61, 156, 245, 0.35);
    background: rgba(61, 156, 245, 0.10);
}

.reaction-dislike {
    border-color: rgba(240, 93, 93, 0.40);
    background: rgba(240, 93, 93, 0.10);
}

.reaction-celebrate {
    border-color: rgba(255, 199, 0, 0.40);
    background: rgba(255, 199, 0, 0.10);
}

.reaction-support {
    border-color: rgba(92, 225, 163, 0.40);
    background: rgba(92, 225, 163, 0.10);
}

.reaction-love {
    border-color: rgba(255, 92, 179, 0.45);
    background: rgba(255, 92, 179, 0.10);
}

.reaction-btn:hover:not(:disabled) {
    filter: brightness(1.08);
}

.reaction-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cell-text {
    max-width: 280px;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: var(--surface2);
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Vote badges (admin tables) */
.vote-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface2);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.vote-badge-up {
    color: var(--accent2);
    border-color: rgba(92, 225, 163, 0.45);
    background: rgba(92, 225, 163, 0.10);
}
.vote-badge-down {
    color: var(--danger);
    border-color: rgba(240, 93, 93, 0.45);
    background: rgba(240, 93, 93, 0.10);
}
.vote-badge-total {
    color: var(--muted);
}

/* Admin vote detail coloring (scoped) */
.votes-title-up {
    color: var(--accent2);
}
.votes-title-down {
    color: var(--danger);
}

.data-table.votes-up thead th {
    background: rgba(92, 225, 163, 0.10);
    color: var(--accent2);
}
.data-table.votes-down thead th {
    background: rgba(240, 93, 93, 0.10);
    color: var(--danger);
}

.data-table.votes-up tbody tr:nth-child(even) td {
    background: rgba(92, 225, 163, 0.04);
}
.data-table.votes-down tbody tr:nth-child(even) td {
    background: rgba(240, 93, 93, 0.04);
}

.breadcrumb {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-inner {
        flex-direction: row;
        align-items: center;
    }

    .nav-main[data-desktop-nav],
    .nav-admin[data-desktop-nav] {
        display: none;
    }
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-break {
        display: block;
    }

    .filters-row {
        flex-wrap: wrap;
    }
    .filters-row .filter-group + .filter-group {
        margin-inline-start: 0;
    }
    .filters-row .filter-group {
        flex-wrap: wrap;
    }
    .filters-row .search-btn {
        flex: 1 0 100%;
        width: 100%;
        justify-content: center;
        margin-top: 0.4rem;
    }

    .sort-label {
        margin-inline-start: 0;
        margin-inline-end: 0.5rem;
    }

    .home-hero-actions {
        justify-content: flex-start;
    }
    .data-table td.actions {
        white-space: nowrap;
        min-width: 0;
    }
    .data-table .input-inline.wide {
        min-width: 9rem;
    }
    .home-grid {
        grid-template-columns: 1fr;
    }
    .service-row-votes {
        margin-inline-start: 0;
    }
}

@media (max-width: 420px) {
    .home-hero {
        padding: 1rem;
    }
    .home-hero-actions .btn {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}
