* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background-color: #f8fafc;
    min-height: 100vh;
    color: #0f172a;
    padding: 0 2em;
    margin: 0;
}

h1 {
    padding-bottom: 0.5em;
}

p {
    padding: .4em 0;
}


label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    padding: 18px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: #f8f8f8;
}

textarea {
    margin-bottom: -6px;
}


select {
    padding: 10px;
    border: 1px solid #cbd5f5;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    transition: border-color 0.3s ease;
    width: 100%;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

input[type="color"] {
    padding: 1px 2px;
    width: 4em;
    height: 4em;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #007AFF;
    background-color: #ffffff;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.auth-form { max-width: 420px; margin: 40px auto; }
.form-group { margin-bottom: 12px; }
label { display:block; font-weight: 600; margin-bottom: 6px; }
input { width: 100%; padding: 8px; }
.error { color: #b91c1c; margin-bottom: 8px; }
.actions { display:flex; align-items:center; gap: 8px; margin-right: -9px; }

button,
a.button {
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    padding: 12px 16px;
    color: #000;
    border: 1px solid #cbd5f5;
    text-decoration: none;
    display: inline-block;
    line-height: 100%;
    box-sizing: content-box;
}

button.disabled,
a.button.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: default;
}

.clear-filters {
    padding: 0;
    display: none;
    border: 1px solid #cbd5f5;
    background: #fff;
    border-radius: 8px;
    width: 42px;
    height: 34px;
    display: none;
    align-items: center;
    justify-content: center;
}

button.primary,
a.button.primary {
    background-color: #007AFF;
    border: 1px solid #007AFF;
    color: #fff;
}

.bulk-bar button {
    background-color: #007AFF;
    padding: 16px;
    color: #fff;
}


button:hover,
.button:hover {
    background-color: #d7dce1;

}

button:active {
    transform: scale(0.98);
}

button.success {
    background-color: #28a745;
}

button.success::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    animation: checkmark 0.5s ease-in-out;
}

table td {
    font-size: 90%;
}

code {
    font-size: 120%;
}





body {
    max-width: 1200px;
    margin: 24px auto;
}

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

th,
td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.clear {
    clear: both;
}

.muted {
    color: #888;
    font-size: 0.9em;
}

.actions a {
    
}

.icon-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    background: #fff;
    color: inherit;
    text-decoration: none;
    background-size: 18px 18px;
    background-position: center;
    background-repeat: no-repeat;
}

.icon-btn:hover {
    background-color: #f9fafb;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn.view
{
    background-image: url('/img/icon_eye.svg');
}

.icon-btn.simulate-push
{
    background-image: url('/img/icon_push.svg');
}

.icon-btn.edit
{
    background-image: url('/img/icon_edit.svg');
}

.icon-btn.trash
{
    background-image: url('/img/icon_trash.svg');
}

.icon-btn.copy
{
    background-image: url('/img/icon_copy.svg');
}

.icon-btn.is-copied
{
    background-color: #d1fae5;
    border-color: #34d399;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    background: #f3f4f6;
    margin-right: 4px;
}

body {
    padding-bottom: 80px;
}

.bulk-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    background: #fff;
    border: 1px solid #cbd5f5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 8px 8px 8px 16px;
    border-radius: 16px;
    z-index: 1000;
    display: none;
    gap: 8px;
    align-items: center;
    width: 70%;
    max-width: 760px;
}

.bulk-bar button[type="submit"] {
    width: 200px;
}

.bulk-bar .push-right {
    margin-left: auto;
}

.bulk-bar label {
    margin-bottom: 0;
}

.bulk-bar button {
    margin-top: 0;
}

th.sortable {
    user-select: none;
}

th.sortable .sort-indicator {
    margin-left: 6px;
    opacity: 0.6;
}

.serial-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.warn-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.warn-dot.yellow {
    background: #fde047;
}

.warn-dot.red {
    background: #f87171;
}

.warn-dot.green {
    background: #34d399;
}

/* Page header */
.page-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-title {
    font-size: 220%;
    font-weight: 700;
    margin: 4px 0 0 0;
}

.page-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.page-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.button.icon-only {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    font-weight: 700;
}

.header-cards {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
}



.header-card {
    border: 1px solid #cbd5f5;
    border-radius: 12px;
    padding: 6px 20px;
    background: #fff;
    display: flex;
    flex-direction: row;
    gap: 6px;
    text-align: center;
    min-width: 120px;
    align-items: baseline;
}

.header-card__label {
    font-size: 80%;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.header-card__value {
    font-size: 150%;
    font-weight: 700;
    color: #111827;
}

.header-card__value--small {
    font-size: 12px;
    word-break: break-all;
}

.header-card__meta {
    font-size: 13px;
    color: #9ca3af;
}

.header-card__actions {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.header-card--account {
    grid-column: span 2;
}

.header-account {
    display: flex; 
    gap: 20px; 
    align-content: center; 
    align-items: center; 
    vertical-align: center;
}

a.button.refill-button {
    align-content: center;
    padding: 0 30px;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .header-card--account {
        grid-column: span 1;
    }
}

/* Card wrapper around table */
.card {
    background: #fff;
    border: 1px solid #cbd5f5;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card table thead th {
    background: #f9fafb;
    font-weight: 600;
}

.card table tbody tr:hover {
    background: #fcfcfd;
}

.card table th:first-child,
.card table td:first-child {
    padding-left: 20px;
}


.popover {
    padding: 1em;
    position: absolute;
    top: 420px;
    left: 539.546875px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.17);
}


.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    gap: 12px;
}

.tab-bar {
    display: flex;
    
    border-bottom: 1px solid #cbd5f5;
    margin: 12px 0 0 0;
}

.tab-link {
    appearance: none;
    background: #f8fafc;
    border: 1px solid #cbd5f5;
    
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-left: 12px;
    position: relative;
    top: 1px; /* lift slightly so the "open" bottom overlaps the panel border */
}

.tab-link.is-active {
    color: #111827;
    border-bottom-color: #f8fafc;
}

.tab-panels {
    margin-top: 16px;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.tab-panel[hidden] {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: 32px;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    margin-top: 16px;
}

.chat-room-card {
    margin-top: 8px;
}

.chat-room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button.danger {
    border-color: #dc2626;
    color: #dc2626;
}

.button.danger:hover {
    background-color: #fee2e2;
}

body.chat-room-view {
    max-width: 720px;
    margin: 24px auto;
    padding: 0 24px;
}

.chat-room-header {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chat-room-header-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
}

.chat-room-meta {
    color: #6b7280;
    font-size: 14px;
}

.chat-room-log {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-room-thread {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    background: #f9fafb;
    border: 1px solid #cbd5f5;
    border-radius: 12px;
    padding: 12px 16px;
}

.chat-message-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.chat-message-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-message-relative {
    font-style: italic;
}

.chat-message-body pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 14px;
    color: #111827;
    background: transparent;
}

.chat-message-meta {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #6b7280;
}

.search {
    flex: 1 1 auto;
    max-width: 360px;
}

.search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5f5;
    border-radius: 8px;
}

/* Hide Activated column (3rd column: th/td) */
table thead th:nth-child(3),
table tbody td:nth-child(3) {
    display: none;
}

/* Tutorial overlay */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.tour-overlay.show {
    display: block;
}

.tour-hole {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3), 0 0 0 2px #fff;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tour-tooltip {
    position: fixed;
    max-width: 420px;
    background: #fff;
    color: #111;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    padding: 14px 16px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.tour-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.tour-actions .btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #ffffff00;
    cursor: pointer;
}

.tour-actions .btn.primary {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

#start-tutorial {
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5f5;
    background: #fff;
    color: #111;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Simple modal for imports */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.popup-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #cbd5f5;
    padding: 16px;
    width: 100%;
    max-width: 640px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.popup-close {
    position: absolute;
    right: 8px;
    top: 8px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

#scan-status {
    margin-top:8px; 
    padding-left: 10px;
    height: 2em;
}

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

.button-added-popup {
    text-align: center;
    width: 400px;
}
