/* Art Contact — AC Customer. Same look as the Foxtrot portfolio builder (foxtrot/assets/style.css). */

:root {
    --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: #dbeafe;
    --success: #16a34a; --success-light: #dcfce7;
    --warning: #f59e0b; --warning-light: #fef3c7;
    --info: #0891b2; --info-light: #cffafe;
    --danger: #dc2626; --danger-light: #fee2e2;
    --suggest: #ea580c; --suggest-light: #fff7ed;
    --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-300: #d1d5db;
    --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563; --gray-700: #374151;
    --gray-800: #1f2937; --gray-900: #111827; --white: #ffffff;
    --accent: #64C814; --accent-dark: #4ea30f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --radius-sm: 0.375rem; --radius: 0.5rem; --radius-lg: 0.75rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--gray-800);
    background: var(--gray-50);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }

/* ---------- Sign in (same card as AC Artist) ---------- */
.auth-view {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: #f6f7f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
}
.login-card {
    background: #fff; border: 1px solid #e3e3e3; border-radius: 10px;
    padding: 40px 36px; width: 100%; max-width: 400px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.07); text-align: center;
}
.login-logo { height: 56px; margin-bottom: 14px; }
.login-card h1 { font-size: 1.5em; font-weight: 600; margin-bottom: 4px; color: #222; }
.login-sub { color: #555; font-size: 0.95em; margin-bottom: 24px; }
.auth-form { text-align: left; }
.auth-form label { display: block; font-size: 0.85em; font-weight: 600; margin: 14px 0 4px; }
.auth-form input { width: 100%; padding: 10px 12px; border: 1px solid #e3e3e3; border-radius: 6px; }
.auth-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.auth-form button[type="submit"] {
    width: 100%; margin-top: 22px; padding: 11px;
    background: var(--accent); border: none; border-radius: 6px; color: #fff; font-weight: 600;
}
.auth-form button[type="submit"]:hover { background: var(--accent-dark); }
.auth-form button[type="submit"]:disabled { opacity: 0.6; cursor: wait; }
.login-extra { margin-top: 16px; text-align: center; }
.link-btn { background: none; border: none; color: var(--accent-dark); text-decoration: underline; font-size: 0.9em; }

.form-msg { font-size: 0.9em; margin: 12px 0 0; }
.form-msg.ok { color: var(--success); }
.form-msg.bad { color: var(--danger); }

/* ---------- Header ---------- */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.6rem 1rem;
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 20;
    flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 0.6rem; color: var(--gray-900); text-decoration: none; }
.logo img { height: 34px; width: auto; display: block; }
.logo-text {
    font-size: 0.95rem; font-weight: 500; color: var(--gray-500);
    border-left: 1px solid var(--gray-200); padding-left: 0.75rem; line-height: 1.2;
}
.logo-text span { color: var(--gray-400); font-weight: 400; font-size: 0.82rem; margin-left: 0.35rem; }
.header-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.header-actions > span { display: inline-flex; align-items: center; gap: 0.4rem; }
.header-sep { width: 1px; height: 22px; background: var(--gray-200); margin: 0 0.15rem; }
.hdr-user { font-size: 0.78rem; color: var(--gray-500); }
.staff-banner {
    background: var(--warning-light); color: #92400e; font-size: 0.8rem;
    padding: 0.4rem 1rem; border-bottom: 1px solid #fde68a;
}

/* ---------- Buttons & badges ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.7rem; border-radius: var(--radius);
    font-size: 0.8rem; font-weight: 500; border: 1px solid transparent;
    white-space: nowrap; line-height: 1.4; text-decoration: none; background: none;
}
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #15803d; }
.btn-outline { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover:not(:disabled) { background: var(--gray-50); }
.btn-ghost { color: var(--gray-500); }
.btn-ghost:hover { color: var(--gray-800); }
.btn-suggest-outline { background: var(--white); color: var(--suggest); border-color: var(--suggest); }
.btn:disabled { background: var(--gray-100); color: var(--gray-400); border-color: var(--gray-200); cursor: not-allowed; }
.btn.is-active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

.mode-switch {
    display: inline-flex; border: 1px solid var(--gray-300); border-radius: var(--radius);
    overflow: hidden; font-size: 0.75rem; font-weight: 600;
}
.mode-switch span { padding: 0.3rem 0.6rem; color: var(--gray-500); background: var(--white); }
.mode-switch span.on { background: var(--gray-800); color: var(--white); }
.mode-switch.locked span.on::before {
    content: "\f023"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 0.3rem; font-size: 0.65rem;
}

.item-badge { display: inline-block; font-size: 0.68rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.badge-text { background: var(--info-light); color: var(--info); }
.badge-ok { background: var(--success-light); color: var(--success); }
.badge-warn { background: var(--warning-light); color: #b45309; }
.badge-grey { background: var(--gray-100); color: var(--gray-600); }
.badge-suggest { background: var(--suggest); color: var(--white); font-weight: 600; }
.badge-pick { background: var(--suggest-light); color: var(--suggest); border: 1px solid #fed7aa; }

/* ---------- Pages ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.page-wide { max-width: 1400px; }
.page-title { font-size: 1.3rem; font-weight: 600; color: var(--gray-900); }
.page-sub { color: var(--gray-500); margin: 0.2rem 0 1rem; }
.muted-icon { color: var(--gray-400); margin-right: 0.4rem; }
.accent-icon { color: var(--primary); margin-right: 0.35rem; }

.card {
    background: var(--white); border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
    padding: 0.7rem 1rem; border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    background: var(--gray-50);
}
.card-header h3 { font-size: 0.88rem; font-weight: 600; color: var(--gray-800); }

/* My portfolios */
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.dash-section-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; }
.dot-wip { background: var(--warning); }
.dot-done { background: var(--success); }
.dash-card {
    display: flex; gap: 0.75rem; align-items: center;
    padding: 0.65rem 1rem; border-bottom: 1px solid var(--gray-100);
    text-decoration: none; color: inherit;
}
.dash-card:last-child { border-bottom: 0; }
.dash-card:hover { background: var(--gray-50); }
.dash-thumb {
    width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--gray-100);
    flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--gray-400);
}
.dash-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dash-card strong { font-size: 0.88rem; color: var(--gray-900); margin-right: 0.3rem; }
.dash-card small { display: block; font-size: 0.75rem; color: var(--gray-500); margin-top: 0.1rem; }
.dash-empty { padding: 1rem; color: var(--gray-500); font-size: 0.82rem; }

/* Portfolio (builder layout) */
.build-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1rem; align-items: start; }
.portfolio-info { padding: 0.8rem 1rem; border-bottom: 1px solid var(--gray-100); background: var(--primary-light); }
.port-number-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: var(--primary); color: var(--white);
    padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; margin-bottom: 0.4rem;
}
.customer-name { font-size: 0.98rem; font-weight: 600; color: var(--gray-900); }
.portfolio-title { font-size: 0.78rem; color: var(--gray-500); }
.portfolio-total {
    padding: 0.6rem 1rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; flex-wrap: wrap;
}
.total-label { font-size: 0.8rem; color: var(--gray-600); font-weight: 600; }
.items-list { list-style: none; padding: 0.5rem; max-height: calc(100vh - 260px); overflow-y: auto; }
.portfolio-item {
    display: flex; align-items: stretch; gap: 0.6rem; padding: 0.6rem; margin-bottom: 0.45rem;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); cursor: pointer;
}
.portfolio-item:hover { border-color: var(--gray-300); }
.portfolio-item.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary-light), var(--shadow); }
.portfolio-item.suggested { border: 2px solid var(--suggest); }
.portfolio-item.suggested.active { background: var(--suggest-light); box-shadow: 0 0 0 2px #fed7aa, var(--shadow); }
.portfolio-item.text-item { cursor: default; background: var(--gray-50); }
.item-number {
    display: flex; align-items: center; justify-content: center; align-self: center;
    width: 24px; height: 24px; background: var(--gray-100); color: var(--gray-600);
    border-radius: 50%; font-size: 0.7rem; font-weight: 600; flex-shrink: 0;
}
.item-thumb {
    width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
    background: var(--gray-100); display: flex; align-items: center; justify-content: center; color: var(--gray-400);
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-details { flex: 1; min-width: 0; }
.item-name { font-size: 0.8rem; font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-artist { font-size: 0.74rem; color: var(--gray-500); }
.item-price { font-size: 0.8rem; font-weight: 600; color: var(--success); }
.item-price.muted, .artwork-price.muted { color: var(--gray-400); font-weight: 500; font-style: italic; }
.item-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.text-body { font-size: 0.78rem; color: var(--gray-600); white-space: pre-line; max-height: 4.5em; overflow: hidden; }

.detail-panel { padding: 1rem 1.1rem; }
.detail-header { display: flex; gap: 1.25rem; align-items: flex-start; }
.detail-image {
    width: 52%; max-width: 560px; min-height: 220px; overflow: hidden;
    background: var(--white); flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--gray-100);
}
.detail-image img { max-width: 100%; max-height: 70vh; height: auto; display: block; }
.detail-image .no-image { font-size: 2rem; color: var(--gray-300); padding: 3rem; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h2 { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.15rem; }
.detail-subtitle { font-size: 0.82rem; color: var(--gray-500); margin-bottom: 0.8rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.detail-field { background: var(--gray-50); padding: 0.45rem 0.65rem; border-radius: var(--radius-sm); border: 1px solid var(--gray-100); }
.detail-field label { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-400); font-weight: 600; }
.detail-field div { font-size: 0.84rem; color: var(--gray-800); font-weight: 500; }
.detail-field div.price-total { color: var(--success, #16a34a); font-weight: 700; }
.framing-section { margin-top: 1.5rem; }
.framing-section h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; color: var(--gray-800); display: flex; align-items: center; gap: 0.5rem; }
.framing-section h3 i { color: var(--primary); }
.framing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.5rem; }
.framing-grid .wide { grid-column: 1 / -1; }
.detail-note { margin-top: 0.75rem; font-size: 0.82rem; color: var(--gray-600); white-space: pre-line; }
.detail-empty { color: var(--gray-500); padding: 2rem 0; text-align: center; }
.suggest-note {
    margin-top: 0.75rem; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
    background: var(--suggest-light); border: 1px solid #fed7aa; color: #9a3412; font-size: 0.8rem;
}

/* Browse */
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-200); background: var(--white);
}
.modal-head h2 { font-size: 1.05rem; font-weight: 600; color: var(--gray-900); }
.modal-body { padding: 1rem; background: var(--white); }
.search-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
.form-control {
    border: 1px solid var(--gray-300); border-radius: var(--radius); padding: 0.42rem 0.6rem;
    font-size: 0.82rem; color: var(--gray-700); background: var(--white); min-width: 0;
}
.search-box { display: flex; align-items: center; gap: 0.4rem; }
.search-box i { color: var(--gray-400); }
.search-box input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 0.82rem; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.35rem 0 0.75rem; }
.chip {
    font-size: 0.74rem; padding: 0.22rem 0.65rem; border-radius: 999px;
    border: 1px solid var(--gray-300); color: var(--gray-600); background: var(--white);
}
.chip.on { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.results-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--gray-500); margin-bottom: 0.6rem; }
.results-meta select { margin-left: 0.3rem; }
.artwork-search-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; }
.artwork-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.artwork-card.added { border: 2px solid var(--suggest); }
.artwork-image {
    height: 170px; background: var(--white); display: flex; align-items: center; justify-content: center;
    overflow: hidden; cursor: zoom-in; border-bottom: 1px solid var(--gray-100);
}
.artwork-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.artwork-info { padding: 0.5rem 0.6rem 0.6rem; display: flex; flex-direction: column; flex: 1; }
.artwork-name { font-size: 0.8rem; font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artwork-artist { font-size: 0.74rem; color: var(--gray-500); }
.artwork-size { font-size: 0.7rem; color: var(--gray-400); }
.artwork-price { font-size: 0.8rem; font-weight: 600; color: var(--success); margin-top: 0.15rem; }
.artwork-card .btn { margin-top: auto; width: 100%; justify-content: center; }
.artwork-card .artwork-price + .btn, .artwork-card .artwork-price ~ .btn { margin-top: 0.45rem; }
.empty { text-align: center; color: var(--gray-500); padding: 2rem; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; font-size: 0.82rem; color: var(--gray-500); }

/* Modals */
.modal {
    position: fixed; inset: 0; background: rgba(17,24,39,0.55); z-index: 50;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-box {
    background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 980px;
    max-height: 92vh; overflow-y: auto; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.modal-narrow { max-width: 560px; }
.modal-close {
    position: absolute; top: 0.4rem; right: 0.6rem; background: none; border: 0;
    font-size: 1.6rem; color: var(--gray-400); line-height: 1; z-index: 2;
}
.modal-close:hover { color: var(--gray-800); }
.dialog-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-900); margin-bottom: 0.6rem; }
.dialog-title i { color: var(--primary); }
.terms-box {
    background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 0.75rem 0.9rem; margin: 0.75rem 0; font-size: 0.84rem; color: var(--gray-700);
}
.terms-box p + p { margin-top: 0.5rem; }
.tick { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.tick input { margin-top: 0.2rem; width: 1rem; height: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

.toast {
    position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
    background: var(--gray-900); color: var(--white); padding: 0.55rem 1rem; border-radius: var(--radius);
    font-size: 0.84rem; box-shadow: var(--shadow); z-index: 60;
}
.toast.bad { background: var(--danger); }

@media (max-width: 1280px) {
    .hide-md { display: none !important; }
}

@media (max-width: 900px) {
    .build-layout, .dash { grid-template-columns: 1fr; }
    .items-list { max-height: none; }
    .detail-header { flex-direction: column; }
    .detail-image { width: 100%; max-width: none; }
    .search-row { grid-template-columns: 1fr 1fr; }
    .search-box { grid-column: 1 / -1; }
    .hide-sm { display: none !important; }
}
.btn-suggest-outline:disabled { background: var(--suggest-light); color: var(--suggest); border-color: #fed7aa; cursor: default; }
