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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.navbar {
    background: #1a1a2e;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar .brand {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 2rem;
}

.navbar .nav-links {
    display: flex;
    gap: 0.5rem;
}

.navbar .nav-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.navbar .nav-right {
    margin-left: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

h1.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid #1a1a2e;
}

.stat-card.blue { border-left-color: #1890ff; }
.stat-card.green { border-left-color: #52c41a; }
.stat-card.orange { border-left-color: #fa8c16; }

.stat-card .label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.stat-card .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
}

/* Card */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input[type="text"],
.filter-bar input[type="date"],
.filter-bar select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #1890ff;
}

/* Table */
.table-wrap { overflow-x: auto; }

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

table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.85rem;
    color: #333;
}

table tr:hover { background: #fafafa; }

table .money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

table .empty {
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.5;
}

.btn-primary { background: #1890ff; color: #fff; }
.btn-primary:hover { background: #096dd9; }

.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #389e0d; }

.btn-cancel { background: #f0f0f0; color: #555; }
.btn-cancel:hover { background: #d9d9d9; }

.btn-danger { background: #f5222d; color: #fff; }
.btn-danger:hover { background: #cf1322; }

.btn-sm {
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-edit { background: #e6f7ff; color: #1890ff; text-decoration: none; }
.btn-edit:hover { background: #bae7ff; }

.btn-delete { background: #fff2f0; color: #f5222d; border: none; }
.btn-delete:hover { background: #ffccc7; }

/* Badge */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending { background: #fff7e6; color: #fa8c16; }
.badge-claimed { background: #f6ffed; color: #52c41a; }

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.3rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

textarea.form-input { resize: vertical; }

.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #1890ff;
    background: #e6f7ff;
}

.upload-zone p {
    color: #888;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.upload-zone .hint {
    font-size: 0.8rem;
    color: #bbb;
}

/* Upload result list */
.upload-results {
    list-style: none;
}

.upload-results li {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.upload-results li .status-icon {
    font-size: 1.2rem;
}

.upload-results li .info { flex: 1; }
.upload-results li .info .name { font-weight: 600; }
.upload-results li .info .detail { color: #888; font-size: 0.8rem; }

/* User dropdown */
.user-dropdown { position: relative; display: inline-block; }

.user-dropdown-trigger {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.2s;
    user-select: none;
}

.user-dropdown-trigger:hover { color: #fff; border-color: #fff; }

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 120px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown:hover .user-dropdown-menu { display: block; }

.navbar .nav-right .user-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
    border: none;
}

.navbar .nav-right .user-dropdown-menu a:hover {
    background: #e6f7ff;
    color: #1890ff;
}

/* Login */
.login-wrap {
    max-width: 360px;
    margin: 80px auto;
}

.login-wrap h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.modal-box h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 0 0.5rem; flex-wrap: wrap; height: auto; min-height: 48px; }
    .navbar .brand { font-size: 1rem; margin-right: 0.5rem; }
    .navbar .nav-links { gap: 0; flex-wrap: wrap; }
    .navbar .nav-links a { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
    .container { padding: 0.8rem 0.5rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    table th, table td { padding: 0.5rem 0.5rem; font-size: 0.78rem; }
    .filter-bar { gap: 0.3rem; }
}
