/* === Amber Vendor Dashboard v1.1.0 === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand:        #5C1010;
    --brand-hover:  #7a1515;
    --bg:           #F5F5F5;
    --sidebar-w:    265px;
    --white:        #ffffff;
    --text-dark:    #1a1a1a;
    --text-mid:     #6b6b6b;
    --text-light:   #9b9b9b;
    --border:       #e8e8e8;
    --radius:       12px;
    --radius-sm:    8px;
    --status-blue:  #1a6fbc;
    --status-amber: #c47d17;
    --status-green: #1a8c55;
    --status-red:   #bc1a1a;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif; font-size: 14px; background: var(--bg); color: var(--text-dark); min-height: 100vh; }

/* ── Shell ─────────────── */
.avd-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────── */
.avd-sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.avd-sidebar__logo { padding: 28px 24px 24px; border-bottom: 1px solid var(--border); }
.avd-sidebar__logo img { height: 36px; width: auto; object-fit: contain; object-position: left; }
.avd-nav { padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.avd-nav__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-mid); font-size: 14px; font-weight: 400; transition: background .15s, color .15s; position: relative; }
.avd-nav__item:hover { background: var(--bg); color: var(--text-dark); }
.avd-nav__item--active { background: var(--bg); color: var(--brand); font-weight: 500; }
.avd-nav__item--active svg { stroke: var(--brand); }
.avd-nav__item--logout { color: var(--text-light); }
.avd-nav__item--logout:hover { color: var(--brand); }
.avd-badge { margin-left: auto; background: #e53e3e; color: white; font-size: 11px; font-weight: 600; border-radius: 99px; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.avd-sidebar__footer { padding: 12px 12px 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* ── Main ───────────────────────── */
.avd-main { flex: 1; padding: 40px 40px 60px; display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.avd-main__header { display: flex; flex-direction: column; gap: 4px; }
.avd-main__header--row { flex-direction: row; align-items: flex-start; justify-content: space-between; }
.avd-page-title { font-size: 28px; font-weight: 600; letter-spacing: -.3px; }
.avd-page-subtitle { font-size: 14px; color: var(--text-mid); margin-top: 4px; }
.avd-section-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--text-light); text-transform: uppercase; margin-bottom: 16px; }

/* ── Stat cards ─────────────────── */
.avd-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.avd-stats--3 { grid-template-columns: repeat(3,1fr); }
.avd-stat-card { background: var(--white); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.avd-stat-card__icon { width: 40px; height: 40px; background: var(--brand); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.avd-stat-card__label { font-size: 13px; color: var(--text-mid); }
.avd-stat-card__value { font-size: 26px; font-weight: 600; letter-spacing: -.5px; min-height: 32px; }

/* ── Table ──────────────────────── */
.avd-table-wrap { background: var(--white); border-radius: var(--radius); overflow: hidden; }
.avd-table { width: 100%; border-collapse: collapse; }
.avd-table thead tr { border-bottom: 1px solid var(--border); }
.avd-table th { padding: 14px 20px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-light); letter-spacing: .02em; }
.avd-table td { padding: 16px 20px; font-size: 14px; border-bottom: 1px solid var(--border); }
.avd-table tbody tr:last-child td { border-bottom: none; }
.avd-table tbody tr:hover td { background: #fafafa; }
.avd-table__loading td { text-align: center; color: var(--text-light); padding: 48px; font-size: 14px; }
.avd-table__empty td { text-align: center; color: var(--text-mid); padding: 60px; }

/* ── Status badges ──────────────── */
.avd-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; border: 1px solid currentColor; }
.avd-status--shipped    { color: var(--status-blue);  background: #edf5ff; }
.avd-status--pending    { color: var(--status-amber); background: #fff8ed; }
.avd-status--processing { color: var(--status-amber); background: #fff8ed; }
.avd-status--completed  { color: var(--status-green); background: #edfff5; }
.avd-status--cancelled  { color: var(--status-red);   background: #fff0f0; }
.avd-status--on-hold    { color: var(--text-mid);      background: #f5f5f5; }
.avd-status--paid       { color: var(--status-green); background: #edfff5; }

/* ── Skeleton loader ────────────── */
.avd-skeleton { display: block; background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size: 200% 100%; animation: avd-shimmer 1.4s infinite; border-radius: 4px; }
.avd-stat-card__value .avd-skeleton { width: 60%; height: 28px; }
@keyframes avd-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Buttons ────────────────────── */
.avd-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px; border-radius: 99px; font-size: 13px; font-weight: 600; letter-spacing: .04em; cursor: pointer; border: none; text-decoration: none; transition: background .15s, opacity .15s; }
.avd-btn--primary { background: var(--brand); color: white; }
.avd-btn--primary:hover { background: var(--brand-hover); color: white; }
.avd-btn--dark { background: var(--text-dark); color: white; }
.avd-btn--dark:hover { background: #333; color: white; }
.avd-btn--full { width: 100%; justify-content: center; border-radius: 8px; padding: 14px; }
.avd-btn--wide { min-width: 200px; border-radius: 8px; padding: 14px 32px; }
.avd-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Cards ──────────────────────── */
.avd-card { background: var(--white); border-radius: var(--radius); padding: 28px 32px; margin-bottom: 20px; }

/* ── Forms ──────────────────────── */
.avd-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.avd-form-group label { font-size: 13px; font-weight: 500; color: var(--text-dark); }
.avd-form-group input,
.avd-form-group select,
.avd-form-group textarea { padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 99px; font-size: 14px; color: var(--text-dark); background: var(--white); outline: none; transition: border-color .15s; font-family: inherit; width: 100%; }
.avd-form-group textarea { border-radius: var(--radius-sm); resize: vertical; }
.avd-form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b6b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.avd-form-group input:focus,
.avd-form-group select:focus,
.avd-form-group textarea:focus { border-color: var(--brand); }
.avd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.avd-form-row--spread { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.avd-form-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.avd-form-group--toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.avd-form-group--checkbox label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.avd-form-group--checkbox input { width: auto; }

/* Toggle */
.avd-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.avd-toggle input { opacity: 0; width: 0; height: 0; }
.avd-toggle__slider { position: absolute; inset: 0; background: var(--border); border-radius: 99px; cursor: pointer; transition: background .2s; }
.avd-toggle__slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform .2s; }
.avd-toggle input:checked + .avd-toggle__slider { background: var(--brand); }
.avd-toggle input:checked + .avd-toggle__slider::before { transform: translateX(20px); }

/* Upload area */
.avd-upload-area { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; color: var(--text-light); font-size: 13px; transition: border-color .15s; position: relative; }
.avd-upload-area:hover { border-color: var(--brand); color: var(--brand); }
.avd-upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.avd-upload-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.avd-img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.avd-img-preview__thumb { width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.avd-img-preview__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Input with icon */
.avd-input-wrap { position: relative; }
.avd-input-wrap input { padding-right: 44px; }
.avd-pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-light); padding: 4px; }
.avd-pw-toggle:hover { color: var(--text-dark); }

/* Link */
.avd-link { color: var(--brand); text-decoration: none; font-weight: 500; }
.avd-link:hover { text-decoration: underline; }

/* Alert */
.avd-alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.avd-alert--error { background: #fff0f0; color: var(--status-red); border: 1px solid #ffc9c9; }
.avd-alert--success { background: #edfff5; color: var(--status-green); border: 1px solid #b2f5d8; }

/* ── Product grid ───────────────── */
.avd-product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.avd-product-card { background: var(--white); border-radius: var(--radius); overflow: hidden; }
.avd-product-card__img { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #f0f0f0; }
.avd-product-card--skeleton .avd-product-card__img { animation: avd-shimmer 1.4s infinite; }
.avd-product-card__body { padding: 12px 14px 14px; }
.avd-product-card__name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.avd-product-card__category { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.avd-product-card__price { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.avd-product-card__stock { font-size: 12px; color: var(--text-light); margin-bottom: 12px; }
.avd-product-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.avd-product-card__actions .avd-btn { padding: 6px 14px; font-size: 11px; border-radius: 6px; }
.avd-btn--ghost { background: none; border: 1.5px solid var(--border); color: var(--text-dark); }
.avd-btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.avd-btn--icon { padding: 6px; width: 30px; height: 30px; justify-content: center; }
.avd-btn--danger { background: none; border: 1.5px solid #ffc9c9; color: var(--status-red); }
.avd-btn--danger:hover { background: #fff0f0; }

/* ── Modal ──────────────────────── */
.avd-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.avd-modal { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.avd-modal__header { padding: 24px 28px 0; position: relative; }
.avd-modal__header h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.avd-modal__header p { font-size: 13px; color: var(--text-mid); }
.avd-modal__close { position: absolute; top: 20px; right: 20px; background: none; border: none; cursor: pointer; color: var(--text-mid); padding: 4px; }
.avd-modal__close:hover { color: var(--text-dark); }
.avd-modal__form { padding: 20px 28px 24px; }
.avd-modal__footer { margin-top: 8px; }

/* ── Auth pages ─────────────────── */
.avd-auth-body { background: var(--white); }
.avd-auth-shell { display: flex; height: 100vh; overflow: hidden; }
.avd-auth-photo { width: 45%; flex-shrink: 0; position: relative; overflow: hidden; height: 100vh; }
.avd-auth-photo--dark { background: #111; }
.avd-auth-photo--red { background: #c0392b; }
.avd-auth-photo__img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.avd-auth-photo__brand { position: absolute; top: 24px; left: 24px; }
.avd-auth-photo__brand img { height: 32px; filter: brightness(0) invert(1); }
.avd-auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 40px; height: 100vh; overflow-y: auto; box-sizing: border-box; }
.avd-auth-form { width: 100%; max-width: 420px; }
.avd-auth-title { font-size: 32px; font-weight: 600; letter-spacing: -.5px; margin-bottom: 8px; }
.avd-auth-title em { font-style: italic; font-weight: 400; }
.avd-auth-subtitle { font-size: 14px; color: var(--text-mid); margin-bottom: 32px; }
.avd-auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-mid); }
.avd-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-mid); cursor: pointer; }

/* Category chips */
.avd-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.avd-chip { padding: 6px 16px; border-radius: 99px; font-size: 13px; font-weight: 500; border: 1.5px solid var(--border); background: var(--white); cursor: pointer; color: var(--text-mid); transition: all .15s; }
.avd-chip--active { border-color: var(--brand); background: var(--brand); color: white; }

/* ── Success page ───────────────── */
.avd-success-body { background: var(--white); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.avd-success-wrap { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 400px; padding: 40px 24px; }
.avd-success-logo img { height: 40px; }
.avd-success-icon { position: relative; width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; }
.avd-success-icon__ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #e0e0e0; }
.avd-success-icon__circle { width: 72px; height: 72px; background: #8b7355; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.avd-success-title { font-size: 36px; font-weight: 600; letter-spacing: -.5px; }
.avd-success-title em { font-style: italic; font-weight: 400; }
.avd-success-body-text { font-size: 14px; color: var(--text-mid); line-height: 1.6; }

/* ── Notifications ──────────────── */
.avd-notif-list { display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.avd-notif-item { display: flex; align-items: flex-start; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--border); transition: background .1s; }
.avd-notif-item:last-child { border-bottom: none; }
.avd-notif-item:hover { background: #fafafa; }
.avd-notif-item--unread { background: #fdf8f8; }
.avd-notif-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; margin-top: 6px; }
.avd-notif-item__dot--active { background: var(--brand); }
.avd-notif-item__body { flex: 1; }
.avd-notif-item__msg { font-size: 14px; color: var(--text-dark); line-height: 1.5; margin-bottom: 4px; }
.avd-notif-item--unread .avd-notif-item__msg { font-weight: 500; }
.avd-notif-item__time { font-size: 12px; color: var(--text-light); }
.avd-notif-empty { padding: 60px; text-align: center; color: var(--text-mid); font-size: 14px; }

/* ── Reviews ─────────────────────── */
.avd-product-card--clickable { cursor: pointer; }
.avd-product-card--clickable:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.avd-review-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: white; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.avd-stars { display: flex; align-items: center; gap: 2px; margin-top: 6px; }
.avd-modal--wide { max-width: 660px; }
.avd-reviews-list { padding: 8px 0 16px; max-height: 60vh; overflow-y: auto; }
.avd-review-item { padding: 16px 28px; border-bottom: 1px solid var(--border); }
.avd-review-item:last-child { border-bottom: none; }
.avd-review-item__header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.avd-review-item__author { font-size: 14px; font-weight: 600; }
.avd-review-item__stars { display: flex; gap: 2px; }
.avd-review-item__rating { font-size: 13px; font-weight: 600; color: var(--brand); }
.avd-review-item__date { font-size: 12px; color: var(--text-light); margin-left: auto; }
.avd-review-item__text { font-size: 13px; color: var(--text-mid); line-height: 1.6; }

/* ── Settings ───────────────────── */
.avd-settings-actions { display: flex; align-items: center; gap: 16px; padding-top: 8px; }
.avd-settings-msg { font-size: 13px; }
.avd-settings-msg--ok  { color: var(--status-green); }
.avd-settings-msg--err { color: var(--status-red); }

/* ── Logo ───────────────────────── */
.amber-logo { display: block; }
.amber-logo--sidebar { height: 40px; width: auto; }

/* ── Sidebar subnav ─────────────── */
.avd-subnav { display: none; padding-left: 44px; }
.avd-subnav--open { display: block; }
.avd-subnav__item { display: block; padding: 8px 16px; font-size: 13px; color: var(--text-mid); text-decoration: none; border-radius: var(--radius-sm); }
.avd-subnav__item:hover { background: rgba(255,255,255,.06); color: var(--white); }
.avd-subnav__item--active { color: var(--white); font-weight: 500; }

/* ── Mobile auth override ────────── */
@media (max-width: 768px) {
    .avd-auth-shell { height: auto; overflow: visible; flex-direction: column; }
    .avd-auth-photo { display: none; }
    .avd-auth-form-wrap { height: auto; overflow-y: visible; }
}
