* {
    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;
}

.navbar .nav-right a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.2s;
}

.navbar .nav-right a:hover {
    color: #fff;
    border-color: #fff;
}

.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;
}

/* Dashboard cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    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.red { border-left-color: #f5222d; }
.stat-card.purple { border-left-color: #722ed1; }

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

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

.stat-card .value.money::before {
    content: '\A5';
    font-size: 1rem;
    margin-right: 2px;
}

/* Tables */
.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;
}

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

.search-form {
    display: flex;
    gap: 0.5rem;
}

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

.search-form input[type="text"]:focus,
.search-form select:focus {
    border-color: #1890ff;
}

.search-form button {
    padding: 0.4rem 1rem;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.search-form button:hover {
    background: #096dd9;
}

.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;
}

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

.badge-category {
    background: #e6f7ff;
    color: #1890ff;
}

.text-muted {
    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-cancel {
    background: #f0f0f0;
    color: #555;
}

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

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

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

.btn-sm {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-edit {
    background: #e6f7ff;
    color: #1890ff;
}

.btn-edit:hover {
    background: #bae7ff;
}

.btn-delete {
    background: #fff2f0;
    color: #f5222d;
}

.btn-delete:hover {
    background: #ffccc7;
}

.actions {
    white-space: nowrap;
}

/* 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);
}

select.form-input {
    appearance: auto;
}

textarea.form-input {
    resize: vertical;
}

.form-error {
    color: #f5222d;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    .container {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
