/* PADUCHU CAFE - admin panel styles */
:root {
  --brand: #b5461f;
  --brand-dark: #8a3216;
  --sidebar-bg: #4a3a2f;
  --sidebar-bg-hover: #5f4c3d;
  --sidebar-text: #ecdfd0;
  --bg: #f6f3ee;
  --border: #e2dccf;
  --text: #2c2420;
  --muted: #77695f;
  --success: #2e7d32;
  --error: #c62828;
  --info: #1565c0;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar { background: var(--sidebar-bg); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; }
.admin-topbar-brand span { color: #d8a88f; font-weight: normal; }
.admin-topbar-user { display: flex; align-items: center; gap: 14px; }
.admin-topbar-user span { color: var(--sidebar-text); }

.store-status-toggle { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 16px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.store-status-toggle.is-open { background: #e8f5e9; color: #2e7d32; }
.store-status-toggle.is-paused { background: #fdecea; color: #c62828; }
.store-status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.inline-filter-form { display: flex; gap: 10px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.inline-filter-form input[type="text"], .inline-filter-form select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.inline-filter-form input[type="text"] { min-width: 200px; }

.order-status-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.order-status-pill { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 16px; text-align: center; }
.order-status-pill strong { display: block; font-size: 26px; color: var(--brand-dark); }
.order-status-pill span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.admin-body { display: flex; flex: 1; }
.admin-sidebar { width: 220px; background: var(--sidebar-bg); padding: 20px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; padding: 11px 24px; color: var(--sidebar-text); font-size: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--sidebar-bg-hover); color: #fff; text-decoration: none; border-left: 3px solid var(--brand); }
.sidebar-group-label { padding: 16px 24px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8a8177; }
.sidebar-group summary.sidebar-group-label { padding: 14px 24px; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; user-select: none; }
.sidebar-group summary.sidebar-group-label::-webkit-details-marker { display: none; }
.sidebar-group summary.sidebar-group-label::after { content: "▸"; font-size: 10px; transition: transform .15s ease; flex-shrink: 0; margin-left: 8px; }
.sidebar-group summary.sidebar-group-label:hover { color: #fff; }
.sidebar-group[open] summary.sidebar-group-label::after { transform: rotate(90deg); }
.staff-mode-banner { background: #fff3e0; border-bottom: 1px solid #ffe0b2; padding: 10px 24px; font-size: 13px; color: #7a4a00; }
.admin-content { flex: 1; padding: 28px 32px; }

.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.content-header h1 { margin: 0; font-size: 24px; }

.btn { display: inline-block; padding: 9px 18px; border-radius: 6px; font-weight: 600; border: none; cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-secondary { background: #e6e0d6; color: var(--text); }
.btn-secondary:hover { text-decoration: none; background: #dbd3c5; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.admin-table th { background: #f0ebe2; font-weight: 600; }
.admin-table tfoot td { border-bottom: none; }
.deliver-to-cell { line-height: 1.6; min-width: 200px; }
.deliver-to-cell a { color: var(--brand); font-weight: 600; }
.text-right { text-align: right; }

.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.thumb-lg { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 8px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; background: #eee; }
.badge-success { background: #e8f5e9; color: var(--success); }
.badge-danger { background: #fdecea; color: var(--error); }
.badge-muted { background: #eee; color: var(--muted); }

.actions-cell a, .actions-cell form { display: inline-block; margin-right: 10px; }
.actions-cell form { margin: 0 0 0 10px; }
.link-danger { background: none; border: none; color: var(--error); cursor: pointer; font-size: 14px; padding: 0; text-decoration: underline; }

.admin-form { max-width: 640px; background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.color-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.color-setting-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.color-setting-item label { font-size: 13px; font-weight: 600; }
.color-setting-item input[type="color"] { width: 40px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.admin-form.inline-form { max-width: 480px; margin-top: 14px; }
.admin-form label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; }
.admin-form input[type=text], .admin-form input[type=email], .admin-form input[type=tel], .admin-form input[type=number],
.admin-form input[type=password], .admin-form select, .admin-form textarea, .admin-form input[type=file] {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-weight: normal !important; margin-top: 8px !important; }
.muted { color: var(--muted); font-size: 13px; }

.attribute-groups { display: flex; flex-direction: column; gap: 14px; margin: 10px 0; }
.attribute-group { background: #f6f3ee; padding: 12px; border-radius: 6px; }
.gallery-preview { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.gallery-item { text-align: center; }

.filter-bar { margin-bottom: 16px; }
.filter-bar a { display: inline-block; padding: 6px 14px; margin-right: 8px; border-radius: 16px; background: #fff; border: 1px solid var(--border); color: var(--text); font-size: 13px; }
.filter-bar a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.inline-status-form select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn { background: none; border: none; padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-btn .tab-badge { display: inline-block; background: var(--border); color: var(--text); font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-left: 6px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.sticky-save-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 14px 0; margin-top: 20px; display: flex; gap: 10px; align-items: center; z-index: 5; }
.ajax-status { font-size: 13px; margin-left: 8px; }
.ajax-status.success { color: #2e7d32; }
.ajax-status.error { color: #c62828; }
.variant-table-wrap { background: #f6f3ee; padding: 16px; border-radius: 8px; margin-top: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card.highlight { border-top: 3px solid var(--brand); }
.stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--brand-dark); }
.stat-label { font-size: 13px; color: var(--muted); }

/* Dashboard polish: quick actions, mini sales chart, alerts, top products */
.quick-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-action-card { background: #fff; border-radius: 10px; padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); color: var(--text); font-weight: 600; font-size: 13px; display: block; }
.quick-action-card:hover { background: var(--bg); text-decoration: none; }
.quick-action-card .qa-icon { font-size: 22px; display: block; margin-bottom: 6px; }

.mini-chart { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin: 10px 0; }
.mini-chart-bar { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 3px; }
.mini-chart-bar:hover { background: var(--brand-dark); }
.mini-chart-labels { display: flex; gap: 6px; }
.mini-chart-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }

.alert-widget { background: #fff3e0; border-left: 4px solid #e65100; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; font-size: 13px; }
.alert-widget a { font-weight: 700; }
.alert-widget.ok { background: #e8f5e9; border-left-color: #2e7d32; }

.hub-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.hub-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px; text-decoration: none; color: inherit; display: block; transition: border-color .15s, box-shadow .15s; }
.hub-card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.hub-card h3 { margin: 0 0 8px; font-size: 15px; color: var(--brand-dark); }
.hub-card-count { font-size: 26px; font-weight: 700; margin: 0; color: var(--text); }
.hub-card-count span { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.hub-card-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.hub-card-highlight { border-color: #e65100; background: #fff8f3; }

.top-products-list { list-style: none; padding: 0; margin: 0; }
.top-products-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.top-products-list li:last-child { border-bottom: none; }
.top-products-list .tp-rank { display: inline-block; width: 22px; height: 22px; background: var(--bg); border-radius: 50%; text-align: center; line-height: 22px; font-weight: 700; font-size: 11px; margin-right: 8px; }

.dash-section-header { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 10px; }
.dash-section-header h2 { margin: 0; font-size: 17px; }
.range-toggle { display: flex; gap: 4px; }
.range-toggle a { padding: 5px 12px; border-radius: 14px; font-size: 12px; background: #fff; border: 1px solid var(--border); color: var(--text); }
.range-toggle a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.plan-card { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border: 2px solid transparent; position: relative; display: flex; flex-direction: column; }
.plan-card h3 { margin: 0 0 6px; font-size: 18px; }
.plan-card-current { border-color: var(--brand); }
.plan-card-featured { background: linear-gradient(180deg, #fff8f0 0%, #fff 100%); }
.plan-badge { position: absolute; top: -10px; right: 16px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }
.plan-price { font-size: 26px; font-weight: 800; color: var(--brand-dark); margin: 8px 0; }
.plan-price .muted { font-size: 13px; font-weight: 400; }
.plan-features { list-style: none; padding: 0; margin: 14px 0; flex: 1; }
.plan-features li { padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.plan-features li:first-child { border-top: none; }
.btn-block { width: 100%; text-align: center; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.detail-card { background: #fff; padding: 18px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.detail-card h3 { margin-top: 0; font-size: 15px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e8f5e9; color: var(--success); }
.alert-error { background: #ffebee; color: var(--error); }
.alert-info { background: #e3f2fd; color: var(--info); }

body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar-bg); }
.login-box { background: #fff; padding: 36px; border-radius: 10px; width: 340px; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.login-box h1 { margin: 0 0 4px; font-size: 22px; color: var(--brand-dark); }

/* Seller split-screen login */
body.seller-login-page { margin: 0; min-height: 100vh; display: flex; }
.seller-login-brand { flex: 1.1; background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand) 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.seller-login-brand::before { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: rgba(255,255,255,.06); top: -150px; right: -150px; }
.seller-login-brand::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.05); bottom: -120px; left: -100px; }
.seller-login-brand-inner { position: relative; z-index: 1; max-width: 440px; }
.seller-login-brand h1 { font-size: 32px; margin: 0 0 12px; }
.seller-login-brand p { font-size: 16px; opacity: .9; line-height: 1.6; }
.seller-login-stats { display: flex; gap: 28px; margin-top: 40px; }
.seller-login-stats div strong { display: block; font-size: 24px; }
.seller-login-stats div span { font-size: 12px; opacity: .8; }
.seller-login-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.seller-login-form-box { width: 100%; max-width: 360px; }
.seller-login-form-box h2 { font-size: 24px; margin: 0 0 6px; }
.seller-login-form-box .muted { margin-bottom: 24px; }
.seller-login-form-box label { font-size: 13px; font-weight: 600; }
.seller-login-form-box input { width: 100%; box-sizing: border-box; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; margin: 6px 0 16px; font-size: 14px; }
.seller-login-form-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(181,70,31,.12); }
@media (max-width: 800px) {
  body.seller-login-page { flex-direction: column; }
  .seller-login-brand { padding: 36px 28px; flex: none; }
  .seller-login-form-side { padding: 32px 24px; }

  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: 8px 0; }
  .admin-content { padding: 18px 16px; }
  .admin-topbar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .content-header { flex-wrap: wrap; gap: 10px; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .inline-filter-form { flex-direction: column; align-items: stretch; }
  .inline-filter-form select, .inline-filter-form input[type="text"] { min-width: 0; width: 100%; }
  .color-settings-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
