:root {
    --blue: #2a67fe;
    --blue-hover: #1f53e6;
    --heading: #0d1a39;
    --text: #333;
    --muted: #7a889f;
    --line: #d7d7d7;
    --table-border: #ebedf5;
    --table-header: #f5f7ff;
    --bg: #f4f6fb;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

.layout {
    display: grid;
    grid-template-columns: 220px auto;
    grid-template-rows: 60px auto;
    grid-template-areas:
        "topbar topbar"
        "sidebar content";
    min-height: 100vh;
}

.topbar {
    grid-area: topbar;
    background: var(--blue);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.brand {
    font-size: 24px;
    color: #fff;
    font-weight: 600;
}

.sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 20px;
}

.nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: block;
    padding: 14px 32px;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--blue);
}

.nav-item.active {
    font-weight: 600;
    color: var(--blue);
}

.content {
    grid-area: content;
    padding: 20px 20px 40px;
}

.page-header h2 {
    font-size: 14px;
    color: var(--heading);
    margin-bottom: 8px;
}

.divider {
    height: 1px;
    background: var(--line);
}

.filters {
    margin-top: 20px;
    margin-bottom: 10px;
}

.filter-row {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.filter {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 140px;
    flex-shrink: 0;
}

.filter span {
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    min-width: 60px;
    flex-shrink: 0;
}

.filter select {
    width: 120px;
    height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}

.search-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 30px;
}

.search-box input {
    width: 200px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--line);
    padding: 0 12px;
}

.btn-search,
.btn-action {
    min-width: 82px;
    height: 34px;
    border-radius: 6px;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-search {
    background: linear-gradient(135deg, #2a67fe 0%, #5d8bff 100%);
}

.btn-search:hover {
    background: linear-gradient(135deg, #1f53e6 0%, #517df5 100%);
}

.btn-action {
    background: linear-gradient(135deg, #2a9afe 0%, #5dbdff 100%);
}

.btn-action:hover {
    background: linear-gradient(135deg, #1f83e6 0%, #4fb0f5 100%);
}

.btn-action[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.table-wrapper {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--table-border);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--table-header);
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--table-border);
    text-align: left;
}

tbody tr:hover {
    background: #f9fbff;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.tag-on {
    background: rgba(42, 103, 254, 0.1);
    color: var(--blue);
}

.tag-off {
    background: rgba(122, 136, 159, 0.15);
    color: #6b7786;
}

.actions a {
    color: var(--blue);
    text-decoration: none;
    margin-right: 8px;
}

.actions a:hover {
    text-decoration: underline;
}

.pagination {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.pager {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pager button {
    min-width: 36px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pager button:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.pager button.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.pager input[type="number"] {
    width: 50px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--line);
    text-align: center;
}

.toast {
    position: fixed;
    right: 32px;
    bottom: 32px;
    min-width: 220px;
    max-width: 320px;
    padding: 14px 18px;
    background: rgba(13, 26, 57, 0.9);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 12px 24px rgba(13, 26, 57, 0.25);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 99;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: rgba(220, 53, 69, 0.92);
}

