* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: #F3F4F6;
    min-height: 100vh;
    color: #374151;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: #ffffff;
    color: #333;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #E5E7EB;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.nav-brand {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1F2937;
    letter-spacing: 0.3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links span {
    font-size: 0.9rem;
    color: #6B7280;
}

/* Buttons */
.btn {
    padding: 0.55rem 1.3rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #10B981;
    color: white;
}

.btn-primary:hover {
    background: #059669;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-logout {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
    padding: 0.5rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-logout:hover {
    background: #E5E7EB;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 75vh;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1F2937;
    font-weight: 600;
    font-size: 1.4rem;
}

/* Form */
.form-group {
    margin-bottom: 1.3rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4B5563;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 9999px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #F9FAFB;
}

.form-group input:focus {
    outline: none;
    border-color: #10B981;
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.error-msg {
    color: #EF4444;
    margin-bottom: 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.75rem;
    background: #FEF2F2;
    border-radius: 9999px;
}

.login-box .btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    border-radius: 9999px;
}

/* History Page */
.history-container h1 {
    margin-bottom: 1.5rem;
    color: #1F2937;
    font-weight: 600;
    font-size: 1.35rem;
}

/* Filter Bar */
.filter-bar {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-item label {
    font-size: 0.8rem;
    color: #6B7280;
    font-weight: 500;
}

.filter-item input {
    padding: 0.6rem 1rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 9999px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: #F9FAFB;
    min-width: 150px;
}

.filter-item input:focus {
    outline: none;
    border-color: #10B981;
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-item input[type="date"] {
    min-width: 130px;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.data-table th,
.data-table td {
    padding: 0.9rem 1.1rem;
    text-align: left;
}

.data-table th {
    background: #F9FAFB;
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    border-bottom: 1px solid #E5E7EB;
}

.data-table td {
    border-bottom: 1px solid #F3F4F6;
    color: #4B5563;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #F9FAFB;
}

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

.loading, .empty, .error {
    text-align: center;
    color: #9CA3AF;
    padding: 3rem !important;
    font-size: 0.9rem;
}

/* Status Badge */
.status {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #F3F4F6;
    color: #6B7280;
}

.status-success {
    background: #D1FAE5;
    color: #059669;
}

.status-pending {
    background: #FEF3C7;
    color: #D97706;
}

.status-error {
    background: #FEE2E2;
    color: #DC2626;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.45rem 0.85rem;
    border: 1px solid #E5E7EB;
    background: white;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #4B5563;
    transition: all 0.2s ease;
    min-width: 36px;
}

.pagination button:hover:not(:disabled) {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination button.active {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.pagination span {
    color: #9CA3AF;
    font-size: 0.85rem;
    padding: 0 0.4rem;
}

/* Total Info */
.total-info {
    text-align: center;
    color: #6B7280;
    margin-top: 1rem;
    font-size: 0.85rem;
}

/* Links */
.data-table td a {
    color: #10B981;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.data-table td a:hover {
    color: #059669;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 200px;
    background: #FAFAFA;
    border-right: 1px solid #E5E7EB;
    z-index: 100;
    padding: 1rem 0;
}

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

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.25rem;
    color: #6B7280;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    margin: 0.15rem 0.5rem;
    border-radius: 8px;
}

.sidebar-item:hover {
    background: #F3F4F6;
    color: #374151;
}

.sidebar-item.active {
    background: #D1FAE5;
    color: #059669;
}

.sidebar-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
}

.sidebar-text {
    flex: 1;
}

/* Container with sidebar */
.container.has-sidebar {
    margin-left: 200px;
    padding-top: calc(56px + 2rem);
    min-height: 100vh;
}

/* Center content area when sidebar is present */
.container.has-sidebar .history-container,
.container.has-sidebar .login-container {
    max-width: 960px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .container.has-sidebar {
        margin-left: 0;
        padding-top: calc(56px + 1.5rem);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-item input {
        min-width: unset;
        width: 100%;
    }

    .navbar {
        padding: 0 1rem;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.5rem;
    }
}
