:root {
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    --space-xs: 2px;
    --space-sm: 4px;
    --space-md: 8px;
    --space-lg: 12px;
    --space-xl: 18px;

    --raduis-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f1f3f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: white; 
    color: #212529;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input {
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    border: none;
    background: white;
    font-size: 0.9rem;
}

textarea {
    resize: none;
    field-sizing: content;
}

textarea:disabled,
input:disabled {
    color: #868e96 !important;
}

input[type="checkbox"] {
    width: 1.1rem;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: var(--space-xl) 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.header-block {
    display: inherit;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin: auto;
    max-width: calc(1200px - 4rem);
}

.header-block .button-container {
    flex: 1;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    border: solid 1px #cbd5e1;
    transition: all ease 0.2s;
    font-size: 0.9rem;
}

.btn.search {
    position: absolute;
    right: 0;
    height: 100%;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0 !important;
}

.btn.confirm {
    color: white;
    background: #212529;
    border-color: #212529;
}

.btn.discard {
    color: #212529;
    background: white;
}

.btn.confirm:hover {
    background-color: #343a40;
    border-color: #343a40;
}

.btn.discard:hover {
    background-color: #f8f9fa;
    border-color: #212529;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.search-box {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: clip;
}

.search-box button {
    border-radius: 0 !important;
    background-color: #212529 !important;
    border: none;
}

.search-box button:hover {
    background-color: #495057 !important;
}

.search-input {
    flex: 1;
    padding: var(--space-lg);
    font-size: 0.9rem;
    border: none;  
    border: solid 1px #212529;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    text-overflow: ellipsis;
}

.house-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.house-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.house-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.house-id {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.house-address {
    color: #7f8c8d;
    margin-top: 0.5rem;
}

.event-timeline {
    margin-top: 2rem;
    gap: 0 !important;
}

.event-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-left: 3px solid #3498db;
    margin-bottom: 1.5rem;
    position: relative;
}

.event-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 1.5rem;
    width: 15px;
    height: 15px;
    background: #3498db;
    border-radius: 50%;
}

.event-date {
    font-weight: bold;
    color: #3498db;
    min-width: 150px;
}

.event-content h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.event-type {
    display: inline-block;
    background: #ecf0f1;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.event-description {
    color: #555;
    margin-top: 0.5rem;
}

.event-actions {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.event-actions ul {
    list-style: none;
    padding: 0;
}

.event-actions li {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-actions li::before {
    content: '✓';
    color: #27ae60;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.metadata-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.metadata-label {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.metadata-value {
    font-weight: 500;
    color: #2c3e50;
}

.no-login-note {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    margin-top: 30vh;
}

.no-login-note p,
.no-login-note div,
.no-login-note a {
    margin: auto;
}

.not-found,
.no-records {
    display: flex;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.loading > svg {
    animation: spin 0.8s linear infinite;
}

.login-container {
    max-width: 400px;
    margin: 2rem auto;
}

.button {
    display: flex;
    text-decoration: none;
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    width: fit-content;
    height: fit-content;
}

.btn:disabled,
.button:disabled {
    background: var(--gray-600) !important;
}

.button a {
    text-decoration: none;
    color: #212529;
}

.button.confirm {
    color: white;
    background: #212529;
}

.button.form {
    position: sticky;
    bottom: 0;
    margin-left: auto;
}

.button.discard {
    color: white;
    background: #212529;

}

.button.default {
    border: 1px solid #e2e8f0 !important;
    color: #212529;
    background: white;
}

.button.floating {
    color: inherit;
    background: none;
}

.button.crypto {
    padding: 0 !important;
    color: #495057 !important;
}

.button.nav {
    background: white;
    color: #212529;
    width: 100%;
    justify-content: space-between;
    font-size: 0.85rem;
    gap: var(--space-md);
}

.button.nav:hover {
    background: #212529;
    color: white;
}

.button.crypto:hover {
    color: #212529 !important;
}

.button.confirm:hover {
    color: white;
    background: #495057;
}

.button.discard:hover {
    color: white;
    background: #212529;
}

.button.create {
    margin-left: auto;
}

.button.default:hover {
    color: #212529;
    background: white;
}

.button.floating:hover {
    color: #495057;
}

.status-panel-container {
    flex: 1;
}

.status-panel-container .button {
    margin-left: auto;
}

.status-panel {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: fit-content;
    margin-left: auto;
    cursor: pointer;
}

.user-det {
    font-size: 0.9rem;
}

.selected-object-org,
.user-org {
    font-size: 0.6rem;
    color: #868e96;
}

.user-status {
    cursor: pointer;
    display: flex;
    height: 100%;
    justify-content: space-between;
    flex-direction: column;
}

.user-status > div {
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    text-wrap: nowrap;
    max-width: 26vw;
    font-weight: 600;
}

.status-modal button {
    background: none;
    cursor: pointer;
    border: none;
}

.status-modal {  
    position: absolute;
    top: 100%;
    z-index: 1000;
    background: white;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    right: 0;
    margin-top: var(--space-lg);
    border-radius: var(--radius-lg);
    animation: slideIn 0.3s ease-out forwards;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: default;
}

.status-controls-item {
    display: flex;
}

.status-controls-item > div {
    cursor: pointer;
}

.breaker {
    width: 100%;
    height: 1px;
    background: #ced4da;
}

.user-controls {
    display: flex;
}

.user-controls > span {
    font-size: 0.9rem;
    margin: auto;
}

.passport-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.passport-details .details-header {
    gap: var(--space-xl);
}

.passport-card {
    background-image: url(https://images.squarespace-cdn.com/content/v1/6192b02960e94236fc22acce/1646994801921-HEBJ3ZGJUVOD8EFCCUXA/modular+homes.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.passport-container {
    display: flex;
}

.passport-card {
    display: flex;
    border-radius: var(--radius-lg);
    min-width: 500px;
    min-height: 300px;
    color: white;
    /* background: linear-gradient(160deg, rgb(21, 170, 191) 10%, rgb(64, 192, 87) 100%); */
    border-top: solid 1px rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.9);
    font-size: 0.9rem;
}

/* Flipping animation */
/* .passport-card {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    perspective: 1000px;
    transition: transform 0.8s;
    transform: rotateY(180deg);
} */

.passport-card label {
    font-size: 0.7rem;
    font-weight: 500;
}

.passport-card-top {
    display: flex;
    gap: var(--space-xs);
    flex-direction: column;
    text-transform: uppercase;
}

.passport-card-content {
    width: 100%;  
    height: 100%;
    justify-content: space-between;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-xl);
    
}

.passport-card-icon,
.passport-card-footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-lg);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-lg);
    border-top: solid 1px rgba(255, 255, 255, 0.3);
    background: rgb(2 6 23 / 0.2);
    text-transform: uppercase;
}

.passport-card-icon {
    aspect-ratio: 1/1;
    padding: var(--space-md);
}

.passport-card-footer {
    padding: var(--space-md) var(--space-lg);
}

.passport-card svg {
    margin: auto;
}

.passport-card-footer > div {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.005rem;
}

.passport-card-name {
    font-size: 1.3rem;
    text-transform: uppercase;
    font-weight: 700;
}

.passport-card-owner {
    font-weight: 600;
}

.passport-card-title {
    font-size: 0.7rem;
    font-weight: 600;
}

.passport-card-header {
    display: flex;
    gap: var(--space-md);
}

.passport-card-status {
    width: fit-content;
    padding: var(--space-xs) var(--space-md);
    color: rgb(110 231 183 / var(--tw-text-opacity, 1));
    background: rgb(16 185 129 / 0.2);
    border: solid 1px rgb(52 211 153 / 0.3);
    border-radius: 9999px;
    align-items: center;
    text-transform: uppercase;
    font-size: 0.5rem;
    font-weight: 700;
}

.passport-card-org {
    display: flex;
    gap: var(--space-sm);
}

.passport-card-org-icon {
    display: flex;
}

.search-container {
    position: relative;
    min-width: 30%;
}

.search-error-note {
    position: absolute;
    color: red;
    font-size: 0.6rem;
    overflow: clip;
    text-overflow: ellipsis;
    max-height: 17px;
}

.details-header {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    flex-direction: row !important;
}

.summary {
    flex: 1;
}

.object-card {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.display-section {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-lg);
}

.display-block {
    background: #e3e3e3;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.display-block.attachments {
    gap: 0 !important;
}

.display-block.event-log,
.display-block.passport-list {
    padding: 0 !important;
    gap: 0 !important;
}

.display-block.event-log .details-header,
.display-block.passport-list .details-header {
    padding: var(--space-xl);
}

.display-block.summary {
    height: 100%;
}

.display-block.desc,
.display-block.list {
    flex: 1;
}

.display-block.desc {
    min-width: 60vw;
}

.display-block.list {
    min-width: 40%;
    gap: 0;
}

.display-block.details {
    width: 40%;
}

.display-block-section {
    display: flex !important;
    flex-wrap: wrap;
    flex-direction: row !important;
    gap: var(--space-lg) !important;
}

.display-block-section.sm > div {
    flex: 1.1 0 calc(30% - var(--space-md));
}

.display-block-section.md > div {
    flex: 1.1 0 calc(50% - var(--space-md));
}

.display-block-section select {
    height: 100%;
}

.display-block.action-item {
    border: 1px solid #e2e8f0 !important;
    background: white;
    padding: var(--space-lg) !important;
}

.display-block.action-item .button {
    margin-left: auto;
}

.action-title {
    display: flex;
}

.action-title h3 {
    white-space: normal;
    overflow-wrap: break-word;
    max-width: 80%;
}

.action-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: #868e96;
    margin-left: auto;
}

.item-list svg {
    margin: auto;
}

.item-list-body {
    display: flex;
    flex-direction: column;
}

.item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: dashed 1px gray;
}

.item:last-child {
    border: none;
}

.item-desc {
    display: flex;
    gap: var(--space-lg);
}

.item-icon {
    display: flex;
}

.item-value {
    display: flex;
}

.timeline-event {
    display: flex;
    position: relative;
}

.timeline-event-mark {
    width: 10px;
    height: 10px;
    background: gray;
    border-radius: 50%;  
    position: absolute;
    left: 124px;
    top: 26px;
    border: solid 2px white;
}

.timeline-event-date {
    min-width: 8rem;
    padding: var(--space-xl);
    font-size: 0.9rem;
    font-weight: 500;
}

.timeline-event-info {
    border-left: solid 2px gray;
    padding: var(--space-xl);
}

.event-timeline > div:last-child .timeline-event-info {
    border-color: white;
}

.event-timeline > div:last-child .timeline-event-mark::before {
    content: "";
    width: 2px;
    height: 28px;
    background: gray;
    display: flex;
    position: absolute;
    transform: translateX(100%);
    top: -500%;
}

.timeline-event-header {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.9rem;
    font-weight: 500;
}

.timeline-event-actions {
    margin-top: var(--space-md);
}

.timeline-event-actions > button {
    background: white;
    border-radius: var(--radius-lg);
    border: solid 1px #e9ecef;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-event-actions > button:hover {
    background: #efefef;
}

.popup-overlay {
    position: fixed;
    display: flex;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 9998;
    background: #00000052;
    padding: 4%;
    overscroll-behavior: contain;
    inset: 0;
    overflow: auto;
}

.popup-controls {
    display: flex;
    position: sticky;
    bottom: 0;
    background: white;
    justify-content: flex-end;
    padding: var(--space-lg);
}

.popup-container {
    margin: auto;
    display: flex;
    width: 100%;
    height: 100%;
}

.popup-header {
    display: flex;
}

.timeline-event-author,
.popup-header-inner > div {
    font-size: 0.9rem;
    font-weight: 600;
    color: #868e96;
}


.popup-block {
    z-index: 9999;
    margin: auto;
    background: white;
    border-radius: var(--radius-lg);
    display: flex;
    gap: var(--space-xl);
    flex-direction: column;
    padding: var(--space-xl);
    max-width: 1200px;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.35s ease-out forwards;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px); /* Adjust direction: translateX(-20px) for horizontal */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.popup-block {
    animation: slideIn 0.3s ease-out forwards;
}

.popup-overlay {
    animation: fadeIn 0.3s ease-out forwards;
}

.popup-close {
    margin-left: auto;
    margin-bottom: auto;
    width: fit-content;
    display: flex;
    background: none;
    border: none;
    color: gray;
    cursor: pointer;
    transition: color 0.2s ease;
}

.popup-close:hover {
    color: #212529;
}

.popup-close svg {
    margin: auto;
}

.action-list {
    display: flex;
    flex-direction: column;
}

.action-item {
    border-bottom: solid 1px #dee2e6;
    padding: var(--space-lg);
}

.form-controls {
    position: sticky;
    top: var(--space-xl);
    display: flex;
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: var(--space-lg);
    z-index: 10;
}

.form-controls > div {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-lg);
}

.event-creator {
    padding-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.event-form,
.creator-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.event-form .display-block {
    border: none;
    padding: 0;
}

.selected-object-container {
    display: flex;
    gap: var(--space-xl);
    font-weight: 600;
}

.selected-object-id {
    color: var(--gray-800);
    font-size: 0.9rem;
}

.object-search-container {
    position: relative;
    max-width: 50%;
    margin-bottom: var(--space-lg);
}

.object-search {
    display: flex;
}

.display-block {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-xl);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--space-lg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.display-block > div {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.single-select-block,
.multi-select-block {
    gap: var(--space-lg) !important;
}

.single-select-block {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
}

.single-select-block > .form-input-item {
    flex: 0 0 calc(50% - (var(--space-md) * 2) / 2);
    min-width: 0;
    width: calc(50% - (var(--space-md) * 2) / 2);
}

.org-detail-body {
    flex-wrap: wrap;
}

.field-error {
    color: red;
    font-size: 0.7rem;
}

.input-multiple-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    background: white;
    padding: var(--space-lg);
    z-index: 100;
    width: fit-content;
    border-radius: var(--space-lg);
    border: 1px solid #e2e8f0;
    animation: slideIn 0.3s ease-out forwards;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.input-multiple-empty,
.input-multiple-option {
    cursor: pointer;
    padding: var(--space-md);
    border-radius: var(--space-md);
    transition: all 0.2s ease;
}

.input-multiple-option {
    display: flex;
    user-select: none;
    justify-content: space-between;
    gap: var(--space-lg);
}

.input-multiple-option > svg {  
    margin: auto 0;
    animation: fadeIn 0.35s ease-out forwards;
}

.input-multiple-option.selected {
    color: gray;
}

.input-multiple-empty {
    cursor: default !important;
}

.input-multiple-option:hover {
    background: var(--gray-200);
}

.form-input-group {
    display: flex;
    flex-direction: row !important;
    gap: var(--space-lg) !important;
}

.form-input-item {  
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-input-item.date {
    width: fit-content;
    flex: 0 !important;
}

.form-input-item.error .input-multiple-container {
    border-color: red !important;
}

.form-input-item.error > input {
    border-color: red;
}

.form-input-item.checkbox > input {
    margin-right: auto;
    width: fit-content;
}

.form-input-item.checkbox {
    flex-direction: row;
    gap: var(--space-md);
    width: fit-content;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
}

.form-input-item.checkbox > label {
    top: -1.7rem;
}

.form-input-item input,
.form-input-item textarea,
.form-input-item select,
.input-multiple-container {    
    font-size: 1rem !important;
    line-height: 1.5rem;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.75rem 0.875rem;
    background-color: #ffffff;
    outline: none;
    transition: all 0.15s ease-in-out;
    font-size: 0.875rem;
    color: #0f172a;
}

.input-multiple-container {
    padding: 0 !important;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.input-multiple-selected {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.selected-item {
    cursor: default;
    background: var(--gray-200);
    border-radius: var(--radius-lg);
    border: none;  
    display: flex;
    flex-wrap: nowrap;
    text-wrap: nowrap;
    gap: var(--space-md);
    padding: 0 var(--space-lg);
}

.selected-item button {
    cursor: pointer;
    display: flex;
    background: none;
    border: none;
    margin: auto;
}

.input-multiple-search {
    border: none !important;
    width: fit-content !important;
    min-width: 5rem !important;
    flex: 1;
}

.event-form label,
.creator-form label {
    position: absolute;
    left: 0.75rem;
    top: -0.6rem;
    background-color: #ffffff;
    padding: 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    pointer-events: none;
    transition: all 0.15s ease-in-out;
    border-radius: var(--radius-lg);
}

/* SLOP BELOW */

.popup-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    color: #1f2937;
    height: 100%;
    justify-content: space-between;
}

.section { display: flex; flex-direction: column; gap: 6px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.section-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.field {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
}
.field-label { font-size: 12px; color: #6b7280; }
.field-value { display: flex; align-items: center; gap: 8px; min-width: 0; }
.field-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    display: flex;
    max-width: 85%;
    display: block;
}

.field-value.mono .field-text {
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease;
}
.copy-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.copy-btn:active:not(:disabled) { background: #e5e7eb; }
.copy-btn:disabled { opacity: .5; cursor: default; }

.copy-btn-sm { padding: 2px 6px; font-size: 11px; }
.copy-btn-sm span { display: none; }
.copy-btn-sm:hover span,
.copy-btn-sm:focus span { display: inline; }

.json-block {
    background: #f9fafb;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    max-height: 42vh;
    overflow: auto;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.45;
    white-space: pre;
}
.json-block-empty {
    color: #9ca3af;
    font-style: italic;
}

.banner-revoked {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.howto-details summary { cursor: pointer; list-style: none; }
.howto-details summary::-webkit-details-marker { display: none; }
.details-chevron { transition: transform .15s ease; }
.howto-details[open] .details-chevron { transform: rotate(90deg); }
.howto { margin: 8px 0 0 20px; font-size: 13px; line-height: 1.6; color: #374151; }
.howto code {
    background: #f3f4f6;
    color: #111827;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* SLOP ABOVE */

.form-progress {
    /* position: fixed; */
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    z-index: 100;
    background: white;
    border-radius: var(--space-lg);
    border: 1px solid #cbd5e1;
    height: calc(var(--space-md) * 2);
    top: 82px;
}

.form-progress-fill {
    height: var(--space-md);
    background: green;
    border-radius: var(--space-md);
    margin: 0 var(--space-sm);
    transition: all 0.2s ease;
}

/* SLOP >>> */

.circular-progress {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.circular-progress svg {
    display: block;
}

.circular-progress__label {
    position: absolute;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    pointer-events: none;
}

/* Wrapper that holds the file icon + optional progress overlay */
.upload-row__icon-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Progress overlay positioned on top of the icon */
.upload-row__progress-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Overlay variant of the circular progress */
.circular-progress--overlay {
    position: relative;
}

.circular-progress--overlay .circular-progress__label {
    display: none;
}

/* Ensure the progress SVG sits visually above the icon */
.circular-progress--overlay svg {
    display: block;
}

/* <<< SLOP */

.org-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.org-item {
    display: flex;
    gap: var(--space-xl);
    justify-content: space-between;
    border-radius: var(--radius-lg);
    border: none;
    background: white;
    color: #212529;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: var(--space-lg) var(--space-xl);
}

.org-item:hover {
    background-color: #f1f3f5;
}

.org-item.active {
    background: #212529;
    color: white;
}

.org-item-gen {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.org-item-legal {
    display: flex;
    gap: var(--space-xl);
    color: #868e96;
    flex-wrap: wrap;
}

.org-item-legal > span {
    text-wrap: nowrap;
}

.org-item-counter-container {
    display: flex;
    gap: var(--space-lg);
}

.org-item-counter {
    display: flex;
    gap: var(--space-sm);
}

.org-item-counter > svg {
    margin: auto;
}

.button-container > button {
    margin: auto;
}

header > .button-container {
    flex: 1 0;
}

.attachment-panel {
    flex-wrap: wrap;
    flex-direction: row !important;
    gap: 0 !important;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
}

.attachment-item {
    user-select: none;
    flex: 0 0 calc(100% / 8);
    max-width: calc(100% / 8);
    aspect-ratio: 1/1;
    display: flex;
    position: relative;
}

.attachment-item div {
    font-size: 0.7rem;
    transition: all 0.2s ease;
    padding: var(--space-sm);
}

.attachment-item > div {
    position: absolute;
    top: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-wrap: nowrap;
    display: flex;
    gap: var(--space-sm);
    justify-content: space-between;
}

.attachment-item > svg {
    margin: auto;
}

.attachment-item.new .attachment-btn {
    margin-left: auto !important;
}

.attachment-item.new .attachment-header {
    opacity: 1 !important;
}

.attachment-btn:hover {
    color: #212529;
}

.attachment-btn {
    color: #495057;
    cursor: pointer;
    gap: var(--space-md);
}

.attachment-size {
    margin-top: auto;
    margin-bottom: auto;
    text-wrap: nowrap;
}

.attachment-header {
    opacity: 0;
}

.attachment-footer {
    top: auto !important;
    bottom: 0;
}

.attachment-footer > div {
    overflow: hidden;
    text-wrap: nowrap;
    text-overflow: ellipsis;
}

.attachment-item:hover .attachment-header,
.attachment-item:hover .attachment-footer {
    opacity: 1;
}

.attachment-icon {
    flex: 0;
}

@media (max-width: 1080px) {
    .attachment-item {
        flex: 0 0 calc(100% / 6);
        max-width: calc(100% / 6);
    }
}

@media (max-width: 992px) {
    .object-card {
        flex-direction: column;
    }

    .display-block.details {
        width: 100%;
    }

    .org-item-legal {
        gap: var(--space-sm);
    }

    .display-block.attributes {
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .attachment-item {
        flex: 0 0 calc(100% / 4);
        max-width: calc(100% / 4);
    }
}

@media (max-width: 480px) {
    .attachment-item {
        flex: 0 0 calc(100% / 3);
        max-width: calc(100% / 3);
    }
}

/* CRYPTO RELATED SLOP >>> */

.howto-intro,
.howto-note {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary, #555);
    margin: 8px 0;
}

.howto-note strong {
    color: var(--text-primary, #111);
}

.howto-code {
    display: block;
    margin: 8px 0;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    color: #111;
}

.json-block-wrap {
    white-space: pre-wrap;
    word-break: break-all;
}

/* <<< CRYPTO RELATED SLOP */

/* Attachments slop >>> */

/* Wrapper for the pending icon + progress overlay inside a tile */
.attachment-icon-wrapper {
    position: relative !important;
    margin: auto;
}

.attachment-icon-wrapper > svg {
    display: block;
    margin: auto;
}

.attachment-progress-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Small action buttons inside attachment-header */
.attachment-btn__action {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    margin-left: var(--space-sm);
}

.attachment-btn {
    display: inline-flex;
    align-items: center;
}

.attachment-btn > button {
    cursor: pointer;
    display: flex;
    background: none;
    border: none;
    color: #212529;
}

.attachment-btn > a {
    color: #212529;
    text-decoration: none;
}

/* Upload panel header layout (title + actions on one row) */
.upload-panel__header {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.upload-panel__actions {
    display: flex;
    gap: var(--space-md);
}

.upload-panel__empty {
    color: #7f8c8d;
    font-size: 0.9rem;
    padding: var(--space-lg) 0;
    margin: auto;
}

/* <<< Attachments slop */

.dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.org-detail-header {
    gap: var(--space-xl) !important;
}

.org-type,
.org-name {
    display: flex;
    gap: var(--space-md);
}

.org-type {
    color: #868e96;
}

.org-name > svg,
.org-type > svg {
    margin: auto 0 auto 0;
}

.org-detail-contact,
.org-detail-legal {
    display: flex;
    gap: var(--space-lg);
    width: fit-content;
    min-width: 16rem;
}

.org-detail-fields {
    color: #495057;
}

.org-detail-fields > svg {
    margin: auto;
}

.org-detail-items > span,
.org-detail-items > a,
.org-detail-fields > span,
.org-detail-fields > svg {
    min-height: 26px;
}

.org-detail-fields,
.org-detail-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.org-detail-body {
    flex-direction: row !important;
    gap: var(--space-xl) !important;
}

.passport-list-title {
    display: flex;
    gap: var(--space-md);
}

.event-log,
.passport-list {
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
}

.popup-block .event-log-container {
    height: 100%;
    min-height: 0%;
    overflow: visible;
}

.popup-block .event-log {
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: auto;
    max-height: 100%;
}

.popup-block .table-head {
    position: sticky;
    top: 0;
}

.table-head,
.table-body {
    display: flex;
    flex-direction: column;
}

.table-head {
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.8rem;
    color: #64748b;
}

.table-head .table-row {
    cursor: default !important;
}

.table-row {
    display: grid;
    grid-template-columns: 120px 1fr 160px;
    align-items: center;
    gap: var(--space-lg, 12px);
    padding: var(--space-lg, 12px) var(--space-xl, 18px);
    cursor: pointer;
}

.event-log .table-row {
    grid-template-columns: 2fr 1.5fr 1.5fr 120px;
}

.table-body .table-row {
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #1f2937;
    transition: background-color 0.15s ease;
}

.table-body .table-row:last-child {
    border-bottom: none;
}

.table-body .table-row:hover {
    background-color: #f8f9fa;
}

.col-title {
    font-weight: 600;
}

.col-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-value.d {
    display: flex;
    flex-direction: column;
}

.col-value.d > div:last-child {
    color: #64748b;
}

/* Passport ID column — mono looks nicer for codes like CP42 */
.table-row .col-value {
    font-size: 0.85rem;
}

.list-footer {
    position: relative;
    color: #868e96;
    display: flex;
    padding: var(--space-xl);
}

.list-footer > span {
    font-size: 0.8rem;
}

.list-footer > button {
    position: absolute;
    margin: auto;
    left: 50%;
    top: calc(50% - var(--space-xs));
    transform: translate(-50%, -50%);
}

/* Responsive: collapse to fewer columns on small screens */
@media (max-width: 640px) {
    .table-row {
        grid-template-columns: 80px 1fr;
    }

    /* hide the date column on mobile */
    .table-row > :nth-child(3) {
        display: none;
    }

    .list-footer > button {
        right: 0%;
        left: auto;
        transform: translate(calc(var(--space-lg) * -1), -50%);
    }
    
    .search-container {
        display: none;
    }
}

.action-controls .button {
    margin-left: auto;
}

.actions-block {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    background: #f1f3f5;
    gap: var(--space-lg) !important;
}

.no-actions {
    margin: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: #868e96;
    padding: var(--space-lg);
}

.pdf-viewer,
.pdf-viewer-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.display-block.attributes {
    min-width: calc(50% - (var(--space-xl) / 2));
    max-width: calc(50% - (var(--space-xl) / 2));
}

.attribute-block,
.attribute-block-container {
    gap: var(--space-lg) !important;
}

.attribute-block {
    display: flex;
    flex-direction: column;
}

.attribute-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: var(--space-xl);
    font-size: 0.9rem;
}

.attribute-item {
    border-top: 1px dashed var(--gray-300);
    padding-top: var(--space-lg);
}

.attribute-item:first-child {
    padding-top: 0;
    border: none !important;
}

.attribute-item-name {
    color: var(--gray-600);
    font-weight: 600;
    flex: 1;
    max-width: 50%;
    min-width: 20%;
}

.attribute-value {
    width: fit-content;
    margin-left: auto;
}

.attribute-option {
    display: flex;
}

.attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.attribute-option > span {
    margin-left: auto;
}

.attribute-option {
    padding: var(--space-xs) var(--space-md);
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    border: solid 1px var(--gray-500);
    width: fit-content;
    height: fit-content;
}
