/*
    File Name: agent-area.css
    Shared styles for the agent area: Admin Control Panel, Register New Agent, My Settings.
    Everything is scoped under .agent-area so the rest of the site is unaffected.
*/

.agent-area { font-size: 13px; line-height: 1.5; color: #4a4a4a; }
.agent-area [hidden] { display: none !important; }
.agent-area *, .agent-area *::before, .agent-area *::after { box-sizing: border-box; }
.agent-area .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Navigation tabs */
.agent-area ul.agent-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; padding: 0; list-style: none; border: 0; border-bottom: 2px solid #004786; }
.agent-area .agent-nav li { list-style: none; background: none; margin: 0; padding: 0; border: 0; }
.agent-area .agent-nav a { display: block; padding: 6px 12px; color: #004786; text-decoration: none; border-radius: 3px 3px 0 0; }
.agent-area .agent-nav a:hover { background: #eef3f8; }
.agent-area .agent-nav a[aria-current="page"] { background: #004786; color: #fff; }

/* Page heading */
.agent-area h1 { font-size: 26px; line-height: 32px; color: #004786; padding-bottom: 4px; }
.agent-area .lead { margin: 0 0 18px; padding: 0; color: #666; }
.agent-area .page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.agent-area .page-head .btn { margin: 2px 0 16px; }

/* Alerts */
.agent-area .form-alert { border-radius: 4px; padding: 12px 16px; margin: 0 0 18px; border-left: 4px solid; }
.agent-area .form-alert:focus { outline: 2px solid #1c77b0; outline-offset: 2px; }
.agent-area .form-alert h2 { font-size: 16px; line-height: 22px; padding: 0 0 4px; color: inherit; font-weight: bold; border: 0; background: none; }
.agent-area .form-alert p { margin: 0; padding: 0; border: 0; background: none; }
.agent-area .form-alert ul { margin: 4px 0 0 18px; padding: 0; border: 0; }
.agent-area .form-alert li { list-style: disc; background: none; padding: 0; margin: 2px 0; border: 0; }
.agent-area .form-alert a { color: inherit; text-decoration: underline; }
.agent-area .form-alert a.btn { color: #004786; text-decoration: none; }
.agent-area .form-alert .actions { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.agent-area .form-alert--error { background: #fdf0ee; border-color: #c0392b; color: #8e2a1f; }
.agent-area .form-alert--success { background: #eef8f0; border-color: #2e8b57; color: #1f5e3b; }
.agent-area .form-alert--warning { background: #fff8e6; border-color: #d9a400; color: #6b5200; }

/* Form layout */
.agent-area fieldset, .agent-area .panel { border: 1px solid #dde3e9; border-radius: 4px; margin: 0 0 16px; padding: 4px 16px 8px; background: #fff; }
.agent-area legend { font-family: 'Trebuchet MS', Arial, sans-serif; font-size: 15px; font-weight: bold; color: #004786; padding: 0 6px; margin-left: -6px; }
.agent-area .panel-title { font-family: 'Trebuchet MS', Arial, sans-serif; font-size: 18px; line-height: 24px; color: #004786; font-weight: bold; padding: 10px 0 2px; border: 0; background: none; }
.agent-area .panel-intro { margin: 0 0 6px; padding: 0; color: #666; }
.agent-area .row { display: flex; flex-wrap: wrap; gap: 0 14px; }
.agent-area .row.keep { flex-wrap: nowrap; }
.agent-area .row.keep .field { flex: 1 1 0; }
.agent-area .field { flex: 1 1 100%; margin: 8px 0; min-width: 0; }
.agent-area .w-3-4 { flex: 3 1 0; }
.agent-area .w-1-4, .agent-area .w-1-2, .agent-area .w-1-3 { flex: 1 1 0; }
.agent-area label, .agent-area .label { display: block; font-weight: bold; color: #333; margin-bottom: 3px; }
.agent-area .optional { font-weight: normal; color: #888; }
.agent-area input[type=text], .agent-area input[type=email], .agent-area input[type=tel],
.agent-area input[type=password], .agent-area input[type=search], .agent-area select {
    display: block; width: 100%; height: 36px; padding: 6px 10px; font-size: 14px; color: #222;
    background: #fff; border: 1px solid #c3ccd5; border-radius: 3px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.agent-area select { padding: 6px; }
.agent-area input:focus, .agent-area select:focus { border-color: #1c77b0; box-shadow: 0 0 0 3px rgba(28,119,176,.2); }
.agent-area .static-value { display: block; height: 36px; line-height: 34px; padding: 0 10px; font-size: 14px; color: #222; background: #f4f6f8; border: 1px solid #e1e6eb; border-radius: 3px; overflow: hidden; text-overflow: ellipsis; }
.agent-area .hint { display: block; font-size: 12px; color: #777; margin-top: 3px; }
.agent-area .hint.met { color: #2e8b57; }
.agent-area .hint.met::before { content: "\2713  "; }
.agent-area .has-error input, .agent-area .has-error select { border-color: #c0392b; background: #fffafa; }
.agent-area .has-error input:focus { box-shadow: 0 0 0 3px rgba(192,57,43,.18); }
.agent-area .field-error { display: block; font-size: 12px; color: #c0392b; margin-top: 3px; font-weight: bold; }
.agent-area .field-error:empty { display: none !important; }
.agent-area .field-error.field-ok { color: #2e8b57; }
.agent-area .password-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 6px; }
.agent-area .check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-weight: normal; }
.agent-area .check input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.agent-area .check strong { display: block; color: #333; }
.agent-area .check .hint { margin: 0; }
.agent-area .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 4px 0 24px; }
.agent-area .form-actions a { color: #666; }
.agent-area fieldset .form-actions, .agent-area .panel .form-actions { margin: 8px 0 10px; }

/* Buttons */
.agent-area .btn { display: inline-block; height: 36px; padding: 0 16px; font-size: 13px; font-weight: bold; line-height: 34px; font-family: Arial, sans-serif;
    border-radius: 3px; border: 1px solid #004786; cursor: pointer; text-decoration: none; white-space: nowrap; background: #fff; color: #004786; }
.agent-area .btn:hover { background: #eef3f8; }
.agent-area .btn:focus-visible { outline: 2px solid #1c77b0; outline-offset: 2px; }
.agent-area .btn[disabled] { opacity: .5; cursor: not-allowed; }
.agent-area .btn-primary { background: #004786; color: #fff; padding: 0 24px; font-size: 14px; }
.agent-area .btn-primary:hover { background: #1c77b0; border-color: #1c77b0; }
.agent-area .btn-primary[disabled] { opacity: .7; cursor: wait; }
.agent-area .btn-danger { background: #fff; color: #b03a2e; border-color: #b03a2e; }
.agent-area .btn-danger:hover { background: #fdf0ee; }
.agent-area .btn-danger-solid { background: #b03a2e; color: #fff; border-color: #b03a2e; }
.agent-area .btn-danger-solid:hover { background: #922f25; }
.agent-area .btn-small { height: 30px; line-height: 28px; padding: 0 10px; font-size: 12px; }
.agent-area .btn-link { background: none; border: 0; color: #004786; padding: 0 4px; height: auto; line-height: inherit; text-decoration: underline; font-weight: normal; }
.agent-area .btn-link:hover { background: none; color: #1c77b0; }

/* Admin: stat cards (also the status filter) */
.agent-area ul.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; border: 0; }
.agent-area .stats li { list-style: none; margin: 0; padding: 0; background: none; border: 0; }
.agent-area .stat { display: block; padding: 10px 12px; border: 1px solid #dde3e9; border-radius: 4px; background: #fff; color: #4a4a4a; text-decoration: none; border-top: 3px solid #c3ccd5; }
.agent-area .stat:hover { background: #f5f8fb; }
.agent-area .stat .num { display: block; font-size: 24px; line-height: 30px; font-weight: bold; color: #222; font-family: 'Trebuchet MS', Arial, sans-serif; }
.agent-area .stat .lbl { display: block; font-size: 12px; color: #666; }
.agent-area .stat[aria-current="true"] { border-color: #004786; border-top-color: #004786; background: #eef3f8; }
.agent-area .stat.stat--pending { border-top-color: #d9a400; }
.agent-area .stat.stat--pending.has-items .num { color: #946f00; }
.agent-area .stat.stat--active { border-top-color: #2e8b57; }
.agent-area .stat.stat--banned { border-top-color: #b03a2e; }
.agent-area .stat[aria-current="true"].stat--pending { border-top-color: #d9a400; }
.agent-area .stat[aria-current="true"].stat--active { border-top-color: #2e8b57; }
.agent-area .stat[aria-current="true"].stat--banned { border-top-color: #b03a2e; }

/* Admin: toolbar */
.agent-area .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0 0 12px; }
.agent-area .toolbar .search { flex: 1 1 240px; }
.agent-area .toolbar .sort { flex: 0 0 170px; }
.agent-area .toolbar label { font-size: 12px; margin-bottom: 2px; }
.agent-area .result-summary { margin: 0 0 8px; padding: 0; color: #666; }
.agent-area .result-summary a { color: #004786; }

/* Admin: bulk actions + table */
.agent-area .bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: #f4f6f8; border: 1px solid #dde3e9; border-bottom: 0; border-radius: 4px 4px 0 0; }
.agent-area .bulk-bar .selected-count { margin-right: auto; font-weight: bold; color: #333; }
.agent-area .bulk-bar .check-all { display: flex; align-items: center; gap: 6px; font-weight: normal; margin: 0 8px 0 0; }
.agent-area .bulk-bar .check-all input { width: 16px; height: 16px; margin: 0; }
.agent-area table.agents { width: 100%; border-collapse: collapse; border: 1px solid #dde3e9; background: #fff; margin: 0 0 12px; }
.agent-area table.agents th { background: #fff; border: 0; border-bottom: 2px solid #dde3e9; padding: 8px; font-size: 12px; text-align: left; color: #555; white-space: nowrap; }
.agent-area table.agents td { border: 0; border-bottom: 1px solid #edf0f3; padding: 8px; vertical-align: top; text-align: left; }
.agent-area table.agents tr:last-child td { border-bottom: 0; }
.agent-area table.agents tbody tr:hover { background: #f8fafc; }
.agent-area table.agents tbody tr.is-selected { background: #eef3f8; }
.agent-area table.agents .col-check { width: 30px; }
.agent-area table.agents .col-check input { width: 16px; height: 16px; margin: 2px 0 0; }
.agent-area table.agents .agency { display: block; font-weight: bold; color: #222; }
.agent-area table.agents .username { display: block; color: #666; font-family: Consolas, Menlo, monospace; font-size: 12px; }
.agent-area table.agents .email { display: block; font-size: 12px; color: #555; overflow-wrap: anywhere; }
.agent-area table.agents .muted { color: #999; }
.agent-area table.agents .col-actions { white-space: nowrap; text-align: right; }
.agent-area table.agents .col-actions .btn { margin-left: 4px; }
.agent-area .badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: bold; line-height: 18px; white-space: nowrap; margin: 0 2px 2px 0; }
.agent-area .badge--active { background: #e3f3e8; color: #1f5e3b; }
.agent-area .badge--pending { background: #fff1c7; color: #6b5200; }
.agent-area .badge--banned { background: #fbe3df; color: #8e2a1f; }
.agent-area .badge--admin { background: #e1ebf5; color: #004786; }
.agent-area .badge--you { background: #eee; color: #555; }
.agent-area .empty-state { text-align: center; padding: 30px 16px; border: 1px solid #dde3e9; border-radius: 4px; background: #fff; margin: 0 0 16px; }
.agent-area .empty-state p { padding: 0; margin: 0 0 8px; }

/* Admin: pagination */
.agent-area ul.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin: 0 0 20px; padding: 0; list-style: none; border: 0; }
.agent-area .pagination li { list-style: none; margin: 0; padding: 0; background: none; border: 0; }
.agent-area .pagination a, .agent-area .pagination span { display: block; min-width: 32px; height: 32px; line-height: 30px; padding: 0 8px; text-align: center; border: 1px solid #dde3e9; border-radius: 3px; color: #004786; text-decoration: none; background: #fff; }
.agent-area .pagination a:hover { background: #eef3f8; }
.agent-area .pagination a[aria-current="page"] { background: #004786; border-color: #004786; color: #fff; }
.agent-area .pagination .gap { border: 0; background: none; color: #999; min-width: 16px; }
.agent-area .pagination .disabled { color: #bbb; }

/* Admin: delete confirmation */
.agent-area ul.confirm-list { margin: 8px 0 12px 18px; padding: 0; border: 0; }
.agent-area .confirm-list li { list-style: disc; background: none; border: 0; padding: 0; margin: 2px 0; }

/* Agent Area home */
.agent-area .account-bar { margin: 0 0 18px; padding: 0; color: #666; }
.agent-area .account-bar a { color: #004786; }
.agent-area .account-bar .warn { color: #946f00; font-weight: bold; }
.agent-area .tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 18px; }
.agent-area .tool-card { display: flex; flex-direction: column; align-items: flex-start; padding: 14px 16px; border: 1px solid #dde3e9; border-top: 3px solid #004786; border-radius: 4px; background: #fff; }
.agent-area .tool-card h3 { font-size: 17px; line-height: 22px; color: #222; font-weight: bold; padding: 0 0 4px; border: 0; background: none; }
.agent-area .tool-card p { margin: 0 0 12px; padding: 0; color: #555; flex: 1 1 auto; }
.agent-area .doc-group { padding: 10px 16px 6px; }
.agent-area .doc-group h3 { font-size: 15px; line-height: 20px; color: #004786; font-weight: bold; padding: 0 0 4px; border: 0; background: none; }
.agent-area ul.doc-list { margin: 0; padding: 0; list-style: none; border: 0; }
.agent-area .doc-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 0; padding: 8px 0; list-style: none; background: none; border: 0; border-top: 1px solid #edf0f3; }
.agent-area .doc-list li:first-child { border-top: 0; }
.agent-area .doc-list .doc-title { font-weight: bold; color: #004786; text-decoration: none; }
.agent-area .doc-list a.doc-title:hover { text-decoration: underline; }
.agent-area .doc-list .doc-title.muted { color: #999; }
.agent-area .doc-list .doc-meta { font-size: 12px; color: #777; }
.agent-area .help-line { margin: 4px 0 20px; padding: 0; color: #666; }
.agent-area .help-line a { color: #004786; }

/* Login */
.agent-area .form-alert--info { background: #eef3f8; border-color: #1c77b0; color: #1d4466; }
.agent-area .login-card { max-width: 400px; margin: 10px auto 18px; padding: 22px 26px 16px; border: 1px solid #dde3e9; border-top: 3px solid #004786; border-radius: 4px; background: #fff; }
.agent-area .login-card h1 { padding-bottom: 2px; }
.agent-area .login-card .lead { margin-bottom: 14px; }
.agent-area .login-card .check { margin: 6px 0 16px; }
.agent-area .password-wrap { position: relative; }
.agent-area .password-wrap input { padding-right: 64px; }
.agent-area .password-toggle { position: absolute; top: 4px; right: 4px; height: 28px; padding: 0 10px; border: 0; border-radius: 3px; background: #eef3f8; color: #004786; font-size: 12px; font-weight: bold; cursor: pointer; }
.agent-area .password-toggle:hover { background: #dde8f2; }
.agent-area .password-toggle:focus-visible { outline: 2px solid #1c77b0; outline-offset: 1px; }
.agent-area .caps-warning { color: #946f00; font-weight: bold; }
.agent-area .btn-block { display: block; width: 100%; text-align: center; }
.agent-area .login-links { margin: 12px 0 0; padding: 0; text-align: center; }
.agent-area .login-links a { color: #004786; }
.agent-area .login-aside { max-width: 400px; margin: 0 auto 24px; padding: 0 4px; color: #666; font-size: 12px; }
.agent-area .login-aside p { margin: 0 0 6px; padding: 0; }
.agent-area .login-aside a { color: #004786; }

@media (max-width: 640px) {
    .agent-area .w-3-4, .agent-area .w-1-4, .agent-area .w-1-2, .agent-area .w-1-3 { flex: 1 1 100%; }
    .agent-area fieldset, .agent-area .panel { padding: 4px 12px 8px; }
    .agent-area .form-actions .btn-primary { width: 100%; }
    .agent-area ul.stats { grid-template-columns: repeat(2, 1fr); }
    .agent-area .tool-grid { grid-template-columns: 1fr; }
    .agent-area .login-card { padding: 16px 14px 12px; margin-top: 4px; }
    .agent-area .doc-list li { display: block; }
    .agent-area .doc-list .doc-meta { display: block; }
    .agent-area .toolbar .sort { flex: 1 1 100%; }

    /* Agent table becomes a list of cards */
    .agent-area table.agents, .agent-area table.agents tbody, .agent-area table.agents tr, .agent-area table.agents td { display: block; width: 100%; }
    .agent-area table.agents thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .agent-area table.agents tr { position: relative; padding: 8px 8px 8px 40px; border-bottom: 1px solid #dde3e9; }
    .agent-area table.agents td { border: 0; padding: 2px 0; }
    .agent-area table.agents td.col-check { position: absolute; left: 10px; top: 10px; width: auto; }
    .agent-area table.agents td[data-label]::before { content: attr(data-label) ": "; color: #888; font-size: 12px; }
    .agent-area table.agents .col-actions { text-align: left; padding-top: 6px; }
    .agent-area table.agents .col-actions .btn { margin: 0 4px 0 0; }
}
