/* SupplierHub — app.css */

:root {
    --brand:       #0F4C81;
    --brand-light: #1A6DBF;
    --brand-dark:  #082E4E;
    --accent:      #F97316;
    --surface:     #F0F4F8;
    --border:      #E8EDF2;
    --text-muted:  #94A3B8;
}

/* ===== NAV ===== */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #93C5FD;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active { background: var(--brand-light); color: #fff; }

/* ===== CARDS ===== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.badge-no_reply      { background: #FEF9C3; color: #854D0E; }
.badge-replied       { background: #DCFCE7; color: #166534; }
.badge-action_needed { background: #FEE2E2; color: #991B1B; }
.badge-sent          { background: #EFF6FF; color: #1D4ED8; }
.badge-failed        { background: #FEE2E2; color: #991B1B; }
.badge-new-reply     { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--brand);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover { background: var(--brand-light); }

.btn-accent {
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-accent:hover { opacity: 0.9; }

.btn-ghost {
    background: transparent;
    border: 1px solid #CBD5E1;
    color: #475569;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}
.btn-ghost:hover { background: #F1F5F9; }

/* ===== FORM INPUTS ===== */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    color: #111827;
    background: #fff;
}
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,76,129,0.1); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
    border-bottom: 1px solid #F0F4F8;
    white-space: nowrap;
}
.data-table td {
    padding: 13px 14px;
    font-size: 0.875rem;
    border-bottom: 1px solid #F8FAFC;
    color: #374151;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFBFF; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #F0F7FF !important; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(8,46,78,0.5);
    display: none; align-items: center; justify-content: center;
    z-index: 50;
    padding: 1rem;
    backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== PAGE TITLE ===== */
.page-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: #0F172A;
    line-height: 1.2;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.375rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    position: relative;
    overflow: hidden;
}
.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.85;
}
.stat-card .stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--brand-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: #64748B;
    font-weight: 500;
}

/* Clickable stat card wrapper */
.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    transition: box-shadow 0.2s, transform 0.15s;
}
.stat-card-link:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.stat-card-link:hover .stat-label { color: var(--brand); }

/* ===== ALERT ===== */
.alert { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.875rem; margin-bottom: 1rem; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* ===== SUPPLIER CHECKBOX LIST ===== */
.supplier-check { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F1F5F9; }
.supplier-check:last-child { border-bottom: none; }
.supplier-check input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; flex-shrink: 0; }

/* ===== CAMPAIGN CARDS ===== */

.camp-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.camp-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.10); }

.camp-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}
.camp-header:hover { background: #F8FAFC; }
.camp-header-body { flex: 1; min-width: 0; }

.camp-subject {
    font-weight: 600;
    font-size: 1.05rem;
    color: #0F172A;
    display: block;
    margin-bottom: 6px;
    line-height: 1.3;
}
.camp-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.camp-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.5rem;
    align-items: center;
}
.camp-meta strong { color: #64748B; font-weight: 500; }

.arrow-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    color: #CBD5E1;
    font-style: normal;
    line-height: 1;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.arrow-icon.rotated { transform: rotate(180deg); }

/* Detail panel — shown by removing Tailwind 'hidden' class via JS */
.camp-detail {
    border-top: 1px solid #F0F4F8;
    padding: 1.5rem;
}

/* "Enquiry Sent" box */
.enquiry-box {
    background: #F8FAFC;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    margin-bottom: 1.125rem;
}
.enquiry-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.enquiry-body {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Section divider with label */
.section-divider {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    margin-top: 1.25rem;
}
.section-divider::after { content: ''; flex: 1; height: 1px; background: #F0F4F8; }

/* Individual supplier cards within a campaign */
.supplier-card {
    background: #FAFBFC;
    border: 1px solid #EEF2F7;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.625rem;
}
.supplier-card:last-child { margin-bottom: 0; }

.supplier-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.supplier-identity { min-width: 0; }
.supplier-name { font-weight: 600; font-size: 0.875rem; color: #111827; }
.supplier-email { font-size: 0.75rem; color: #3B82F6; display: block; margin-top: 1px; }
.supplier-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

/* Inline status update form */
.status-form { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.status-select {
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-family: inherit;
    color: #374151;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}
.status-select:focus { border-color: var(--brand); }
.status-save {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.status-save:hover { background: var(--brand-light); }

/* Supplier reply — styled quote block */
.reply-quote {
    background: #fff;
    border-left: 3px solid #10B981;
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    margin-top: 0.875rem;
}
.reply-quote-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.reply-quote-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #10B981;
}
.reply-quote-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}
.reply-quote-body {
    font-size: 0.875rem;
    color: #1F2937;
    line-height: 1.65;
    white-space: pre-wrap;
}
.reply-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.625rem; }

/* No reply placeholder */
.no-reply-text {
    font-size: 0.78rem;
    color: #CBD5E1;
    font-style: italic;
    margin-top: 0.625rem;
}

/* Attachment pill buttons */
.att-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
    border-radius: 6px;
    padding: 3px 10px;
    text-decoration: none;
    transition: background 0.1s, border-color 0.1s;
    white-space: nowrap;
}
.att-pill:hover { background: #DBEAFE; border-color: #93C5FD; }
.att-pill-green {
    background: #F0FDF4;
    color: #166534;
    border-color: #BBF7D0;
}
.att-pill-green:hover { background: #DCFCE7; }

/* ===== DASHBOARD QUICK LINK CARDS ===== */
.quick-link-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.quick-link-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.09);
    transform: translateY(-2px);
    border-color: #BFDBFE;
}
.quick-link-card .ql-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.quick-link-card .ql-title { font-weight: 700; font-size: 0.9375rem; color: #0F172A; margin-bottom: 0.25rem; }
.quick-link-card .ql-desc { font-size: 0.78rem; color: var(--text-muted); }
.quick-link-card .ql-arrow { font-size: 0.8rem; color: #CBD5E1; float: right; margin-top: -1.6rem; }

/* ===== MOBILE / RESPONSIVE ===== */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--brand-dark);
    align-items: center;
    padding: 0 1rem;
    gap: 12px;
    z-index: 30;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.1); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 18;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 767px) {
    .mobile-topbar { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 20;
        padding-top: 56px;
    }
    .sidebar.open { transform: translateX(0); }
    .modal-box { padding: 1.25rem; border-radius: 12px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .filter-form { flex-direction: column; }
    .filter-form .form-input { width: 100% !important; }
    .supplier-top { flex-direction: column; gap: 0.625rem; }
    .camp-header { padding: 1rem; }
    .camp-detail { padding: 1rem; }
}
