:root,
.fi-body {
    --ph-teal: #0f5c5c;
    --ph-teal-deep: #0c3f3c;
    --ph-teal-bright: #1a7a78;
    --ph-coral: #ff6b5e;
    --ph-canvas: #f3efe6;
    --ph-surface: #ffffff;
    --ph-ink: #1a2824;
    --ph-muted: #5c6b66;
    --ph-line: #e4ddd0;
    --ph-sand: #f6f3ec;
    --ph-sidebar: #0c3f3c;
    --ph-topbar: #d8efe4;
    --ph-topbar-ink: #0c3f3c;
    --ph-topbar-line: #b7ddd0;
    --ph-shadow: 0 14px 36px rgba(31, 43, 40, 0.06);
}

html.dark .fi-body {
    --ph-canvas: #14211e;
    --ph-surface: #22302c;
    --ph-ink: #f4f7f6;
    --ph-muted: #c9d5d0;
    --ph-line: rgba(255, 255, 255, 0.12);
    --ph-sand: #2a3935;
    --ph-sidebar: #071615;
    --ph-topbar: #146158;
    --ph-topbar-ink: #f4fffb;
    --ph-topbar-line: rgba(255, 255, 255, 0.12);
    --ph-shadow: none;
}

.fi-panel-admin.fi-body {
    --ph-teal: #1e4e8c;
    --ph-teal-deep: #163a6b;
    --ph-teal-bright: #3b74c4;
    --ph-coral: #1e4e8c;
    --ph-canvas: #eef2f7;
    --ph-surface: #ffffff;
    --ph-ink: #1a2333;
    --ph-muted: #5c6a7c;
    --ph-line: #d7e0eb;
    --ph-sand: #f3f6fa;
    --ph-sidebar: #1a2744;
    --ph-topbar: #d7e6fb;
    --ph-topbar-ink: #163a6b;
    --ph-topbar-line: #c3d6f3;
    --ph-shadow: 0 14px 36px rgba(22, 36, 58, 0.06);
}

html.dark .fi-panel-admin.fi-body {
    --ph-teal: #3b74c4;
    --ph-teal-deep: #d6e4f7;
    --ph-teal-bright: #5b92dc;
    --ph-coral: #8eb4e8;
    --ph-canvas: #121820;
    --ph-surface: #1b2636;
    --ph-ink: #f4f7fb;
    --ph-muted: #c5d0de;
    --ph-line: rgba(255, 255, 255, 0.12);
    --ph-sand: #243044;
    --ph-sidebar: #0c121c;
    --ph-topbar: #1a3d68;
    --ph-topbar-ink: #f4f7fb;
    --ph-topbar-line: rgba(255, 255, 255, 0.12);
    --ph-shadow: none;
}

.fi-panel-staff.fi-body,
.fi-panel-staff .fi-main-ctn {
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(255, 107, 94, 0.14), transparent 46%),
        radial-gradient(720px 380px at -8% 0%, rgba(15, 92, 92, 0.1), transparent 42%),
        var(--ph-canvas);
}

.fi-panel-admin.fi-body,
.fi-panel-admin .fi-main-ctn {
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(30, 78, 140, 0.16), transparent 46%),
        radial-gradient(720px 380px at -8% 0%, rgba(22, 58, 107, 0.08), transparent 42%),
        var(--ph-canvas);
}

html.dark .fi-panel-staff.fi-body,
html.dark .fi-panel-staff .fi-main-ctn {
    background:
        radial-gradient(820px 380px at 100% -10%, rgba(255, 107, 94, 0.12), transparent 44%),
        var(--ph-canvas);
}

html.dark .fi-panel-admin.fi-body,
html.dark .fi-panel-admin .fi-main-ctn {
    background:
        radial-gradient(820px 380px at 100% -10%, rgba(91, 146, 220, 0.18), transparent 44%),
        var(--ph-canvas);
}

.fi-panel-staff .fi-sidebar,
.fi-panel-admin .fi-sidebar,
.fi-panel-staff .fi-sidebar-header,
.fi-panel-staff .fi-sidebar-header-ctn,
.fi-panel-admin .fi-sidebar-header,
.fi-panel-admin .fi-sidebar-header-ctn {
    background: var(--ph-sidebar) !important;
    border-right: 0;
    box-shadow: none;
}

.fi-panel-staff .fi-sidebar .fi-logo,
.fi-panel-admin .fi-sidebar .fi-logo,
.fi-panel-staff .fi-sidebar-item-label,
.fi-panel-admin .fi-sidebar-item-label,
.fi-panel-staff .fi-sidebar-item-icon,
.fi-panel-admin .fi-sidebar-item-icon,
.fi-panel-staff .fi-sidebar-group-label,
.fi-panel-admin .fi-sidebar-group-label,
.fi-panel-staff .fi-sidebar .fi-icon-btn,
.fi-panel-admin .fi-sidebar .fi-icon-btn {
    color: #f4fffb !important;
}

.fi-panel-staff .fi-sidebar-item-label,
.fi-panel-admin .fi-sidebar-item-label,
.fi-panel-staff .fi-sidebar-item-icon,
.fi-panel-admin .fi-sidebar-item-icon {
    color: rgba(244, 255, 251, 0.82) !important;
}

.fi-panel-staff .fi-sidebar-item-btn,
.fi-panel-admin .fi-sidebar-item-btn {
    border-radius: 12px;
}

.fi-panel-staff .fi-sidebar-item-btn:hover,
.fi-panel-staff .fi-sidebar-item-btn:focus-visible,
.fi-panel-admin .fi-sidebar-item-btn:hover,
.fi-panel-admin .fi-sidebar-item-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.fi-panel-staff .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-panel-admin .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--ph-coral);
    box-shadow: none;
}

.fi-panel-staff .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-panel-staff .fi-sidebar-item.fi-active .fi-sidebar-item-icon,
.fi-panel-admin .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-panel-admin .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #ffffff !important;
}

.fi-panel-admin .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: #d7e6fb;
}

.fi-panel-admin .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-panel-admin .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #163a6b !important;
}

html.dark .fi-panel-admin .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: #2f5f9e;
}

html.dark .fi-panel-admin .fi-sidebar-item.fi-active .fi-sidebar-item-label,
html.dark .fi-panel-admin .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #f4f7fb !important;
}

.fi-panel-admin .fi-btn.fi-color-primary {
    background-color: #1e4e8c !important;
    color: #ffffff !important;
}

.fi-panel-admin .fi-btn.fi-color-primary:hover {
    background-color: #163a6b !important;
    color: #ffffff !important;
}

html.dark .fi-panel-admin .fi-btn.fi-color-primary {
    background-color: #3b74c4 !important;
    color: #ffffff !important;
}

html.dark .fi-panel-admin .fi-btn.fi-color-primary:hover {
    background-color: #5b92dc !important;
    color: #ffffff !important;
}

.fi-panel-staff .fi-topbar-ctn,
.fi-panel-admin .fi-topbar-ctn,
.fi-panel-staff .fi-topbar,
.fi-panel-admin .fi-topbar {
    background: var(--ph-topbar) !important;
    border-bottom: 1px solid var(--ph-topbar-line);
    box-shadow: none !important;
    backdrop-filter: none;
    color: var(--ph-topbar-ink);
}

.fi-panel-staff .fi-sidebar .fi-logo,
.fi-panel-admin .fi-sidebar .fi-logo {
    color: #f4fffb !important;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.fi-panel-staff .fi-topbar .fi-logo,
.fi-panel-admin .fi-topbar .fi-logo {
    color: var(--ph-topbar-ink) !important;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.fi-panel-staff .fi-topbar .fi-icon-btn,
.fi-panel-staff .fi-topbar .fi-icon-btn .fi-icon,
.fi-panel-admin .fi-topbar .fi-icon-btn,
.fi-panel-admin .fi-topbar .fi-icon-btn .fi-icon,
.fi-panel-staff .fi-topbar .fi-topbar-database-notifications-btn,
.fi-panel-admin .fi-topbar .fi-topbar-database-notifications-btn {
    color: var(--ph-topbar-ink) !important;
}

html.dark .fi-panel-staff .fi-topbar .fi-icon-btn:hover,
html.dark .fi-panel-staff .fi-topbar .fi-icon-btn:focus-visible,
html.dark .fi-panel-admin .fi-topbar .fi-icon-btn:hover,
html.dark .fi-panel-admin .fi-topbar .fi-icon-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12) !important;
}

.fi-panel-staff .fi-topbar .fi-icon-btn:hover,
.fi-panel-staff .fi-topbar .fi-icon-btn:focus-visible {
    background: rgba(12, 63, 60, 0.08) !important;
}

.fi-panel-admin .fi-topbar .fi-icon-btn:hover,
.fi-panel-admin .fi-topbar .fi-icon-btn:focus-visible {
    background: rgba(22, 58, 107, 0.08) !important;
}

.fi-panel-staff .fi-header-heading,
.fi-simple-header-heading {
    letter-spacing: -0.03em;
    color: var(--ph-ink);
}

.fi-panel-staff .fi-header-subheading,
.fi-simple-header-subheading {
    color: var(--ph-muted);
}

.fi-panel-staff .fi-simple-layout {
    background:
        radial-gradient(900px 480px at 0% 0%, rgba(255, 107, 94, 0.2), transparent 46%),
        radial-gradient(800px 520px at 100% 0%, rgba(15, 92, 92, 0.16), transparent 42%),
        var(--ph-canvas) !important;
}

.fi-panel-admin .fi-simple-layout {
    background:
        radial-gradient(900px 480px at 0% 0%, rgba(30, 78, 140, 0.2), transparent 46%),
        radial-gradient(800px 520px at 100% 0%, rgba(22, 58, 107, 0.14), transparent 42%),
        var(--ph-canvas) !important;
}

html.dark .fi-panel-staff .fi-simple-layout {
    background:
        radial-gradient(900px 480px at 0% 0%, rgba(255, 107, 94, 0.18), transparent 46%),
        radial-gradient(800px 520px at 100% 0%, rgba(15, 92, 92, 0.45), transparent 42%),
        #0d1a18 !important;
}

html.dark .fi-panel-admin .fi-simple-layout {
    background:
        radial-gradient(900px 480px at 0% 0%, rgba(91, 146, 220, 0.22), transparent 46%),
        radial-gradient(800px 520px at 100% 0%, rgba(30, 78, 140, 0.4), transparent 42%),
        #0d1218 !important;
}

.fi-simple-main {
    background: var(--ph-surface) !important;
    color: var(--ph-ink);
    border: 1px solid var(--ph-line) !important;
    border-radius: 24px !important;
    box-shadow: var(--ph-shadow);
}

.fi-panel-staff .fi-wi-stats-overview-stat {
    background: var(--ph-surface) !important;
    color: var(--ph-ink);
    border: 1px solid var(--ph-line) !important;
    border-radius: 18px !important;
    box-shadow: var(--ph-shadow);
}

.fi-panel-staff .fi-wi-stats-overview-stat-label {
    color: var(--ph-muted) !important;
}

.fi-panel-staff .fi-wi-stats-overview-stat-value {
    color: var(--ph-ink) !important;
    letter-spacing: -0.04em;
}

.ph-auth-lead,
.ph-help,
.ph-muted,
.ph-label {
    color: var(--ph-muted);
}

.ph-auth-lead,
.ph-help {
    margin: 0 0 14px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ph-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ph-req {
    color: #e5484d;
    font-weight: 700;
}

.ph-wrap {
    max-width: 32rem;
    margin: 0;
    width: 100%;
}

.ph-card,
.ph-history-stat,
.ph-history-item,
.ph-history-empty,
.ph-list-item {
    background: var(--ph-surface);
    color: var(--ph-ink);
    border: 1px solid var(--ph-line);
    box-shadow: var(--ph-shadow);
}

.ph-card,
.ph-history-item,
.ph-history-empty {
    border-radius: 18px;
}

.ph-card {
    padding: 1.35rem 1.4rem;
}

.ph-list-item,
.ph-history-stat {
    border-radius: 14px;
}

.ph-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--ph-line);
    background: var(--ph-surface);
    color: var(--ph-ink);
    margin-bottom: 12px;
}

.ph-input::placeholder {
    color: var(--ph-muted);
}

.ph-input:focus {
    outline: 2px solid color-mix(in srgb, var(--ph-teal) 55%, white);
    outline-offset: 1px;
    border-color: var(--ph-teal);
}

.ph-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.ph-btn:focus-visible {
    outline: 2px solid var(--ph-teal-bright);
    outline-offset: 2px;
}

.ph-btn-primary {
    background: var(--ph-teal);
    color: #ffffff;
}

.ph-btn-primary:hover {
    background: var(--ph-teal-deep);
}

html.dark .ph-btn-primary {
    background: var(--ph-teal-bright);
}

html.dark .ph-btn-primary:hover {
    background: #23918e;
}

.ph-btn-secondary {
    background: var(--ph-sand);
    color: var(--ph-ink);
    margin-top: 12px;
}

.ph-btn-danger {
    background: transparent;
    color: #e5484d;
    border-color: #e5484d;
    margin-top: 12px;
}

.ph-btn-danger:hover {
    background: rgba(229, 72, 77, 0.08);
}

.ph-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.ph-actions .ph-btn {
    margin-top: 0;
}

.ph-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ph-list-item {
    padding: 12px 14px;
}

.ph-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1rem;
}

.ph-borrower {
    border-radius: 12px;
    padding: 12px 14px;
    margin: 14px 0 0;
    background: var(--ph-sand);
    color: var(--ph-ink);
}

.ph-error {
    color: #e5484d;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.ph-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.ph-badge-ok {
    background: rgba(47, 174, 106, 0.14);
    color: #1f8a52;
}

.ph-badge-warn {
    background: rgba(242, 169, 59, 0.18);
    color: #9a6408;
}

html.dark .ph-badge-ok {
    color: #86efac;
}

html.dark .ph-badge-warn {
    color: #fcd34d;
}

.ph-history {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ph-history-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ph-history-stat {
    padding: 10px 12px;
    border-radius: 12px;
}

.ph-history-stat span,
.ph-history-meta span {
    display: block;
    color: var(--ph-muted);
    font-size: 0.8125rem;
}

.ph-history-stat strong,
.ph-history-brand,
.ph-history-meta strong,
.ph-scan-title,
.ph-code {
    color: var(--ph-ink);
}

.ph-history-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.ph-history-item {
    padding: 10px 14px;
    border-radius: 12px;
}

.ph-history-empty {
    padding: 28px 16px;
}

.ph-history-top,
.ph-history-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ph-history-meta {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--ph-line);
}

.ph-when-end {
    text-align: right;
}

.ph-history-brand,
.ph-scan-title {
    margin: 0;
    font-weight: 700;
}

.ph-history-meta strong {
    display: block;
    margin-top: 2px;
    font-size: 0.875rem;
    font-weight: 700;
}

.ph-when strong {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.ph-when em {
    display: block;
    margin-top: 2px;
    color: var(--ph-muted);
    font-style: normal;
    font-size: 0.8125rem;
}

.ph-history-notes {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--ph-sand);
    color: var(--ph-ink);
    font-size: 0.875rem;
}

.ph-history-item > .ph-btn {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 0.8125rem;
}

.ph-history-top .ph-badge {
    flex-shrink: 0;
    align-self: flex-start;
}

.ph-tone-returned {
    background: #e7f6ee;
    border-color: #b7e4c9;
}

.ph-tone-waiting {
    background: #fff6df;
    border-color: #f0ddb0;
}

.ph-tone-open {
    background: #fdecec;
    border-color: #f3c9cb;
}

.ph-tone-returned .ph-badge {
    background: rgba(255, 255, 255, 0.72);
    color: #1f8a52;
}

.ph-tone-waiting .ph-badge {
    background: rgba(255, 255, 255, 0.72);
    color: #9a6408;
}

.ph-tone-open .ph-badge {
    background: rgba(255, 255, 255, 0.72);
    color: #b42318;
}

.ph-tone-returned .ph-history-meta {
    border-top-color: rgba(31, 138, 82, 0.22);
}

.ph-tone-waiting .ph-history-meta {
    border-top-color: rgba(154, 100, 8, 0.22);
}

.ph-tone-open .ph-history-meta {
    border-top-color: rgba(180, 35, 24, 0.18);
}

.ph-tone-returned .ph-history-notes,
.ph-tone-waiting .ph-history-notes,
.ph-tone-open .ph-history-notes {
    background: rgba(255, 255, 255, 0.55);
}

html.dark .ph-tone-returned {
    background: rgba(47, 174, 106, 0.18);
    border-color: rgba(134, 239, 172, 0.32);
}

html.dark .ph-tone-waiting {
    background: rgba(242, 169, 59, 0.16);
    border-color: rgba(252, 211, 77, 0.32);
}

html.dark .ph-tone-open {
    background: rgba(229, 72, 77, 0.16);
    border-color: rgba(252, 165, 165, 0.32);
}

html.dark .ph-tone-returned .ph-badge {
    background: rgba(0, 0, 0, 0.28);
    color: #86efac;
}

html.dark .ph-tone-waiting .ph-badge {
    background: rgba(0, 0, 0, 0.28);
    color: #fcd34d;
}

html.dark .ph-tone-open .ph-badge {
    background: rgba(0, 0, 0, 0.28);
    color: #fca5a5;
}

html.dark .ph-tone-returned .ph-history-notes,
html.dark .ph-tone-waiting .ph-history-notes,
html.dark .ph-tone-open .ph-history-notes {
    background: rgba(0, 0, 0, 0.18);
}

.ph-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--ph-surface);
    border: 1px solid var(--ph-line);
}

.ph-pager-btn {
    width: auto;
    margin-top: 0;
    padding: 7px 12px;
    font-size: 0.8125rem;
}

.ph-pager-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.ph-pager-status {
    color: var(--ph-muted);
    font-size: 0.8125rem;
    font-weight: 700;
}

.ph-history-empty {
    text-align: center;
    padding: 32px 20px;
}

.ph-kicker {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ph-coral);
}

.ph-scan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
    border-radius: 20px;
    background: var(--ph-surface);
    color: var(--ph-ink);
    border: 1px solid var(--ph-line);
    box-shadow: var(--ph-shadow);
}

.ph-scan-card .ph-muted {
    margin: 6px 0 0;
    max-width: 36rem;
}

.ph-ask {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.ph-ask .ph-muted {
    margin: 6px 0 0;
    max-width: 40rem;
}

.ph-input-short {
    padding: 6px 10px;
    margin-bottom: 8px;
}

textarea.ph-input {
    min-height: 44px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.ph-scan-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--ph-coral);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 107, 94, 0.28);
}

.ph-scan-btn:hover {
    filter: brightness(0.96);
}

.ph-scan-btn:focus-visible {
    outline: 2px solid var(--ph-ink);
    outline-offset: 3px;
}

.ph-scan-icon {
    width: 22px;
    height: 22px;
}

.ph-code-card {
    margin: 0 0 16px;
    padding: 16px;
    border-radius: 16px;
    text-align: center;
    background: color-mix(in srgb, var(--ph-teal) 8%, var(--ph-surface));
    border: 1px dashed var(--ph-line);
}

.ph-code {
    margin: 4px 0 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.ph-code-card .ph-help {
    margin: 0;
    text-align: left;
}

#qr-reader {
    max-width: 100%;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
}

.ph-report {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ph-report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4px 16px;
}

.ph-field .ph-input {
    margin-bottom: 0;
}

.ph-report-note {
    margin-top: 14px;
}

.ph-report-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.ph-report-actions .ph-btn {
    margin-top: 0;
}

.ph-btn-outline {
    background: transparent;
    color: var(--ph-teal);
    border-color: var(--ph-teal);
}

.ph-btn-outline:hover {
    background: color-mix(in srgb, var(--ph-teal) 8%, transparent);
}

.ph-report-actions .ph-muted {
    margin: 0;
}

.ph-btn.ph-btn-inline {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
}

.ph-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

html.dark .ph-input {
    color-scheme: dark;
}

.ph-report-table-wrap {
    overflow: auto;
    max-height: 34rem;
    background: var(--ph-surface);
    border: 1px solid var(--ph-line);
    border-radius: 18px;
    box-shadow: var(--ph-shadow);
}

.ph-report-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ph-ink);
    font-size: 0.875rem;
}

.ph-report-table th,
.ph-report-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--ph-line);
}

.ph-report-table th {
    position: sticky;
    top: 0;
    background: var(--ph-sand);
    color: var(--ph-ink);
    font-weight: 700;
    white-space: nowrap;
}

.ph-report-table td {
    max-width: 280px;
    overflow-wrap: anywhere;
}

.ph-report-table tbody tr:hover td {
    background: color-mix(in srgb, var(--ph-teal) 6%, var(--ph-surface));
}

.ph-kew-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.ph-kew-title,
.ph-kew-code {
    margin: 0;
    color: var(--ph-ink);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.ph-kew-title {
    font-size: 0.95rem;
    line-height: 1.35;
}

.ph-kew-code {
    font-size: 0.95rem;
    white-space: nowrap;
}

.ph-kew-year {
    display: inline-flex;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid var(--ph-line);
    border-radius: 4px;
    color: var(--ph-ink);
    font-size: 0.8rem;
    font-weight: 700;
}

.ph-kew-year span {
    padding: 4px 12px;
}

.ph-kew-year span:first-child {
    background: var(--ph-sand);
    border-right: 1px solid var(--ph-line);
}

.ph-kew-table {
    min-width: 1080px;
    font-size: 0.78rem;
}

.ph-kew-table th,
.ph-kew-table td {
    vertical-align: middle;
    border: 1px solid var(--ph-line);
}

.ph-kew-table th {
    background: #d6e6f5;
    color: #163a6b;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.ph-kew-table .is-type,
.ph-kew-table .is-serial {
    font-weight: 700;
}

.ph-kew-table .is-serial {
    white-space: pre-line;
}

.ph-kew-table .is-date,
.ph-kew-table .is-qty {
    text-align: center;
    white-space: nowrap;
}

.ph-kew-table .is-form,
.ph-kew-table th.is-form {
    width: 52px;
    text-align: center;
    white-space: nowrap;
}

.ph-kew-pdf {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 18px;
    padding: 0 6px;
    border: 1px solid #9f1d1d;
    border-radius: 3px;
    background: #c62828;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
}

.ph-kew-pdf:hover {
    background: #a61f1f;
}

.ph-kew-pdf:focus-visible {
    outline: 2px solid var(--ph-teal-bright);
    outline-offset: 2px;
}

.ph-kew-pdf:disabled {
    opacity: 0.55;
    cursor: wait;
}

.ph-kew-table .is-date {
    min-width: 92px;
}

html.dark .ph-kew-table th {
    background: #1e3a5f;
    color: #e7f0fb;
}

@media (max-width: 720px) {
    .ph-scan-card {
        flex-direction: column;
        align-items: stretch;
    }

    .ph-scan-btn,
    .ph-actions {
        width: 100%;
    }

    .ph-actions {
        grid-template-columns: 1fr;
    }

    .ph-history-stat span {
        font-size: 0.75rem;
    }

    .ph-history-stat strong {
        font-size: 1.2rem;
    }
}
