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

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f5f6fa;
    color: #2d3436;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: #1a2a4a;
    text-decoration: none;
}

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

.admin-body {
    display: flex;
    flex: 1;
    padding-top: 54px;
}

.admin-header {
    background: #1a2a4a;
    color: #ffffff;
    height: 54px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left .logo {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
}

.header-right .user-info {
    opacity: 0.8;
}

.logout-btn {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 16px;
    border-radius: 2px;
    font-size: 13px;
    transition: background 0.2s;
}
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.admin-sidebar {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #e4e7ed;
    min-height: calc(100vh - 54px);
    flex-shrink: 0;
    padding: 8px 0;
    position: fixed;
    top: 54px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
}

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

.nav-item {
    display: block;
    padding: 10px 24px;
    color: #4a4a5a;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: #f5f6fa;
    color: #1a2a4a;
}

.nav-item.active {
    background: #f0f2f7;
    color: #1a2a4a;
    border-left-color: #1a2a4a;
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: #e4e7ed;
    margin: 6px 20px;
}

.admin-main {
    flex: 1;
    padding: 24px 32px;
    overflow-x: auto;
    background: #f5f6fa;
    margin-left: 200px;
    min-height: calc(100vh - 54px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e4e7ed;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a2a4a;
}

.page-header .sub {
    font-size: 13px;
    color: #999;
}

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

.stat-card {
    background: #ffffff;
    border-radius: 2px;
    padding: 18px 22px;
    border: 1px solid #e4e7ed;
}

.stat-card .number {
    font-size: 24px;
    font-weight: 700;
    color: #1a2a4a;
}

.stat-card .number.green { color: #27ae60; }
.stat-card .number.orange { color: #e67e22; }
.stat-card .number.blue { color: #2980b9; }
.stat-card .number.red { color: #e74c3c; }

.stat-card .label {
    font-size: 13px;
    color: #999;
    margin-top: 2px;
}

.table-wrap {
    background: #ffffff;
    border-radius: 2px;
    border: 1px solid #e4e7ed;
    overflow: hidden;
    margin-bottom: 18px;
}

.table-wrap .table-header {
    padding: 12px 20px;
    background: #f8f9fb;
    border-bottom: 1px solid #e4e7ed;
    font-weight: 600;
    font-size: 14px;
    color: #1a2a4a;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-wrap table th {
    background: #f8f9fb;
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: #4a4a5a;
    border-bottom: 1px solid #e4e7ed;
    font-size: 12px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.table-wrap table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f1f4;
    color: #2d3436;
    white-space: nowrap;
}

.table-wrap table tbody tr:hover td {
    background: #f8f9fb;
}

.table-wrap table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 1px 14px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: #e8f8ee;
    color: #1a7a3a;
}

.status-badge.warning {
    background: #fef5e7;
    color: #a66a1a;
}

.status-badge.danger {
    background: #fdedec;
    color: #a93226;
}

.status-badge.info {
    background: #eaf2f8;
    color: #1a5276;
}

.btn {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #d5d9e0;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #ffffff;
    color: #2d3436;
}
.btn:hover {
    background: #f0f2f5;
}

.btn-primary {
    background: #1a2a4a;
    border-color: #1a2a4a;
    color: #fff;
}
.btn-primary:hover {
    background: #2a3a5a;
    border-color: #2a3a5a;
    color: #fff;
}

.btn-success {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}
.btn-success:hover {
    background: #1e8449;
    border-color: #1e8449;
    color: #fff;
}

.btn-danger {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}
.btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.btn-warning {
    background: #e67e22;
    border-color: #e67e22;
    color: #fff;
}
.btn-warning:hover {
    background: #ca6f1e;
    border-color: #ca6f1e;
    color: #fff;
}

.btn-gray {
    background: #999;
    border-color: #999;
    color: #fff;
}
.btn-gray:hover {
    background: #777;
    border-color: #777;
    color: #fff;
}

.btn-sm {
    padding: 2px 12px;
    font-size: 12px;
}

.btn-sm + .btn-sm {
    margin-left: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    color: #2d3436;
    margin-bottom: 3px;
}

.form-group .help {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.form-control {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid #d5d9e0;
    border-radius: 2px;
    font-size: 13px;
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-control:focus {
    border-color: #1a2a4a;
    outline: none;
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pagination .page-link {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 2px;
    border: 1px solid #d5d9e0;
    background: #fff;
    color: #2d3436;
    font-size: 13px;
}
.pagination .page-link:hover {
    background: #f0f2f5;
}
.pagination .page-link.active {
    background: #1a2a4a;
    border-color: #1a2a4a;
    color: #fff;
}

.alert {
    padding: 10px 16px;
    border-radius: 2px;
    margin-bottom: 14px;
    font-size: 13px;
}

.alert-error {
    background: #fdedec;
    color: #922b21;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #e8f8ee;
    color: #1a6a3a;
    border: 1px solid #c6e6d5;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #ffffff;
    border-radius: 2px;
    padding: 0;
    max-width: 560px;
    width: 94%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid #e4e7ed;
}

.modal-box-sm {
    max-width: 420px;
}

.modal-header {
    padding: 16px 24px;
    background: #f8f9fb;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
}
.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a2a4a;
}
.modal-header .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 2px;
}
.modal-header .modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #f0f1f4;
    padding-top: 20px;
}

.modal-footer .btn {
    padding: 8px 24px;
}

.modal-icon-box {
    text-align: center;
    margin-bottom: 12px;
}
.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 400;
    border: 2px solid #ccc;
    color: #888;
    background: transparent;
}
.modal-icon.warning {
    border-color: #d4a574;
    color: #b8864a;
}

.modal-title {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}
.modal-desc {
    text-align: center;
    font-size: 13px;
    color: #888;
    line-height: 1.8;
    margin: 0;
}
.modal-desc strong {
    color: #555;
    font-weight: 600;
}
.modal-desc .highlight {
    color: #b8864a;
    font-weight: 600;
}

.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 2px;
    font-size: 14px;
    color: #fff;
    background: #27ae60;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: slideInRight 0.4s ease forwards;
    min-width: 200px;
    text-align: center;
}

.toast.error {
    background: #e74c3c;
}

.toast.hide {
    animation: slideOutRight 0.4s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 52px;
    }
    .admin-main {
        margin-left: 52px;
        padding: 16px;
    }
    .nav-item {
        padding: 10px 14px;
        font-size: 0;
        text-align: center;
    }
    .nav-item::before {
        content: "·";
        font-size: 18px;
        font-weight: 700;
    }
    .nav-item.active::before {
        color: #1a2a4a;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-header {
        padding: 0 14px;
    }
    .header-right .user-info {
        display: none;
    }
}