form {
    margin: 0;
    padding: 0;
    display: inline;
}

tr.htmx-swapping td {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.badge {
    background-color: #999;
    color: white;
    padding: 4px 8px;
    margin: 2px;
    text-align: center;
    border-radius: 5px;
}

.htmx-indicator {
    display: none;
}

.text-center {
    text-align: center;
}

.version {
    font-size: 0.8em;
    color: #999;
}

/* pico css overrides */

:root {
    --form-element-spacing-vertical: 0.15rem;
    --form-element-spacing-horizontal: 1rem;
}

/** dynamic nav bar **/

.topnav {
    overflow: hidden;
}

.topnav a {
    float: left;
    display: block;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
}

.topnav .icon {
    display: none;
}

@media screen and (max-width: 775px) {
    .topnav a:not(:first-child) {
        display: none;
    }

    .topnav a.icon {
        float: right;
        display: block;
    }
}

@media screen and (max-width: 775px) {
    .topnav.responsive {
        position: relative;
    }

    .topnav.responsive a.icon {
        position: absolute;
        right: 0;
        top: 0;
    }

    .topnav.responsive a {
        float: none;
        display: block;
        text-align: left;
    }
}

/** tab support for admin page **/

[role="tabs"] {
    display: flex;
  }
  
  [role="tabs"] section {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  
  [role="tabs"] figure {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    display: none;
  }
  
  [role="tabs"] [type="radio"]:checked + figure {
    display: block;
  }
  
  nav[role="tab-control"] label.active {
    color: var(--primary);
    cursor: pointer;
  }

/* Internal app shell */
body {
    background: #f6f8fb;
    color: #152238;
}

.app-header {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    display: grid;
    grid-template-columns: 280px 1fr auto;
    height: 64px;
    padding: 0 22px;
    gap: 20px;
}

.app-brand,
.app-nav a,
.app-user {
    align-items: center;
    display: inline-flex;
    text-decoration: none;
}

.app-brand {
    gap: 10px;
    color: #037da6;
    font-size: 20px;
}

.app-brand span {
    color: #667085;
    font-size: 14px;
    font-weight: 500;
}

.app-nav {
    display: flex;
    height: 100%;
    justify-content: center;
    gap: 10px;
}

.app-nav a {
    border-bottom: 3px solid transparent;
    color: #475467;
    font-weight: 600;
    padding: 0 18px;
}

.app-nav a.active,
.app-nav a:hover {
    border-bottom-color: #0796bd;
    color: #087da0;
}

.app-user {
    gap: 9px;
    color: #1d2939;
}

.app-user .fa-user-circle {
    font-size: 28px;
}

.app-header .icon {
    display: none;
}

#main.container {
    max-width: none;
    padding: 22px 24px 34px;
}

.otm-page h1 {
    font-size: 26px;
    margin: 0 0 18px;
}

.otm-identity-layout {
    display: grid;
    grid-template-columns: minmax(360px, 34%) 1fr;
    gap: 18px;
}

.otm-panel {
    background: #ffffff;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.otm-list-panel {
    overflow: hidden;
}

.otm-panel-head {
    align-items: center;
    border-bottom: 1px solid #e7edf4;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 16px 18px;
}

.otm-panel h2,
.otm-section-head h3 {
    color: #152238;
    font-size: 18px;
    margin: 0;
}

.otm-search {
    max-width: 230px;
    margin: 0;
}

.otm-table {
    margin: 0;
}

.otm-table th,
.otm-table td {
    border-color: #e7edf4;
    font-size: 14px;
    padding: 14px 18px;
}

.otm-table tbody tr {
    cursor: pointer;
}

.otm-table tbody tr:hover {
    background: #f2f8fb;
}

.otm-status {
    background: #e8f7ed;
    border: 1px solid #9bd4aa;
    border-radius: 6px;
    color: #087443;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
}

.otm-empty {
    color: #667085;
    text-align: center;
}

.otm-form-panel {
    padding: 18px;
}

.otm-identity-form {
    display: block;
    margin-top: 14px;
}

.otm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
}

.otm-form-grid label,
.otm-upload {
    color: #344054;
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
}

.otm-form-grid input,
.otm-form-grid select,
.otm-date-selects select {
    margin-top: 6px;
    width: 100%;
}

.otm-date-field {
    border: 0;
    margin: 0;
    padding: 0;
}

.otm-date-field legend {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.otm-date-selects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.otm-upload {
    margin-top: 14px;
}

.otm-upload-box {
    align-items: center;
    border: 1px dashed #c7d4e2;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    margin-top: 6px;
    padding: 10px 12px;
}

.otm-upload-box input {
    margin: 0;
}

.otm-upload small {
    color: #667085;
    display: block;
    font-weight: 500;
    margin-top: 6px;
}

.otm-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.otm-files span {
    background: #eef6f9;
    border-radius: 6px;
    color: #24576a;
    font-size: 12px;
    padding: 5px 8px;
}

.otm-divider {
    border-top: 1px solid #dce4ee;
    margin: 16px 0 12px;
}

.otm-section-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.otm-section-head p {
    color: #667085;
    font-size: 13px;
    margin: 4px 0 0;
}

.otm-suggestion-list {
    border: 1px solid #dce4ee;
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
}

.otm-suggestion-row {
    align-items: center;
    border-bottom: 1px solid #e7edf4;
    display: grid;
    grid-template-columns: 24px 1fr 34px;
    gap: 10px;
    margin: 0;
    padding: 9px 12px;
}

.otm-suggestion-row:last-child {
    border-bottom: 0;
}

.otm-suggestion-row input {
    margin: 0;
}

.otm-icon-button {
    align-items: center;
    background: transparent;
    border: 1px solid #d0d9e4;
    color: #344054;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 28px;
}

.otm-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.otm-button {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    margin: 0;
    min-height: 38px;
    padding: 8px 18px;
    width: auto;
}

.otm-button-primary {
    background: #0788b3;
    border-color: #0788b3;
    color: #ffffff;
}

.otm-button-ghost {
    background: #ffffff;
    border-color: #0796bd;
    color: #087da0;
}

.otm-toast {
    background: #e8f7ed;
    border: 1px solid #9bd4aa;
    border-radius: 8px;
    color: #087443;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 10px 14px;
}

@media screen and (max-width: 980px) {
    .app-header {
        grid-template-columns: 1fr auto;
        height: auto;
        padding: 12px;
    }
    .app-nav {
        grid-column: 1 / -1;
        justify-content: flex-start;
        overflow-x: auto;
    }
    .otm-identity-layout,
    .otm-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth screens */
.auth-body {
    background: #f3f7fa;
    min-height: 100vh;
}

.auth-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 28px;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(15, 38, 59, 0.10);
    max-width: 440px;
    padding: 30px;
    width: 100%;
}

.auth-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-brand strong {
    color: #067fa7;
    display: block;
    font-size: 22px;
    line-height: 1.1;
}

.auth-brand span {
    color: #667085;
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}

.auth-heading h1 {
    color: #152238;
    font-size: 28px;
    line-height: 1.15;
    margin: 0 0 8px;
}

.auth-heading p {
    color: #667085;
    font-size: 15px;
    margin: 0 0 22px;
}

.auth-error {
    align-items: center;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    color: #a8071a;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 9px;
    margin-bottom: 18px;
    padding: 10px 12px;
}

.auth-form {
    display: block;
}

.auth-form label {
    color: #344054;
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 7px;
}

.auth-input-wrap {
    align-items: center;
    display: grid;
    grid-template-columns: 34px 1fr;
    margin-bottom: 16px;
}

.auth-input-wrap i {
    color: #667085;
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    z-index: 1;
}

.auth-input-wrap input {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0;
    padding-left: 38px;
}

.auth-submit {
    align-items: center;
    background: #0788b3;
    border: 1px solid #0788b3;
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    margin: 4px 0 0;
    min-height: 44px;
    text-decoration: none;
    width: 100%;
}

.auth-submit:hover {
    background: #06769b;
    border-color: #06769b;
    color: #ffffff;
}

/* Admin settings hub */
.otm-admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
}

.otm-admin-menu {
    padding: 16px;
}

.otm-admin-menu h2 {
    font-size: 16px;
    margin: 0 0 12px;
}

.otm-admin-menu a {
    align-items: center;
    border-radius: 8px;
    color: #344054;
    display: flex;
    font-weight: 700;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
}

.otm-admin-menu a:hover {
    background: #eef6f9;
    color: #087da0;
}

.otm-admin-main {
    min-height: 420px;
    padding: 18px;
}

.otm-admin-placeholder h2 {
    margin: 0 0 8px;
}

.otm-admin-placeholder p {
    color: #667085;
    margin: 0;
}

.otm-admin-login {
    display: block;
    max-width: 420px;
    padding: 18px;
}

@media screen and (max-width: 980px) {
    .otm-admin-layout {
        grid-template-columns: 1fr;
    }
}


/* Internal users and inbox */
.app-user {
    align-items: center;
    color: #1d2939;
    display: inline-flex;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.app-user span {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.otm-section-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.otm-section-head h1,
.otm-section-head h2 {
    margin: 0;
}

.otm-section-head p {
    color: #667085;
    margin: 4px 0 0;
}

.otm-address-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto;
    margin: 0;
}

.otm-address-form label {
    margin: 0;
}

.otm-admin-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 360px 1fr;
}

.otm-user-form {
    padding: 18px;
}

.otm-user-form h3,
.otm-panel h3 {
    font-size: 18px;
    margin: 0 0 14px;
}

.otm-check {
    align-items: center;
    display: flex;
    gap: 8px;
}

.otm-check input {
    width: auto;
}

.otm-users-table td,
.otm-users-table th {
    white-space: nowrap;
}

@media screen and (max-width: 980px) {
    .otm-section-head,
    .otm-address-form {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .otm-admin-grid {
        grid-template-columns: 1fr;
    }
}
