/* /style_new.css */
/* Identity Admin – shared styles (dashboard, users, sessions, realms, api keys, me, business) */

/* Base text + background (duplicate of _head.php values, harmless but consistent) */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Text",
                 "Segoe UI", Roboto, sans-serif;
    background: #0b0f14;
    color: #e6edf3;
}

/* --------------------------------------------------
   Page shell + common layout utilities
   (layout for inside .content — NOT topbar/sidebar)
-------------------------------------------------- */

.page {
    max-width: 980px;
    margin: 0 auto;
    padding-top: 12px; /* small breathing room under the topbar */
}

.page-title {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 600;
}

.page-subtitle {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #9fb3c8;
}

.page-actions {
    margin: 8px 0 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Simple flex row with space-between */
.row-between {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Muted text */
.muted {
    color: #9fb3c8;
}

/* Generic card (used by business list, alerts, etc.) */
.card {
    background: #0d141f;
    border-radius: 14px;
    border: 1px solid #141f30;
    padding: 14px 16px;
    margin-bottom: 14px;
}

/* Error-flavoured card */
.card-error {
    border-color: #b91c1c;
}

/* Small pill/tag label (status badges, etc.) */
.tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.4;
    background: #111827;
    color: #9fb3c8;
    border: 1px solid #1f2937;
}

/* Cards / tiles (existing identity cards) */
.identity-card {
    background: #0d141f;
    border-radius: 14px;
    border: 1px solid #141f30;
    padding: 18px 20px;
    margin-bottom: 18px;
}

.identity-card h2 {
    margin: 0 0 6px 0;
    font-size: 18px;
}

.identity-card p {
    margin: 0;
    font-size: 14px;
    color: #9fb3c8;
}

/* Tables */
.identity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

.identity-table th,
.identity-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #141f30;
}

.identity-table th {
    text-align: left;
    font-weight: 500;
    color: #9fb3c8;
    background: #050911;
}

.identity-table tr:nth-child(even) td {
    background: #050b14;
}

.identity-table tr:hover td {
    background: #101725;
}

/* Buttons */
.btn,
.identity-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: #00c2ff;
    color: #020617;
    transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover,
.identity-btn:hover {
    background: #37d5ff;
    transform: translateY(-1px);
}

/* Primary button alias (for links like + New Business) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: #00c2ff;
    color: #020617;
    transition: background 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover {
    background: #37d5ff;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ff5d5d;
    color: #020617;
}

.btn-danger:hover {
    background: #ff7676;
}

/* Badges / pills */
.identity-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.4;
    background: #111827;
    color: #9fb3c8;
}

/* Forms */
.identity-form {
    max-width: 480px;
}

.identity-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #9fb3c8;
}

.identity-form input[type="text"],
.identity-form input[type="email"],
.identity-form input[type="password"] {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e6edf3;
    font-size: 14px;
    outline: none;
}

.identity-form input:focus {
    border-color: #38bdf8;
}

/* Status chips */
.status-active {
    color: #4ade80;
}

.status-disabled {
    color: #f97316;
}

/* Activity log details trimming */
.activity-details {
    font-size: 13px;
    color: #9fb3c8;
}

/* API Keys page */
.api-keys-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 20px;
    align-items: flex-start;
}

.api-keys-col {
    min-width: 0;
}

.api-key-card {
    background: #020617;
    border-radius: 16px;
    border: 1px solid #1e293b;
    padding: 18px 18px 16px;
    margin-bottom: 18px;
}

.api-key-card h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.api-key-card p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #9fb3c8;
}

/* Box that shows the generated key */
.api-key-box {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #020617;
    border: 1px solid #1e293b;
}

/* THE key text itself */
.api-key-value,
.api-key-box code,
.api-key-box pre {
    display: block;
    max-width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #e5f2ff;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

/* hide default pre spacing if used */
.api-key-box pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

/* “Your keys” table on API Keys page */
.api-keys-table {
    margin-top: 12px;
}

/* My Account card */
.account-card {
    max-width: 380px;
}

/* Mobile tweaks for page content only */
@media (max-width: 860px) {
    .page {
        padding-top: 10px;
    }
}

@media (max-width: 640px) {
    .page {
        padding-top: 8px;
        padding-left: 2px;
        padding-right: 2px;
    }
}

/* Nav */
:root{ --topbar-height: 52px; }

body{
    font-family:-apple-system, system-ui, sans-serif;
    background:#0b0f14;
    color:#e6edf3;
    margin:0;
    padding:0;
}

.topbar{
    display:flex;
    align-items:center;
    padding:0 12px;
    padding-top: env(safe-area-inset-top);
    background:#121923;
    border-bottom:1px solid #1b2735;
    position:fixed;
    top:0; left:0; right:0;
    z-index:1000;
    min-height:calc(var(--topbar-height) + env(safe-area-inset-top));
}
.topbar-left{ display:flex; align-items:center; flex:1; min-width:0; }
.topbar-title{ font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar-subtitle{ margin-left:6px; font-weight:400; font-size:13px; color:#9fb3c8; }
.topbar-user{ font-size:14px; color:#9fb3c8; margin-left:8px; white-space:nowrap; }
.topbar-user-main{ text-align:right; margin-right:12px; }
.topbar-logout{ font-size:13px; color:#38bdf8; text-decoration:none; }

.nav-toggle{
    border:none;
    background:transparent;
    color:#e6edf3;
    padding:8px;
    margin-right:10px;
    border-radius:6px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:3px;
}
.nav-toggle:focus{ outline:none; box-shadow:0 0 0 2px rgba(0,194,255,0.4); }
.nav-toggle-bar{ width:18px; height:2px; border-radius:999px; background:#e6edf3; }

.sidebar{
    width:220px;
    background:#121923;
    position:fixed;
    top:calc(var(--topbar-height) + env(safe-area-inset-top));
    bottom:0; left:0;
    padding:10px 0;
    overflow-y:auto;
    border-right:1px solid #1b2735;
    z-index:900;
}
.sidebar a{
    display:block;
    padding:10px 16px;
    color:#9fb3c8;
    text-decoration:none;
    font-size:15px;
}
.sidebar a:hover{ background:#1b2735; color:#fff; }
.sidebar-section-label{ padding:6px 16px; opacity:0.6; font-size:12px; }

.sidebar-backdrop{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.55);
    z-index:850;
    display:none;
}

.content, .page{
    margin-left:220px;
    padding:20px;
    padding-top:calc(var(--topbar-height) + env(safe-area-inset-top) + 16px);
    min-height:calc(100vh - var(--topbar-height));
}

@media (max-width: 768px){
    .sidebar{
        width:260px;
        transform:translateX(-100%);
        transition:transform 0.22s ease-out;
        box-shadow:2px 0 20px rgba(0,0,0,0.65);
        top:calc(var(--topbar-height) + env(safe-area-inset-top));
    }
    body.sidebar-open .sidebar{ transform:translateX(0); }

    body.sidebar-open .sidebar-backdrop{ display:block; }

    .content, .page{
        margin-left:0;
        padding:16px;
        padding-top:calc(var(--topbar-height) + env(safe-area-inset-top) + 12px);
    }
    .topbar-title{ font-size:16px; }
}