/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: #f0f5ff;
    color: #333;
    min-height: 100vh;
}

a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }

/* ========== Navbar ========== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #1890ff 0%, #4096ff 100%);
    color: #fff;
    padding: 0 32px;
    height: 56px;
    box-shadow: 0 2px 8px rgba(22,119,255,0.2);
}
.nav-brand { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.15); }
.nav-logout { color: #ffccc7 !important; }
.nav-logout:hover { color: #fff !important; background: rgba(255,77,79,0.2) !important; }

/* ========== Main ========== */
.main-content {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 32px;
}

/* ========== Auth Pages (login / register) ========== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e6f0ff 0%, #b3d4ff 50%, #91caff 100%);
}
.auth-card {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 24px;
    color: #1890ff;
}
.auth-card .form-group {
    margin-bottom: 20px;
}
.auth-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #666;
}
.auth-card input {
    width: 100%;
    height: 40px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    transition: border-color 0.3s;
}
.auth-card input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}
.auth-card .btn {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 4px;
    background: #1890ff;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}
.auth-card .btn:hover { background: #096dd9; }
.auth-card .btn:disabled { background: #b3d8ff; cursor: not-allowed; }
.auth-card .sms-row { display: flex; gap: 8px; }
.auth-card .sms-row input { flex: 1; }
.auth-card .form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #999;
}
.auth-card .error-msg {
    color: #f5222d;
    font-size: 13px;
    margin-top: 4px;
}

/* ========== Cards ========== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(22,119,255,0.08);
    margin-bottom: 20px;
    border: 1px solid #e6f0ff;
}
.card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6f0ff;
    color: #1890ff;
}

/* ========== Dashboard ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}
.profile-card .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed #f0f0f0;
}
.profile-card .info-row:last-child { border-bottom: none; }
.profile-card .info-label { color: #999; }
.profile-card .info-value { color: #333; font-weight: 500; }
.announcement-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.announcement-item:last-child { border-bottom: none; }
.announcement-item .gg-date { font-size: 12px; color: #999; margin-bottom: 4px; }
.announcement-item .gg-text { font-size: 14px; line-height: 1.6; }

/* ========== Table ========== */
.table-container { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
}
tr:hover td { background: #fafafa; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}
.badge-valid { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-invalid { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.badge-pending { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.badge-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-failed { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }

/* ========== Filter bar ========== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar select, .filter-bar input {
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
}
.filter-bar select:focus, .filter-bar input:focus {
    border-color: #1890ff;
    outline: none;
}
.filter-bar .btn {
    height: 36px;
    padding: 0 20px;
    border: none;
    border-radius: 4px;
    background: #1890ff;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.filter-bar .btn:hover { background: #096dd9; }
.filter-bar .btn-outline {
    background: #fff;
    color: #1890ff;
    border: 1px solid #1890ff;
}
.filter-bar .btn-outline:hover { background: #e6f7ff; }
.stats-bar {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}

/* ========== Upload Zone ========== */
.upload-zone {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: #1890ff;
    background: #e6f7ff;
}
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 12px; color: #bbb; }
.upload-zone p { color: #999; font-size: 14px; }
.upload-zone .file-name { color: #1890ff; font-weight: 500; margin-top: 8px; }

/* ========== Profile ========== */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 768px) {
    .dashboard-grid, .profile-grid { grid-template-columns: 1fr; }
    .auth-card { width: 90%; padding: 24px; }
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #666; }
.form-group input, .form-group select {
    width: 100%;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
}
.form-group input:focus, .form-group select:focus {
    border-color: #1890ff;
    outline: none;
}

/* ========== Modal ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 420px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.modal-box h3 { margin-bottom: 16px; }
.modal-box textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    resize: vertical;
}
.modal-box .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.modal-box .btn {
    height: 34px;
    padding: 0 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.modal-box .btn-primary { background: #1890ff; color: #fff; }
.modal-box .btn-cancel { background: #f5f5f5; color: #666; }

/* ========== Loading / Toast ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    animation: fadeIn 0.3s;
}
.toast-success { background: #52c41a; }
.toast-error { background: #ff4d4f; }
.toast-info { background: #1890ff; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== Enhanced Buttons ========== */
.btn-primary-lg {
    display: block;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #1890ff, #4096ff);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(22,119,255,0.35);
    letter-spacing: 2px;
}
.btn-primary-lg:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22,119,255,0.45);
}
.btn-primary-lg:disabled {
    background: #b3d8ff;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-sync {
    height: 40px;
    padding: 0 16px;
    border: 1px solid #1890ff;
    border-radius: 6px;
    background: #e6f4ff;
    color: #1890ff;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-sync:hover { background: #bae0ff; }

.btn-sms {
    height: 40px;
    padding: 0 16px;
    border: 1px solid #1890ff;
    border-radius: 6px;
    background: #fff;
    color: #1890ff;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-sms:hover { background: #e6f4ff; }
.btn-sms:disabled {
    color: #999;
    border-color: #d9d9d9;
    background: #f5f5f5;
    cursor: not-allowed;
}

/* ========== Toggle Checkbox ========== */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #333;
}
.toggle-label input[type="checkbox"] {
    appearance: none;
    width: 44px;
    height: 24px;
    background: #d9d9d9;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}
.toggle-label input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-label input[type="checkbox"]:checked {
    background: #1890ff;
}
.toggle-label input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

/* ========== Enhanced Profile Info ========== */
.info-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e6f0ff;
    box-shadow: 0 2px 12px rgba(22,119,255,0.06);
    overflow: hidden;
}
.info-card-header {
    background: linear-gradient(90deg, #e6f4ff, #f0f5ff);
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #1890ff;
    border-bottom: 1px solid #e6f0ff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-card-header .icon { font-size: 18px; }
.info-card-body { padding: 16px 20px; }

.info-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.info-item:last-child { border-bottom: none; }
.info-item .info-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    flex-shrink: 0;
}
.info-item .info-icon.blue   { background: #e6f4ff; color: #1890ff; }
.info-item .info-icon.green  { background: #f6ffed; color: #52c41a; }
.info-item .info-icon.orange { background: #fff7e6; color: #fa8c16; }
.info-item .info-icon.red    { background: #fff2f0; color: #ff4d4f; }
.info-item .info-content { flex: 1; }
.info-item .info-label { font-size: 12px; color: #999; margin-bottom: 2px; }
.info-item .info-value { font-size: 15px; font-weight: 500; color: #333; }

/* ========== Quota Progress ========== */
.quota-bar-wrap { margin-top: 8px; }
.quota-bar {
    height: 8px;
    border-radius: 4px;
    background: #f0f0f0;
    overflow: hidden;
    margin-top: 4px;
}
.quota-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.quota-bar-fill.blue  { background: linear-gradient(90deg, #1890ff, #4096ff); }
.quota-bar-fill.green { background: linear-gradient(90deg, #52c41a, #73d13d); }
.quota-bar-fill.red   { background: linear-gradient(90deg, #ff4d4f, #ff7875); }
.quota-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* ========== Upload Type Buttons ========== */
.type-btn-group {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #1890ff;
}
.type-btn-group button {
    flex: 1;
    height: 38px;
    border: none;
    background: #fff;
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 1px solid #d9d9d9;
}
.type-btn-group button:last-child { border-right: none; }
.type-btn-group button:hover { background: #e6f4ff; }
.type-btn-group button.active {
    background: #1890ff;
    color: #fff;
}

/* ========== General buttons ========== */
.btn-primary {
    height: 36px;
    padding: 0 20px;
    border: none;
    border-radius: 6px;
    background: #1890ff;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover { background: #4096ff; }
.btn-primary:disabled { background: #b3d8ff; cursor: not-allowed; }

.btn-outline {
    height: 36px;
    padding: 0 20px;
    border: 1px solid #1890ff;
    border-radius: 6px;
    background: #fff;
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover { background: #e6f4ff; }
.btn-outline:disabled { color: #999; border-color: #d9d9d9; cursor: not-allowed; }

/* ========== SKU Modal scrollbar ========== */
.modal-box::-webkit-scrollbar { width: 6px; }
.modal-box::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 3px; }
