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

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    background: #d4d4d4;
    color: #222;
    line-height: 1.5;
}

a { color: #1a6faf; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
#phq-wrap { min-height: 100vh; display: flex; flex-direction: column; }

#phq-header {
    background: #3c3c3c;
    color: #fff;
    padding: 10px 20px;
}
.phq-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.phq-logo {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.phq-user-info { font-size: 12px; color: #ccc; }
.phq-user-info strong { color: #fff; }

/* ── Navigation ────────────────────────────────────────────────────────────── */
#phq-nav {
    background: #e8e8e8;
    border-bottom: 1px solid #c0c0c0;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    position: relative;
}

.phq-nav-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 12px;
    color: #333;
    background: none;
    border: none;
    border-right: 1px solid #c8c8c8;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.phq-nav-item:hover { background: #d8d8d8; text-decoration: none; color: #000; }

.phq-nav-right { margin-left: auto; border-right: none; border-left: 1px solid #c8c8c8; }

/* Dropdowns */
.phq-nav-dropdown { position: relative; }
.phq-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #bbb;
    min-width: 200px;
    z-index: 999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.phq-nav-dropdown-menu a {
    display: block;
    padding: 8px 14px;
    color: #333;
    font-size: 12px;
    border-bottom: 1px solid #eee;
}
.phq-nav-dropdown-menu a:hover { background: #f0f0f0; text-decoration: none; }
.phq-nav-dropdown.open .phq-nav-dropdown-menu { display: block; }

/* ── Content ────────────────────────────────────────────────────────────────── */
#phq-content {
    background: #fff;
    margin: 16px auto;
    padding: 20px 24px;
    width: 95%;
    max-width: 1200px;
    flex: 1;
}

h1.phq-page-title {
    font-size: 22px;
    font-weight: normal;
    margin-bottom: 16px;
    color: #222;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 5px 14px;
    font-size: 12px;
    background: #e0e0e0;
    border: 1px solid #aaa;
    border-radius: 2px;
    cursor: pointer;
    color: #222;
    text-decoration: none;
}
.btn:hover { background: #d0d0d0; text-decoration: none; }
.btn-primary { background: #1a6faf; color: #fff; border-color: #155a8a; }
.btn-primary:hover { background: #155a8a; color: #fff; }
.btn-danger { background: #b00; color: #fff; border-color: #900; }
.btn-danger:hover { background: #900; color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 11px; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.phq-form-table { width: 100%; border-collapse: collapse; }
.phq-form-table tr { vertical-align: top; }
.phq-form-table th {
    text-align: left;
    padding: 6px 12px 6px 0;
    font-weight: normal;
    width: 220px;
    white-space: nowrap;
}
.phq-form-table td { padding: 4px 0 6px; }

.phq-form-table input[type="text"],
.phq-form-table input[type="email"],
.phq-form-table input[type="password"],
.phq-form-table input[type="number"],
.phq-form-table select,
.phq-form-table textarea {
    width: 240px;
    padding: 4px 6px;
    border: 1px solid #aaa;
    font-size: 12px;
    font-family: inherit;
    border-radius: 2px;
}
.phq-form-table textarea { width: 400px; }
.phq-form-table select { height: 26px; }

.phq-form-actions { margin-top: 14px; }

.phq-notice {
    padding: 8px 14px;
    margin-bottom: 14px;
    border-radius: 2px;
    font-size: 12px;
}
.phq-notice-success { background: #dff0d8; border: 1px solid #a8d58a; color: #3a6e3a; }
.phq-notice-error   { background: #f8d7da; border: 1px solid #e0a0a8; color: #7a2a30; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.phq-table-wrap {
    border: 1px solid #bbb;
    margin-top: 14px;
}
.phq-table-title {
    background: #c8c8c8;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.phq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.phq-table th {
    background: #e4e4e4;
    border: 1px solid #ccc;
    padding: 6px 10px;
    text-align: center;
    font-weight: normal;
    white-space: nowrap;
}
.phq-table td {
    border: 1px solid #ddd;
    padding: 5px 10px;
    vertical-align: middle;
}
.phq-table tr:nth-child(even) td { background: #f9f9f9; }
.phq-table .row-num { text-align: center; width: 32px; color: #888; }

/* Filter row */
.phq-table .filter-row th { background: #f0f0f0; padding: 4px 6px; }
.phq-table .filter-row input,
.phq-table .filter-row select {
    width: 100%;
    padding: 3px 5px;
    font-size: 11px;
    border: 1px solid #bbb;
    border-radius: 2px;
}

/* Pagination */
.phq-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 11px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}
.phq-pagination button {
    padding: 2px 7px;
    font-size: 11px;
    border: 1px solid #bbb;
    background: #e8e8e8;
    cursor: pointer;
    border-radius: 2px;
}
.phq-pagination button:disabled { opacity: 0.4; cursor: default; }
.phq-pagination select { padding: 2px 4px; font-size: 11px; border: 1px solid #bbb; }
.phq-pagination .page-info { margin: 0 4px; }
.phq-pagination .view-info { margin-left: auto; }

/* ── Job type color indicators ──────────────────────────────────────────────── */
.job-type-expedite { color: #c07800; font-weight: bold; }
.job-type-rush     { color: #c00000; font-weight: bold; }

/* ── Dashboard Stats ────────────────────────────────────────────────────────── */
.phq-stats { margin-bottom: 16px; font-size: 13px; }
.phq-stats p { margin-bottom: 4px; }
.phq-stats a { font-weight: bold; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.phq-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}
.phq-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 3px;
    z-index: 1001;
    width: 680px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.phq-modal-inner { padding: 20px; overflow-y: auto; flex: 1; }
.phq-modal-close {
    position: absolute; top: 8px; right: 12px;
    background: none; border: none;
    font-size: 20px; cursor: pointer; color: #555;
}
.phq-modal-footer { padding: 10px 20px; border-top: 1px solid #ddd; text-align: right; }

/* Receipt tables inside modal */
.receipt-table { margin-bottom: 16px; font-size: 13px; }
.receipt-table th { text-align: left; padding-right: 20px; font-weight: bold; }
.receipt-jobs { width: 100%; border-collapse: collapse; font-size: 12px; }
.receipt-jobs th, .receipt-jobs td { border: 1px solid #ddd; padding: 5px 10px; }
.receipt-jobs th { background: #f0f0f0; }
.receipt-jobs tfoot td { font-weight: bold; background: #f9f9f9; }

/* ── Login page ─────────────────────────────────────────────────────────────── */
#phq-login-wrap {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; background: #d4d4d4;
}
.phq-login-box {
    background: #fff;
    border: 1px solid #bbb;
    padding: 30px 36px;
    width: 340px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.phq-login-box h1 { font-size: 20px; margin-bottom: 20px; text-align: center; }
.phq-login-box label { display: block; font-size: 12px; margin-bottom: 2px; }
.phq-login-box input {
    width: 100%; padding: 6px 8px; margin-bottom: 12px;
    border: 1px solid #aaa; font-size: 13px; border-radius: 2px;
}
.phq-login-box .btn { width: 100%; text-align: center; padding: 7px; }

/* ── Preferences form ───────────────────────────────────────────────────────── */
.phq-pref-section { margin-top: 18px; }
.phq-pref-section h3 { font-size: 13px; font-weight: bold; margin-bottom: 8px; border-bottom: 1px solid #ddd; padding-bottom: 4px; }
.phq-pref-question { margin-bottom: 14px; }
.phq-pref-question p { font-size: 12px; margin-bottom: 4px; }
.phq-pref-question label { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 3px; font-size: 12px; cursor: pointer; }
.phq-pref-question input[type="radio"],
.phq-pref-question input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.phq-pref-question textarea { width: 380px; font-size: 12px; padding: 4px 6px; border: 1px solid #aaa; }

/* ── Utility ─────────────────────────────────────────────────────────────────── */
.phq-mb-1 { margin-bottom: 8px; }
.phq-mb-2 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
