* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f5f7;
    color: #1d1d1f;
}

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

.sidebar {
    width: 250px;
    background: #111827;
    color: #fff;
    padding: 24px 18px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 28px;
}

.sidebar a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 10px;
    border-radius: 10px;
    margin-bottom: 6px;
}

.sidebar a:hover {
    background: #1f2937;
    color: #fff;
}

.content {
    flex: 1;
    padding: 26px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.stat {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #e5e7eb;
}

.stat b {
    font-size: 26px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
}

input, select, textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    margin-bottom: 10px;
}

textarea {
    min-height: 90px;
}

button, .btn {
    border: 0;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover {
    background: #374151;
}

.btn-good {
    background: #047857;
}

.btn-bad {
    background: #b91c1c;
}

.badge {
    padding: 5px 9px;
    border-radius: 999px;
    background: #e5e7eb;
    display: inline-block;
    font-size: 12px;
}

.login-box {
    max-width: 420px;
    margin: 90px auto;
}

/* fixed admin sidebar */
.sidebar {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    flex: 0 0 260px !important;
}

.content {
    min-width: 0;
    overflow-x: auto;
}

.layout {
    display: grid !important;
    grid-template-columns: 260px minmax(0, 1fr) !important;
    width: 100% !important;
}

.sidebar {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    flex-shrink: 0 !important;
}

.content {
    min-width: 0 !important;
    overflow-x: auto !important;
}

.content table {
    min-width: 1400px;
}

/* Sidebar rate widget */
.rate-box {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1.6;
}

.rate-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.rate-source {
    margin-top: 6px;
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
}

/* Sidebar rate widget */
.rate-box {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1.6;
}

.rate-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.rate-source {
    margin-top: 6px;
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
}

/* compact filters inside table headers */
.th-filter {
    position: relative;
    display: inline-block;
}

.th-filter summary {
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    font-weight: 700;
}

.th-filter summary::-webkit-details-marker {
    display: none;
}

.th-filter-box {
    position: absolute;
    z-index: 50;
    top: 26px;
    left: 0;
    min-width: 220px;
    padding: 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.th-filter-box select {
    margin: 0;
    min-width: 200px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
}

.stat b {
    font-size: 28px;
}

.stat-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform .12s ease, box-shadow .12s ease;
}

.stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.tab {
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
}

.tab.active {
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(15,23,42,0.12);
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: 180px 1fr 90px;
    gap: 12px;
    align-items: center;
}

.bar-label {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-wrap {
    height: 18px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #111827;
    border-radius: 999px;
}

.bar-value {
    text-align: right;
    font-size: 13px;
}

.chart-shell {
    background: #eef0f3;
    border-radius: 14px;
    padding: 22px;
    border: 1px solid #dde2ea;
}

.chart-card {
    height: 360px;
    background: rgba(255,255,255,0.72);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 22px;
}

.chart-filter {
    max-width: 980px;
}

.filter-title {
    margin: 14px 0 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px 24px;
    margin-bottom: 18px;
}

.filter-grid label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #6b7280;
}

.filter-grid input,
.filter-grid select {
    margin-top: 6px;
    border: none;
    border-bottom: 1px solid #9ca3af;
    border-radius: 0;
    background: transparent;
    padding: 8px 2px;
}

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

.chart-shell {
    background: #eef0f3;
    border-radius: 14px;
    padding: 22px;
    border: 1px solid #dde2ea;
}

.chart-card {
    height: 360px;
    background: rgba(255,255,255,0.72);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 22px;
}

.chart-filter {
    max-width: 980px;
}

.filter-title {
    margin: 14px 0 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px 24px;
    margin-bottom: 18px;
}

.filter-grid label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #6b7280;
}

.filter-grid input,
.filter-grid select {
    margin-top: 6px;
    border: none;
    border-bottom: 1px solid #9ca3af;
    border-radius: 0;
    background: transparent;
    padding: 8px 2px;
}

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

.trust-box {
    display: flex;
    align-items: center;
    gap: 18px;
}

.trust-score {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: white;
    font-size: 22px;
    font-weight: 800;
}

.nav-group {
    margin: 8px 0;
}

.nav-group summary {
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group a {
    margin-left: 12px;
    font-size: 14px;
}

.rate-box {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    font-size: 13px;
    line-height: 1.5;
}

.nav-group {
    margin: 8px 0;
}

.nav-group summary {
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group a {
    margin-left: 12px;
    font-size: 14px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.product-card {
    background: rgba(255,255,255,0.78);
    border: 1px solid #dde2ea;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: #eef0f3;
}

.product-card-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
}

.product-card-body {
    padding: 14px;
    flex: 1;
}

.product-card-body h3 {
    margin-top: 0;
}

.product-desc {
    color: #6b7280;
    font-size: 14px;
    white-space: pre-wrap;
}

.product-card-actions {
    padding: 14px;
    border-top: 1px solid #dde2ea;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-card-actions form {
    margin: 0;
}
