/* =====================================================
   Job Manager Pro — Client Portal Styles
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
    --jmp-brand:    #1e3a5f;
    --jmp-bg:       #f4f6f9;
    --jmp-surface:  #ffffff;
    --jmp-border:   #e2e8f0;
    --jmp-text:     #1a202c;
    --jmp-muted:    #718096;
    --jmp-radius:   8px;
    --jmp-shadow:   0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
}

.jmp-portal * { box-sizing: border-box; }
.jmp-portal { font-family: 'DM Sans', sans-serif; color: var(--jmp-text); background: var(--jmp-bg); min-height: 60vh; padding: 24px; }

/* ─── Header ─────────────────────────────────────── */
.jmp-portal-header {
    background: var(--jmp-surface);
    border-radius: var(--jmp-radius);
    box-shadow: var(--jmp-shadow);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.jmp-portal-logo img { max-height: 50px; }
.jmp-company-name { font-size: 22px; font-weight: 700; color: var(--jmp-brand); }
.jmp-portal-title { flex: 1; }
.jmp-portal-title h2 { font-size: 18px; font-weight: 700; color: var(--jmp-brand); margin: 0 0 2px; }
.jmp-portal-title p  { font-size: 13px; color: var(--jmp-muted); margin: 0; }
.jmp-portal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Buttons ─────────────────────────────────────── */
.jmp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.jmp-btn-primary { background: var(--jmp-brand); color: #fff; border-color: var(--jmp-brand); }
.jmp-btn-primary:hover { filter: brightness(1.1); color: #fff; }
.jmp-btn-ghost { background: transparent; color: var(--jmp-brand); border-color: var(--jmp-border); }
.jmp-btn-ghost:hover { background: var(--jmp-bg); }
.jmp-btn-sm { padding: 5px 12px; font-size: 12px; }

/* ─── Filter bar ──────────────────────────────────── */
.jmp-filters {
    background: var(--jmp-surface);
    border-radius: var(--jmp-radius);
    box-shadow: var(--jmp-shadow);
    padding: 14px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.jmp-input, .jmp-select {
    padding: 8px 12px;
    border: 1.5px solid var(--jmp-border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--jmp-text);
    background: var(--jmp-bg);
    transition: border-color .15s;
}
.jmp-input:focus, .jmp-select:focus {
    outline: none;
    border-color: var(--jmp-brand);
    background: #fff;
}
.jmp-input { min-width: 200px; flex: 1; }

/* ─── Stats ───────────────────────────────────────── */
.jmp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.jmp-stat-card {
    background: var(--jmp-surface);
    border-radius: var(--jmp-radius);
    box-shadow: var(--jmp-shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 4px solid var(--jmp-brand);
}
.jmp-stat-alert { border-left-color: #ef4444; }
.jmp-stat-num { font-size: 28px; font-weight: 700; color: var(--jmp-brand); font-family: 'DM Mono', monospace; }
.jmp-stat-alert .jmp-stat-num { color: #ef4444; }
.jmp-stat-label { font-size: 12px; color: var(--jmp-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }

/* ─── Table ───────────────────────────────────────── */
.jmp-table-wrap {
    background: var(--jmp-surface);
    border-radius: var(--jmp-radius);
    box-shadow: var(--jmp-shadow);
    overflow-x: auto;
}
.jmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.jmp-table thead th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--jmp-muted);
    border-bottom: 1px solid var(--jmp-border);
    white-space: nowrap;
}
.jmp-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.jmp-table tbody tr:last-child td { border-bottom: none; }
.jmp-table tbody tr:hover td { background: #f8fafc; }
.jmp-job-title { font-weight: 600; color: var(--jmp-brand); }
.jmp-comment-cell { max-width: 200px; color: var(--jmp-muted); }
.jmp-center { text-align: center; }

/* ─── Badge ───────────────────────────────────────── */
.jmp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
}

/* ─── Empty state ─────────────────────────────────── */
.jmp-empty {
    background: var(--jmp-surface);
    border-radius: var(--jmp-radius);
    padding: 60px 24px;
    text-align: center;
    color: var(--jmp-muted);
    font-size: 15px;
}

/* ─── Modal ───────────────────────────────────────── */
.jmp-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.jmp-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); }
.jmp-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: jmpModalIn .2s ease;
}
@keyframes jmpModalIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.jmp-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: #f1f5f9;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.jmp-modal-close:hover { background: #e2e8f0; }

/* ─── Job Detail (modal content) ─────────────────── */
.jmp-detail-title { font-size: 22px; font-weight: 700; color: var(--jmp-brand); margin-bottom: 10px; }
.jmp-detail-badges { margin-bottom: 20px; }
.jmp-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--jmp-border); border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.jmp-detail-field { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
.jmp-detail-field:nth-child(odd) { border-right: 1px solid #f1f5f9; }
.jmp-detail-full { grid-column: 1 / -1 !important; }
.jmp-detail-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--jmp-muted); margin-bottom: 3px; }
.jmp-detail-value { font-size: 14px; color: var(--jmp-text); }
.jmp-detail-checklists h3 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--jmp-muted); margin-bottom: 12px; }
.jmp-checklist-view { border: 1px solid var(--jmp-border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.jmp-cl-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--jmp-border); font-size: 13px; font-weight: 600; }
.jmp-cl-progress { font-size: 12px; color: var(--jmp-muted); font-family: 'DM Mono', monospace; }
.jmp-cl-bar { height: 4px; background: #e2e8f0; }
.jmp-cl-fill { height: 100%; background: #10b981; transition: width .4s; }
.jmp-checklist-view ul { list-style: none; padding: 0; margin: 0; }
.jmp-checklist-view li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #f9fafb; font-size: 13px; }
.jmp-checklist-view li:last-child { border-bottom: none; }
.jmp-checklist-view li.done { color: var(--jmp-muted); text-decoration: line-through; }
.jmp-cl-check { font-size: 14px; flex-shrink: 0; color: #10b981; }
.jmp-detail-footer { margin-top: 24px; display: flex; gap: 10px; }

/* ─── Login ───────────────────────────────────────── */
.jmp-login-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.jmp-login-card { background: var(--jmp-surface); border-radius: 12px; box-shadow: var(--jmp-shadow); padding: 40px 36px; max-width: 400px; width: 100%; text-align: center; }
.jmp-login-logo { margin-bottom: 20px; }
.jmp-login-logo img { max-height: 60px; }
.jmp-login-logo h2 { font-size: 20px; font-weight: 700; color: var(--jmp-brand); }
.jmp-login-card h3 { font-size: 20px; font-weight: 700; color: var(--jmp-text); margin-bottom: 6px; }
.jmp-login-card p  { color: var(--jmp-muted); font-size: 14px; margin-bottom: 20px; }
.jmp-login-card .login-username label,
.jmp-login-card .login-password label { text-align: left; display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--jmp-muted); margin-bottom: 4px; }
.jmp-login-card input[type="text"],
.jmp-login-card input[type="password"] { width: 100%; padding: 10px 12px; border: 1.5px solid var(--jmp-border); border-radius: 6px; font-size: 14px; font-family: inherit; }
.jmp-login-card input[type="submit"] { width: 100%; padding: 12px; background: var(--jmp-brand); color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 16px; font-family: inherit; }
.jmp-login-card input[type="submit"]:hover { filter: brightness(1.1); }

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
    .jmp-portal { padding: 12px; }
    .jmp-portal-header { flex-direction: column; align-items: flex-start; }
    .jmp-detail-grid { grid-template-columns: 1fr; }
    .jmp-detail-field:nth-child(odd) { border-right: none; }
}

/* ─── Submit job form ─────────────────────────────── */
.jmp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.jmp-form-field { display: flex; flex-direction: column; gap: 5px; }
.jmp-form-full  { grid-column: 1 / -1; }
.jmp-form-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--jmp-muted);
}
.jmp-required { color: #ef4444; }
.jmp-form-input {
    padding: 10px 12px;
    border: 1.5px solid var(--jmp-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--jmp-text);
    background: #fff;
    transition: border-color .15s;
    width: 100%;
}
.jmp-form-input:focus {
    outline: none;
    border-color: var(--jmp-brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--jmp-brand) 12%, transparent);
}
textarea.jmp-form-input { resize: vertical; min-height: 90px; }

/* Pending pill */
.jmp-pending-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #fef3c720;
    color: #d97706;
    border: 1px solid #fde68a;
}

@media (max-width: 600px) {
    .jmp-form-grid { grid-template-columns: 1fr; }
    .jmp-form-full  { grid-column: 1; }
}

/* ─── Photo upload zone ───────────────────────────── */
.jmp-upload-zone {
    border: 2px dashed var(--jmp-border);
    border-radius: 8px;
    background: #f8fafc;
    transition: border-color .2s, background .2s;
    cursor: pointer;
    min-height: 80px;
}
.jmp-upload-zone.drag-over {
    border-color: var(--jmp-brand);
    background: #eef2ff;
}
.jmp-upload-zone.has-files {
    border-style: solid;
    border-color: #10b981;
    background: #f0fdf4;
    cursor: default;
}
.jmp-upload-prompt {
    padding: 20px;
    text-align: center;
    color: var(--jmp-muted);
    font-size: 13px;
}
.jmp-upload-prompt p { margin: 4px 0; }
.jmp-upload-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}
.jmp-upload-link {
    background: none;
    border: none;
    color: var(--jmp-brand);
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}
.jmp-upload-link:hover { opacity: .8; }

/* Thumbnail previews */
.jmp-upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
}
.jmp-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.jmp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.jmp-thumb-name {
    display: none; /* hidden; accessible via title attr if needed */
}
.jmp-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
}
.jmp-thumb-remove:hover { background: #ef4444; }
