* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    background: #f5f6fa;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 20px;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #e8ecf1;
}

.login-box {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 360px;
}

.login-box h2 {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 8px;
    font-size: 1.4rem;
    font-weight: 600;
}

.login-box .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #444;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: #fff;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
}

.btn:hover {
    background: #1557b0;
}

.btn-primary {
    background: #1a73e8;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-secondary {
    background: #f1f3f4;
    color: #333;
}

.btn-secondary:hover {
    background: #e8eaed;
}

.card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h2 {
    color: #1a73e8;
    font-size: 1.2rem;
    font-weight: 600;
}

.card-header h3 {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
}

.header-brand {
    font-size: 1.1rem;
    color: #1a73e8;
    font-weight: 600;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    margin: 0 24px;
}

.header-nav a {
    display: inline-block;
    padding: 14px 12px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: normal;
    transition: color 0.15s;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
}

.header-nav a:hover {
    color: #1a73e8;
}

.header-nav a.active {
    color: #1a73e8;
    font-weight: 600;
    border-bottom: 1px solid #1a73e8;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
    z-index: 1000;
    margin-top: -1px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: none;
    margin: 0;
}

.nav-dropdown-menu a:hover {
    background: #f1f3f4;
    color: #1a73e8;
}

.nav-dropdown-menu a.active {
    color: #1a73e8;
    font-weight: 600;
    background: #e8f0fe;
}

.nav-dropdown-toggle::after {
    content: '▼';
    font-size: 0.6rem;
    margin-left: 4px;
    vertical-align: middle;
}

.header-user {
    position: relative;
}

.header-user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: #333;
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.15s;
}

.header-user-name:hover {
    color: #1a73e8;
}

.header-user-name::after {
    content: '▼';
    font-size: 0.6rem;
    color: #999;
}

.header-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 140px;
    display: none;
    z-index: 1000;
}

.header-dropdown.show {
    display: block;
}

.header-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.header-dropdown a:hover {
    background: #f5f5f5;
}

.header-dropdown a:first-child {
    border-radius: 4px 4px 0 0;
}

.header-dropdown a:last-child {
    border-radius: 0 0 4px 4px;
}

.header-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.nav-link {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid #ddd;
}

.nav-link:hover {
    background: #f1f3f4;
    border-color: #bbb;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid #eee;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 600px;
}

th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    border-bottom: 2px solid #eee;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    text-align: center;
}

tr:hover {
    background: #fafafa;
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
    margin: 16px 0;
}

.info-item {
    background: #f8f9fa;
    border-left: 3px solid #1a73e8;
    padding: 16px;
    border-radius: 4px;
}

.info-item.green {
    border-left-color: #059669;
}

.info-item.orange {
    border-left-color: #f57c00;
}

.info-item.purple {
    border-left-color: #7c3aed;
}

.info-item .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.info-item .label {
    font-size: 0.85rem;
    color: #666;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.section-title {
    color: #333;
    font-size: 1rem;
    margin: 24px 0 12px;
    font-weight: 600;
}

.text-muted {
    color: #888;
    font-size: 0.9rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.collapse-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    transition: background 0.2s;
    font-family: inherit;
}

.collapse-btn:hover {
    background: #f1f3f4;
}

.collapse-btn::after {
    content: '▼';
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.2s;
}

.collapse-btn.active::after {
    transform: rotate(180deg);
}

.collapse-content {
    display: none;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.collapse-content.show {
    display: block;
}

.mobile-list-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.mobile-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    background: #fff;
}

.mobile-list-header:hover {
    background: #f8f9fa;
}

.mobile-list-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.mobile-list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-list-body {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid #eee;
}

.mobile-list-body.show {
    display: block;
}

.mobile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}

.mobile-info-row:last-child {
    border-bottom: none;
}

.mobile-info-label {
    color: #888;
}

.mobile-info-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.mobile-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.mobile-actions .btn,
.mobile-actions .nav-link {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.product-image-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

@media (max-width: 1024px) {
    .info-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .info-item {
        padding: 12px;
    }

    .info-item .value {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 12px;
    }

    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        margin: 0;
        overflow-x: auto;
        gap: 0;
        border-top: 1px solid #e0e0e0;
        padding-top: 8px;
    }

    .header-nav a {
        padding: 8px 12px;
        font-size: 14px;
        white-space: nowrap;
        border-bottom: none;
    }

    .header-nav a.active {
        font-weight: 600;
        border-bottom: none;
        color: #1a73e8;
    }

    .header-user {
        order: 2;
    }

    .header h1 {
        order: 1;
    }

    .login-box {
        padding: 30px 24px;
    }

    .card {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .info-item {
        padding: 10px;
    }

    .info-item .value {
        font-size: 1.2rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .mobile-actions {
        flex-direction: column;
    }

    .mobile-actions .btn,
    .mobile-actions .nav-link {
        width: 100%;
    }

    .btn {
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .mobile-list-container {
        display: none;
    }
    .desktop-table-container {
        display: block;
    }
}

@media (max-width: 768px) {
    .mobile-list-container {
        display: block;
    }
    .desktop-table-container {
        display: none;
    }

    .table-header {
        flex-direction: column;
        gap: 12px;
    }

    .time-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .time-filter-btns {
        flex-wrap: wrap;
    }

    .time-range {
        margin-left: 0;
    }
}

.time-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.time-filter-btns {
    display: flex;
    gap: 4px;
}

.time-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.time-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.time-btn.active {
    background: #1a73e8;
    color: #fff;
}

.time-filter-month {
    display: flex;
    gap: 8px;
    align-items: center;
}

.time-filter-month input[type="month"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.time-range {
    color: #888;
    font-size: 0.85rem;
    margin-left: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.table-header .section-title {
    margin: 0;
}