﻿body {
    margin: 0;
    background: #f6f7f9;
    color: #1f2933;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #111827;
}

.login-panel {
    width: 360px;
    padding: 28px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}

.login-panel h1 {
    margin: 0 0 22px;
    font-size: 22px;
}

.shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 252px minmax(0, 1fr);
}

.side {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #202124;
    color: #e8eaed;
    padding: 0 0 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand-badge {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 6px;
    background: #e5483f;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.brand-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.brand-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    color: #9aa0a6;
    font-size: 12px;
}

.side-nav {
    padding: 12px 10px 0;
}

.nav-group {
    margin-top: 15px;
}

.nav-group-title {
    padding: 0 12px 6px;
    color: #9aa0a6;
    font-size: 12px;
    font-weight: 600;
}

.side a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    box-sizing: border-box;
    padding: 9px 12px 9px 30px;
    border-radius: 6px;
    color: #d8dadd;
    font-size: 14px;
    text-decoration: none;
}

.side a:hover {
    background: #2b2d31;
    color: #fff;
}

.side a.active {
    background: #fff;
    color: #202124;
    font-weight: 600;
}

.side a.active::before {
    position: absolute;
    left: 10px;
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: #e5483f;
    content: "";
}

.side .nav-home {
    padding-left: 12px;
}

.nav-dot {
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: #5f6368;
}

.nav-home.active .nav-dot {
    background: #e5483f;
}

.main {
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat,
.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.stat {
    padding: 16px;
}

.stat strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.panel {
    padding: 16px;
    margin-bottom: 16px;
}

.panel h3 {
    margin: 0 0 14px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.panel-head h3 {
    margin: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
}

.muted {
    color: #6b7280;
}

.table input,
.table select {
    box-sizing: border-box;
    width: 100%;
    min-width: 110px;
    padding: 7px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}
.notice {
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid;
    border-radius: 6px;
}

.notice.success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.notice.error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.form-grid input,
.form-grid select {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.shop-picker {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.shop-picker label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-picker input {
    width: auto;
}

.primary-button {
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    cursor: pointer;
}

.toolbar {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.toolbar label {
    display: grid;
    gap: 6px;
    min-width: 190px;
    font-size: 13px;
    color: #4b5563;
}

.toolbar .grow {
    flex: 1;
}

.toolbar input,
.toolbar select {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2933;
}

.context-label {
    display: grid;
    gap: 5px;
    min-width: 190px;
    color: #6b7280;
    font-size: 13px;
}

.context-label strong {
    color: #111827;
    font-size: 15px;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: #eef2f7;
    color: #374151;
    font-size: 12px;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.number {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table-link {
    color: #2563eb;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.empty-cell {
    height: 100px;
    color: #9ca3af;
    text-align: center !important;
}

.back-row {
    margin-bottom: 14px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 24px;
}

.detail-grid > div {
    display: grid;
    gap: 5px;
}

.detail-grid span {
    color: #6b7280;
    font-size: 13px;
}

.detail-grid strong {
    font-size: 14px;
    font-weight: 600;
}

.detail-grid .wide {
    grid-column: span 2;
}

@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; padding-bottom: 12px; }
    .brand { padding: 14px; }
    .side-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
    .nav-home { grid-column: 1 / -1; }
    .nav-group { margin-top: 0; padding: 8px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 6px; }
    .nav-group-title { padding: 0 4px 5px; }
    .side a { min-height: 34px; padding: 7px 8px 7px 24px; }
    .side .nav-home { padding-left: 10px; }
    .side a.active::before { left: 7px; }
    .main { padding: 14px; overflow-x: auto; }
    .topbar { align-items: flex-start; flex-direction: column; gap: 8px; }
    .form-grid { grid-template-columns: 1fr; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar label, .context-label { width: 100%; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
}

.secondary-button {
    padding: 8px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.order-actions,
.pager {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.order-actions form {
    margin: 0;
}

.pager {
    justify-content: flex-end;
    color: #6b7280;
    font-size: 14px;
}

.inline-form {
    display: inline-block;
    margin-left: 8px;
}

.inline-form button {
    padding: 4px 7px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.secondary-link {
    color: #4b5563;
    text-decoration: none;
}

.secondary-link:hover {
    text-decoration: underline;
}

.notice.readonly {
    margin-top: 14px;
    border-color: #d1d5db;
    background: #f9fafb;
    color: #4b5563;
}

.role-table .permission-list {
    display: grid;
    gap: 7px;
    min-width: 260px;
}

.role-table .permission-list label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #374151;
    line-height: 1.35;
}

.role-table .permission-list input {
    margin-top: 2px;
}
