/* ========== Login ========== */
.login-body { background: linear-gradient(135deg, #f5ede4, #ede3d6); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 400px; padding: 0 20px; }
.login-card { background: #fff; border-radius: 12px; padding: 40px 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 24px; color: #2c2c2c; margin-bottom: 8px; }
.login-header p { font-size: 14px; color: #999; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; color: #333; background: #fafafa; transition: border-color 0.2s; outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #c8956a; background: #fff; }
.btn-primary { background: #c8956a; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; transition: background 0.2s; }
.btn-primary:hover { background: #b07d55; }
.btn-primary.btn-block { width: 100%; }
.btn-secondary { background: #f0ece6; color: #666; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 15px; transition: background 0.2s; margin-left: 12px; }
.btn-secondary:hover { background: #e0dbd5; }
.login-msg { text-align: center; margin-top: 12px; font-size: 13px; height: 18px; }
.login-footer { text-align: center; margin-top: 20px; }
.login-footer a { color: #c8956a; text-decoration: none; font-size: 13px; }

/* ========== Admin Layout ========== */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #2c2c2c; color: #fff; flex-shrink: 0; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar-header { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h2 { font-size: 17px; color: #fff; }
.sidebar-nav { padding: 12px 0; }
.nav-item { display: block; padding: 12px 20px; color: #aaa; text-decoration: none; font-size: 14px; transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(200,149,106,0.2); color: #c8956a; border-left: 3px solid #c8956a; }
.nav-item.logout { color: #e74c3c; margin-top: 20px; }
.main-content { flex: 1; margin-left: 220px; background: #f4f2ef; min-height: 100vh; padding: 28px 32px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.panel-header h2 { font-size: 20px; color: #2c2c2c; }

/* Filter bar */
.filter-bar { display: flex; gap: 10px; }
.filter-bar select { padding: 7px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; background: #fff; color: #555; outline: none; }

/* Table */
.table-wrapper { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: #f8f6f3; padding: 12px 16px; text-align: left; color: #666; font-weight: 600; border-bottom: 1px solid #eee; }
.data-table td { padding: 12px 16px; color: #444; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.data-table td img { width: 60px; height: 45px; object-fit: cover; border-radius: 4px; display: block; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-badge.up { background: #e8f5e9; color: #2e7d32; }
.status-badge.down { background: #fce4ec; color: #c62828; }
.action-btn { padding: 4px 10px; border-radius: 5px; border: none; cursor: pointer; font-size: 12px; margin-right: 6px; transition: opacity 0.15s; }
.action-btn:hover { opacity: 0.8; }
.action-btn.edit { background: #e3f2fd; color: #1565c0; }
.action-btn.del { background: #fce4ec; color: #c62828; }
.action-btn.toggle { background: #fff8e1; color: #f57f17; }

/* Form */
.admin-form { background: #fff; border-radius: 10px; padding: 28px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); max-width: 700px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.upload-area { border: 2px dashed #ddd; border-radius: 8px; padding: 20px; text-align: center; position: relative; }
.upload-area input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-area p { color: #999; font-size: 13px; margin: 0; }

/* Multi-Image List */
.uploaded-images { margin-top: 0; }
.image-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.image-item { position: relative; width: 100px; height: 80px; border-radius: 6px; overflow: hidden; border: 2px solid #e8e6e3; transition: border-color 0.2s; }
.image-item.is-cover { border-color: #e94560; }
.image-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-item-actions { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; }
.image-action { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; font-size: 10px; cursor: pointer; transition: background 0.2s; line-height: 1; }
.image-action:hover { background: rgba(0,0,0,0.8); }
.image-action.cover-btn.active { background: #e94560; }
.image-action.delete-btn:hover { background: #e74c3c; }
.cover-badge { position: absolute; bottom: 0; left: 0; right: 0; background: #e94560; color: #fff; font-size: 10px; text-align: center; padding: 1px 0; }

.upload-preview { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.upload-preview img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.upload-preview span { font-size: 12px; color: #888; word-break: break-all; }
.form-actions { margin-top: 20px; display: flex; align-items: center; }
.form-msg { margin-top: 12px; font-size: 13px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 180px; }
    .main-content { margin-left: 180px; padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
}
