:root {
    --honda-red: #ed1b2e;
    --honda-red-dark: #c41626;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --line: #e8e8e8;
    --soft: #fff1f2;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.admin-body {
    margin: 0;
    min-height: 100vh;
    font-family: Manrope, system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

[x-cloak] {
    display: none !important;
}

a {
    color: inherit;
    text-decoration: none;
}

.admin-layout {
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(180deg, #8f0a14 0%, #b81222 30%, #d01424 65%, #ed1b2e 100%);
    color: #fff;
    padding: 1rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: fixed;
    inset: 0 auto 0 0;
    width: 5.5rem;
    height: 100vh;
    transition: width 180ms ease, padding 180ms ease;
    z-index: 40;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 2px 0 18px rgba(168, 15, 28, 0.35);
}

.admin-sidebar.is-open {
    width: 16.5rem;
    padding: 1.25rem 1rem;
}

.admin-main {
    min-width: 0;
    min-height: 100vh;
    margin-left: 5.5rem;
    transition: margin-left 180ms ease;
}

.admin-layout.sidebar-open .admin-main {
    margin-left: 16.5rem;
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.15rem 0.65rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 100%;
    flex-shrink: 0;
}

.admin-sidebar-brand img {
    width: 3.25rem;
    max-width: 100%;
    height: auto;
    display: block;
    transition: width 180ms ease;
    object-fit: contain;
}

.admin-sidebar.is-open .admin-sidebar-brand img {
    width: 5.5rem;
}

.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.admin-sidebar-label {
    margin: 0.75rem 0 0.35rem;
    padding: 0 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-sidebar.is-collapsed .admin-sidebar-label {
    display: none;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.admin-sidebar.is-collapsed .admin-sidebar-link {
    justify-content: center;
    padding: 0.75rem 0.35rem;
}

.admin-sidebar.is-collapsed .admin-sidebar-link-text {
    display: none;
}

.admin-sidebar-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-sidebar-icon svg {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
}

.admin-sidebar-link:hover,
.admin-sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.admin-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    padding-top: 1rem;
    flex-shrink: 0;
}

.admin-sidebar.is-collapsed .admin-sidebar-footer {
    display: none;
}

.admin-sidebar-user {
    margin-bottom: 0.75rem;
    padding: 0 0.35rem;
}

.admin-sidebar-user-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-sidebar-user strong {
    display: block;
    min-width: 0;
}

.admin-sidebar-user-logo {
    width: 2.5rem;
    height: auto;
    flex: 0 0 auto;
    object-fit: contain;
}

.admin-sidebar-user span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    text-transform: capitalize;
}

.admin-sidebar-footer .btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-top-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.hamburger {
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 1.15rem;
    height: 2px;
    background: var(--ink);
    border-radius: 999px;
}

.admin-content {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.admin-sidebar-backdrop {
    display: none;
}

.flash-success,
.flash-error {
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.flash-success {
    background: #ecfdf3;
    color: #067647;
}

.flash-error {
    background: #fef3f2;
    color: #b42318;
}

.admin-form {
    max-width: 32rem;
}

.admin-form select {
    width: 100%;
    min-height: 2.9rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    padding: 0 0.9rem;
    font: inherit;
    background: #fff;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.table-actions form {
    margin: 0;
}

@media (max-width: 900px) {
    .admin-main,
    .admin-layout.sidebar-open .admin-main {
        margin-left: 5.5rem;
    }

    .admin-sidebar {
        width: 5.5rem;
    }

    .admin-sidebar.is-open {
        width: min(18rem, 86vw);
    }

    .admin-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 30;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border-radius: 999px;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--honda-red);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}

.btn-primary:hover,
.btn-ghost:hover {
    opacity: 0.92;
}

.admin-hero {
    background: var(--honda-red);
    color: #fff;
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 12px 28px rgba(237, 27, 46, 0.18);
}

.admin-hero h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.admin-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.stat-card strong {
    font-size: 1.4rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

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

.panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    width: min(100%, 22rem);
}

.search-form input {
    flex: 1;
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 1rem;
    font: inherit;
}

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

table.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--soft);
    color: var(--honda-red);
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

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

.pagination {
    margin-top: 1rem;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: var(--bg);
}

.login-card {
    width: min(100%, 26rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.login-card h1 {
    margin: 0.75rem 0 0.35rem;
    font-size: 1.6rem;
}

.login-card p {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

.login-logo {
    width: 5.5rem;
    height: auto;
    display: block;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.field input {
    width: 100%;
    min-height: 2.9rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    padding: 0 0.9rem;
    font: inherit;
}

.field input:focus {
    outline: 2px solid rgba(237, 27, 46, 0.2);
    border-color: var(--honda-red);
}

.field-error {
    margin: 0.4rem 0 0;
    color: var(--honda-red);
    font-size: 0.85rem;
}

.remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.breakdown {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 1rem 0 1.5rem;
}

.breakdown-item {
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 0.65rem 0.25rem;
}

.breakdown-item strong {
    display: block;
    color: var(--honda-red);
}

.breakdown-item span {
    color: var(--muted);
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

.remarks {
    max-width: 28rem;
    white-space: pre-wrap;
}

.panel-spaced {
    margin-top: 1.25rem;
}

.reviews-filter {
    width: min(100%, 36rem);
}

.reviews-filter select {
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 1rem;
    font: inherit;
    background: #fff;
}

.back-link {
    display: inline-flex;
    margin-bottom: 1rem;
    color: var(--muted);
    font-weight: 600;
}

.app-footer {
    margin: 0;
    padding: 1.25rem 1rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.login-shell .app-footer {
    width: 100%;
    max-width: 26rem;
}

.sms-mode-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sms-mode-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sms-mode-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sms-mode-card strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.sms-mode-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.sms-mode-card.is-selected,
.sms-mode-card:has(input:checked) {
    border-color: var(--honda-red);
    box-shadow: 0 0 0 1px var(--honda-red);
}

.sms-mode-card:hover {
    border-color: rgba(237, 27, 46, 0.45);
}

.field-error {
    color: #b42318;
    font-size: 0.875rem;
    margin: 0 0 1rem;
}
