/* ============================================================
   Fieldnotes — Stylesheet
   Location: /home1/jandijew/app.fieldnotes.jandijewelry.com/assets/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ------------------------------------------------------------
   CSS Variables
   ------------------------------------------------------------ */
:root {
    --bg:           #f7f5f2;
    --surface:      #ffffff;
    --surface-alt:  #f0ede8;
    --border:       #e0dbd3;
    --border-strong:#c8c0b5;

    --text:         #1a1714;
    --text-mid:     #5a5550;
    --text-muted:   #9c958e;

    --accent:       #2a2017;
    --accent-warm:  #8b6914;
    --accent-light: #f5eddc;

    --self-tint:    #eef6f0;
    --self-border:  #b8d9c0;
    --self-text:    #2d6b3f;

    --green:        #2d6b3f;
    --red:          #8b2020;
    --amber:        #7a5010;
    --amber-bg:     #fdf3e0;
    --red-bg:       #fdf0f0;
    --green-bg:     #eef6f0;

    --running-color:#1a5c8b;
    --running-bg:   #e8f2fa;

    --radius:       6px;
    --radius-lg:    10px;
    --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);

    --nav-height:   56px;
    --font-serif:   'DM Serif Display', Georgia, serif;
    --font-sans:    'DM Sans', system-ui, sans-serif;
    --font-mono:    'DM Mono', 'Courier New', monospace;
}

/* ------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-warm); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background: var(--accent);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-logo {
    color: var(--accent-warm);
    font-size: 14px;
}

.nav-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

.nav-link.active {
    color: #ffffff;
    background: rgba(255,255,255,0.12);
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.nav-user {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    font-family: var(--font-mono);
}

/* ------------------------------------------------------------
   Main Content
   ------------------------------------------------------------ */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ------------------------------------------------------------
   Alerts / Flash Messages
   ------------------------------------------------------------ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--self-border);
}

.alert-error {
    background: var(--red-bg);
    color: var(--red);
    border-color: #e8b8b8;
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}
.btn-primary:hover { background: #3d3228; border-color: #3d3228; }

.btn-ghost {
    background: transparent;
    color: var(--text-mid);
    border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-alt); }

.btn-full { width: 100%; justify-content: center; }

.btn-sm {
    padding: 5px 11px;
    font-size: 0.8125rem;
}

.btn-approve {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--self-border);
}
.btn-approve:hover { background: #ddf0e4; }

.btn-flag {
    background: var(--amber-bg);
    color: var(--amber);
    border-color: #e8d0a0;
}
.btn-flag:hover { background: #faecd0; }

.btn-exclude {
    background: var(--red-bg);
    color: var(--red);
    border-color: #e8b8b8;
}
.btn-exclude:hover { background: #fae4e4; }

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group--wide { grid-column: span 2; }

.form-group--checkbox {
    justify-content: flex-end;
    padding-bottom: 4px;
}

.form-group--checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-mid);
}

input[type="text"],
input[type="url"],
input[type="password"],
select,
textarea {
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 3px rgba(139,105,20,0.12);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.add-form-wrap { margin-bottom: 24px; }

/* ------------------------------------------------------------
   Table
   ------------------------------------------------------------ */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
}

.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: #faf8f5; }

.row-self { background: var(--self-tint); }
.row-self:hover { background: #e4f0e7 !important; }

.retailer-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.retailer-url {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ------------------------------------------------------------
   Badges
   ------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-self {
    background: var(--self-tint);
    color: var(--self-text);
    border: 1px solid var(--self-border);
}

.badge-pending {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid #e8d0a0;
    text-decoration: none;
}

.badge-pending:hover {
    background: #faecd0;
    text-decoration: none;
}

/* ------------------------------------------------------------
   Status Dots
   ------------------------------------------------------------ */
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.status-running  { background: var(--running-color); animation: pulse 1.2s infinite; }
.status-pending  { background: var(--amber); }
.status-complete { background: var(--green); }
.status-error    { background: var(--red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ------------------------------------------------------------
   Filter Bar (Staging)
   ------------------------------------------------------------ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-form { display: flex; align-items: center; gap: 8px; }

.filter-select {
    width: auto;
    padding: 7px 11px;
    font-size: 0.875rem;
}

.status-tabs {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
}

.status-tab {
    padding: 5px 13px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-mid);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
}

.status-tab:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.status-tab.active { background: var(--accent); color: #ffffff; }

.tab-count {
    background: rgba(0,0,0,0.12);
    border-radius: 99px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-tab.active .tab-count { background: rgba(255,255,255,0.2); }

/* ------------------------------------------------------------
   Product Grid (Staging)
   ------------------------------------------------------------ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: var(--shadow-md); }

.product-img-wrap {
    position: relative;
    aspect-ratio: 1;
    background: var(--surface-alt);
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img { transform: scale(1.03); }

.img-placeholder, .img-missing {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface-alt);
}

.product-retailer-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(26,23,20,0.75);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 99px;
    backdrop-filter: blur(4px);
}

.product-retailer-badge.badge-self {
    background: rgba(45,107,63,0.85);
    color: #ffffff;
    border: none;
}

.product-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.35;
}

.product-title a { color: var(--text); }
.product-title a:hover { color: var(--accent-warm); text-decoration: none; }

.product-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-price {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.tag {
    background: var(--surface-alt);
    color: var(--text-mid);
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 99px;
    border: 1px solid var(--border);
}

.tag-more {
    background: var(--accent-light);
    color: var(--accent-warm);
    border-color: #e0cfa0;
}

.staging-note {
    font-size: 0.8rem;
    color: var(--amber);
    background: var(--amber-bg);
    padding: 6px 9px;
    border-radius: var(--radius);
    margin-top: 2px;
}

.product-actions {
    padding: 10px 14px 14px;
    display: flex;
    gap: 6px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ------------------------------------------------------------
   Utility
   ------------------------------------------------------------ */
.text-muted { color: var(--text-muted); font-size: 0.875rem; }

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.empty-state p + p { margin-top: 8px; }

/* ------------------------------------------------------------
   Login Page
   ------------------------------------------------------------ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(139,105,20,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(139,105,20,0.08) 0%, transparent 50%);
}

.login-wrap {
    width: 100%;
    max-width: 400px;
    padding: 24px;
}

.login-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
    font-family: var(--font-mono);
}

.login-box .form-group { margin-bottom: 16px; }
.login-box .btn-full { margin-top: 8px; padding: 11px 16px; font-size: 0.9375rem; }
.login-box .alert { margin-bottom: 20px; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 768px) {
    .main-content { padding: 20px 16px 48px; }
    .top-nav { padding: 0 16px; gap: 16px; }
    .nav-user { display: none; }
    .form-group--wide { grid-column: span 1; }
    .page-header { flex-direction: column; align-items: stretch; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .data-table { font-size: 0.8125rem; }
    .data-table th, .data-table td { padding: 10px 12px; }
}
