* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #333; }
a { color: #1890ff; text-decoration: none; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; }
.sidebar .logo { padding: 20px; text-align: center; font-size: 18px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .nav-menu { list-style: none; padding: 10px 0; }
.sidebar .nav-menu li { padding: 0; }
.sidebar .nav-menu a { display: block; padding: 12px 24px; color: rgba(255,255,255,.65); transition: all .2s; font-size: 14px; }
.sidebar .nav-menu a:hover, .sidebar .nav-menu a.active { color: #fff; background: #1890ff; }
.main-content { margin-left: 220px; flex: 1; padding: 20px; min-height: 100vh; }

/* Header bar */
.header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.header-bar h2 { font-size: 20px; font-weight: 600; }
.header-bar .actions { display: flex; gap: 10px; align-items: center; }

/* Cards */
.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card .label { font-size: 14px; color: #999; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: bold; color: #1890ff; }
.stat-card .value.warning { color: #faad14; }
.stat-card .value.danger { color: #ff4d4f; }

/* Table */
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
table th { background: #fafafa; font-weight: 600; color: #666; white-space: nowrap; }
table tr:hover { background: #fafafa; }

/* Buttons */
.btn { display: inline-block; padding: 6px 16px; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; font-size: 14px; background: #fff; color: #333; transition: all .2s; line-height: 1.5; }
.btn:hover { border-color: #1890ff; color: #1890ff; }
.btn-primary { background: #1890ff; color: #fff; border-color: #1890ff; }
.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }
.btn-danger { color: #ff4d4f; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff4d4f; color: #fff; }
.btn-success { color: #52c41a; border-color: #52c41a; }
.btn-success:hover { background: #52c41a; color: #fff; }
.btn-warning { color: #faad14; border-color: #faad14; }
.btn-warning:hover { background: #faad14; color: #fff; }
.btn-sm { padding: 2px 8px; font-size: 12px; }
.btn + .btn { margin-left: 6px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #666; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; outline: none; transition: border-color .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,.1); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.form-inline input, .form-inline select { width: auto; padding: 6px 12px; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; padding: 10px 0; }
.pagination .btn { min-width: 32px; text-align: center; }
.pagination .btn.active { background: #1890ff; color: #fff; border-color: #1890ff; }
.pagination .info { font-size: 14px; color: #999; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; justify-content: center; align-items: center; }
.modal { background: #fff; border-radius: 8px; width: 600px; max-width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid #f0f0f0; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { cursor: pointer; font-size: 20px; color: #999; background: none; border: none; line-height: 1; }
.modal-close:hover { color: #333; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; text-align: right; }
.modal-wide { width: 800px; }

/* Tags / Badges */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 1.6; }
.tag-blue { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-red { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.tag-orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.tag-gray { background: #fafafa; color: #999; border: 1px solid #d9d9d9; }
.tag-yellow { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.tag-purple { background: #f9f0ff; color: #722ed1; border: 1px solid #d3adf7; }

/* Login page */
.login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 8px; padding: 40px; width: 400px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.login-box h2 { text-align: center; margin-bottom: 30px; color: #333; }
.login-box .btn-primary { width: 100%; padding: 10px; font-size: 16px; }
.login-error { color: #ff4d4f; font-size: 14px; margin-bottom: 12px; text-align: center; }

/* Image upload */
.image-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.image-item { width: 80px; height: 80px; border: 1px solid #d9d9d9; border-radius: 4px; overflow: hidden; position: relative; }
.image-item img { width: 100%; height: 100%; object-fit: cover; }
.image-item .remove-btn { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.5); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; font-size: 12px; line-height: 18px; text-align: center; }

/* SKU table */
.sku-table { margin-top: 10px; }
.sku-table input { width: 100px; padding: 4px 8px; }
.sku-table .btn-sm { padding: 2px 8px; }

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.empty-tip { text-align: center; padding: 40px; color: #999; font-size: 14px; }

/* Logout */
.sidebar .logout-btn { display: block; padding: 12px 24px; color: rgba(255,255,255,.45); cursor: pointer; font-size: 14px; border: none; background: none; width: 100%; text-align: left; }
.sidebar .logout-btn:hover { color: #ff4d4f; }
