:root {
    --blue-60: #0F62FE;
    --orange-60: #FC5D0D;
    --gray-10: #F4F4F4;
    --gray-20: #E0E0E0;
    --gray-100: #161616;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif;
    font-size: 14px;
    color: var(--gray-100);
    background: #ffffff;
}

/* Top bar: logo + application name + menu, aligned top left, matching Operate/Optimize. */
.top-bar {
    display: flex;
    align-items: center;
    background: var(--gray-10);
    height: 48px;
    padding: 0 1rem;
    gap: 0.5rem;
}

.top-bar .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.75rem;
    margin-right: 0.25rem;
    border-right: 1px solid var(--gray-20);
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.top-bar .logo img {
    width: 24px;
    height: 24px;
    display: block;
}

.top-bar .app-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-100);
    white-space: nowrap;
}

/* App switcher: dots icon left of the logo, opens a panel linking to every Camunda component -
   copies the behavior of Console's own app switcher. <details>, not JS, matching the zero-JS
   toggle pattern used elsewhere (e.g. the Secrets page's masked-value reveal). */
.top-bar .app-switcher {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    margin-right: 0.25rem;
}

.app-switcher summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--gray-100);
    list-style: none;
}

.app-switcher summary::-webkit-details-marker {
    display: none;
}

.app-switcher summary:hover {
    background: var(--gray-20);
}

.app-switcher summary svg circle {
    fill: currentColor;
}

.app-switcher[open] summary {
    background: var(--gray-20);
}

.app-switcher-panel {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid var(--gray-20);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.app-switcher-panel a {
    padding: 0.6rem 1rem;
    color: var(--gray-100);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.app-switcher-panel a:hover {
    background: var(--gray-10);
    color: var(--blue-60);
}

.top-bar nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.top-bar nav a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    color: var(--gray-100);
    text-decoration: none;
    font-size: 14px;
    border-bottom: 3px solid transparent;
}

.top-bar nav a:hover {
    background: var(--gray-20);
}

.top-bar nav a.active {
    border-bottom-color: var(--blue-60);
    font-weight: 600;
}

.top-bar .right {
    margin-left: auto;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0.5rem;
}

.top-bar .right form {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--blue-60);
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 0;
}

.btn:hover {
    background: #0043ce;
}

/* Grey, not the primary blue - used where a button needs to be present but not compete for
   attention with the actual primary action on the page (e.g. "Manage Users" next to "Sign in"). */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--gray-20);
    color: var(--gray-100);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 0;
}

.btn-secondary:hover {
    background: #c6c6c6;
}

.content {
    padding: 2rem;
}

h1, h2 {
    color: var(--gray-100);
    font-weight: 600;
}

h1 {
    font-size: 1.25rem;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 1rem;
    margin: 0 0 1rem;
}

.panel {
    background: #ffffff;
    border: 1px solid var(--gray-20);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 900px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-20);
    font-size: 14px;
}

th {
    background: var(--gray-10);
    font-weight: 600;
}

tr.selected td {
    background: var(--gray-20);
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-100);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--gray-20);
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: var(--gray-100);
}

input:focus {
    outline: 2px solid var(--blue-60);
    outline-offset: -2px;
}

input[readonly] {
    background: var(--gray-10);
    color: #565656;
}

input[readonly]:focus {
    outline: none;
}

button, input[type="submit"] {
    padding: 0.55rem 1rem;
    background: var(--blue-60);
    color: #ffffff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
}

button:hover {
    background: #0043ce;
}

button.danger {
    background: #ffffff;
    color: var(--orange-60);
    border: 1px solid var(--orange-60);
}

button.danger:hover {
    background: var(--orange-60);
    color: #ffffff;
}

.status-active {
    color: var(--blue-60);
    font-weight: 600;
}

.status-error {
    color: var(--orange-60);
    font-weight: 600;
}

.message {
    color: #1a7f37;
    background: #defbe6;
    border-left: 3px solid #1a7f37;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1.25rem;
    font-size: 14px;
}

.error {
    color: var(--orange-60);
    background: #fff2eb;
    border-left: 3px solid var(--orange-60);
    padding: 0.6rem 0.9rem;
    margin-bottom: 1.25rem;
    font-size: 14px;
}

form.inline {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

form.inline input {
    width: auto;
}

.add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.add-form input {
    width: auto;
}

.add-form label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 400;
    margin-bottom: 0;
}

/* Separates the "Identity Management" links from the "Secrets Management" ones in the flat
   top-bar nav - the portal landing page (admin/portal.html) explains those two areas in prose,
   this is just a visual hint in the nav itself. */
.top-bar nav .nav-divider {
    width: 1px;
    height: 20px;
    background: var(--gray-20);
    margin: 0 0.5rem;
}
