/* FILE: web/css/screens/platform.css
   Platform Admin page (/platform, DAK platform realm). Same look as the admin panel
   (admin.css); a separate file so this page loads nothing from the company screens.
   Strict CSP: no <style> blocks, no inline scripts. */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    background: #0a0e17;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #eef4ff;
    padding: 20px;
    min-height: 100vh;
}

a { color: #5fb3e0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; color: #cfe3f5; }

/* ---- sign-in ---- */
.pa-signin { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 40px); }
.pa-card {
    background: #0d1a26;
    border: 1px solid rgba(56, 139, 180, 0.18);
    border-radius: 12px;
    padding: 1.5rem;
}
.pa-signin-card { width: min(420px, 100%); text-align: center; padding: 2rem 1.75rem; }
.pa-logo { max-width: 180px; height: auto; margin-bottom: 1rem; }
.pa-signin-card h1 { font-size: 1.5rem; color: #3b82f6; margin-bottom: 0.5rem; }
.pa-sub { color: #9bb7d0; font-size: 0.9rem; line-height: 1.45; margin-bottom: 1.25rem; }
.pa-notice {
    background: rgba(244, 185, 66, 0.12);
    border: 1px solid rgba(244, 185, 66, 0.4);
    color: #f8d58a;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.pa-ms-btn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; padding: 0.75rem 1rem; font-size: 0.95rem; }
.pa-back { display: block; margin-top: 1.25rem; font-size: 0.85rem; text-decoration: none; }

/* ---- panel ---- */
.admin-container { max-width: 1200px; margin: 0 auto; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}
.admin-header h1 { font-size: 1.8rem; color: #3b82f6; }
.admin-sub { color: #9bb7d0; font-size: 0.9rem; margin-top: 0.25rem; }
.admin-who { color: #9bb7d0; font-size: 0.85rem; overflow-wrap: anywhere; }
.badge-master {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(244, 185, 66, 0.15);
    color: #f4b942;
    border: 1px solid rgba(244, 185, 66, 0.4);
    border-radius: 10px;
    padding: 0.1rem 0.5rem;
}

.pa-error {
    background: rgba(224, 92, 106, 0.12);
    border: 1px solid rgba(224, 92, 106, 0.45);
    color: #f8a5ae;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.admin-card {
    background: #0d1a26;
    border: 1px solid rgba(56, 139, 180, 0.18);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.admin-card h2 { font-size: 1.2rem; margin-bottom: 1rem; color: #2e8fc0; display: flex; align-items: center; gap: 0.5rem; }
.pa-count { color: #7f9bb3; font-size: 0.9rem; font-weight: 400; }

.hint { color: #7f9bb3; font-size: 0.8rem; margin-bottom: 0.75rem; line-height: 1.4; }
.form-group .hint { margin: 0.3rem 0 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.invite-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; align-items: start; }
.form-group { margin-bottom: 0.5rem; text-align: left; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; color: #9bb7d0; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.6rem;
    background: #0f202d;
    border: 1px solid rgba(56, 139, 180, 0.3);
    border-radius: 6px;
    color: #eef4ff;
    font: inherit;
    font-size: 0.9rem;
}
.form-group textarea { resize: vertical; min-height: 4.5rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #2e8fc0; }
.form-actions { padding-top: 1.35rem; }
.form-actions button { width: 100%; }

button, .button-link {
    display: inline-block;
    background: linear-gradient(135deg, #1e6f9f, #124e72);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s;
}
button:hover, .button-link:hover { background: linear-gradient(135deg, #2e8fc0, #1a6690); }
button:focus-visible, .button-link:focus-visible { outline: 2px solid #5fb3e0; outline-offset: 2px; }
button:disabled { opacity: 0.6; cursor: default; }
button.danger { background: linear-gradient(135deg, #e05c6a, #c73a4a); }
button.danger:hover { background: linear-gradient(135deg, #f87171, #e05c6a); }
button.secondary { background: rgba(255, 255, 255, 0.1); }
button.small { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.button-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.button-row.center { justify-content: center; }
.action-buttons { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid rgba(56, 139, 180, 0.1); vertical-align: middle; }
th { color: #2e8fc0; font-weight: 600; }
#tenantsTable { min-width: 760px; } /* scrolls sideways inside .table-scroll on a phone */
.tenant-name { font-weight: 600; min-width: 10rem; }
.status-active { color: #27c186; }
.status-suspended { color: #f4b942; }
.status-terminated { color: #e05c6a; }

.error-message { color: #e05c6a; font-size: 0.85rem; margin-top: 0.5rem; overflow-wrap: anywhere; }

.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    border-left: 4px solid #27c186;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10001;
    max-width: min(420px, calc(100vw - 40px));
    animation: slideIn 0.3s ease;
}
.toast-notification.toast-error { border-left-color: #e05c6a; }

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.confirm-modal {
    background: linear-gradient(135deg, #0f1724, #0a0e17);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 460px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    text-align: center;
    animation: modalFadeIn 0.2s ease;
}
.confirm-modal h3 { margin-bottom: 0.5rem; overflow-wrap: anywhere; }
.confirm-modal p { color: #9bb7d0; margin-bottom: 1.25rem; font-size: 0.9rem; line-height: 1.45; }
.pa-dialog .error-message { margin: 0 0 1rem; text-align: left; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .toast-notification, .confirm-modal { animation: none; }
}

@media (max-width: 768px) {
    body { padding: 16px; }
    .admin-header h1 { font-size: 1.4rem; }
    table { font-size: 0.8rem; }
    th, td { padding: 0.45rem; }
    .form-actions { padding-top: 0; }
}

/* Licenses ending soon */
.ending-soon-list { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.ending-soon-list li { margin: 0.25rem 0; }
h2 > button.small { float: right; font-size: 0.8rem; }

/* Example data and the full check (web/js/platformExamples.js) */
.ex-status { color: #c9d8e6; font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.5; }
.ex-list { margin: 0.4rem 0 0; padding-left: 1.25rem; }
.ex-list li { margin: 0.2rem 0; overflow-wrap: anywhere; }
.ex-actions { margin-bottom: 0.75rem; flex-wrap: wrap; }
.ex-option { display: block; color: #9bb7d0; font-size: 0.85rem; margin-bottom: 1rem; line-height: 1.4; }
.ex-option input { margin-right: 0.4rem; }
.ex-run { margin-top: 1rem; border-top: 1px solid rgba(56, 139, 180, 0.18); padding-top: 1rem; }
.ex-running, .ex-verdict { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.ex-good { color: #4ade80; }
.ex-bad { color: #f8a5ae; }
.ex-meta { color: #7f9bb3; font-size: 0.8rem; margin-bottom: 0.75rem; }
.ex-filter { margin-bottom: 0.75rem; flex-wrap: wrap; }
.ex-pill { display: inline-block; border-radius: 10px; padding: 0.1rem 0.55rem; font-size: 0.75rem; font-weight: 600; }
.ex-pill.ex-pass { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.ex-pill.ex-fail { background: rgba(224, 92, 106, 0.18); color: #f8a5ae; }
.ex-pill.ex-skip { background: rgba(244, 185, 66, 0.15); color: #f4b942; }
.ex-results td { vertical-align: top; overflow-wrap: anywhere; }
.ex-calls { margin: 0.3rem 0 0; padding-left: 1rem; font-family: ui-monospace, monospace; font-size: 0.75rem; color: #9bb7d0; }
