:root {
    /* Central brand tokens mirror the official Amisda navy/red/white system;
       layout-specific selectors below consume these without restyling modules. */
    --amisda-navy: #0a1f44;
    --amisda-navy-dark: #06142e;
    --amisda-blue: #174f9f;
    --amisda-red: #c4262e;
    --amisda-white: #ffffff;
    --amisda-surface: #132b55;
    --amisda-border: rgba(117, 153, 207, 0.24);
    --amisda-text: #f5f8fd;
    --amisda-muted: #9fb0c9;
    --success: #2eb872;
    --warning: #d99a2b;
    --danger: #d6454d;
    --bg-main: #02102b;
    --bg-deep: #03163d;
    --panel: #162e67;
    --panel-2: #18336f;
    --panel-border: rgba(116, 156, 255, 0.18);

    --text: #f4f7ff;
    --text-soft: #c8d5ff;
    --text-muted: #9fb3e8;

    --blue: #4f7cff;
    --blue-2: #3867f3;
    --green: #36d26b;
    --green-2: #2fc45f;
    --purple: #a06bff;
    --purple-2: #8b56f3;
    --danger-2: #ef5647;

    --chip: rgba(255, 255, 255, 0.08);
    --input: #04173f;
    --input-border: rgba(160, 190, 255, 0.25);

    --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    --radius: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background:
        linear-gradient(90deg, rgba(0, 44, 128, 0.35) 0%, rgba(0, 0, 0, 0) 18%),
        linear-gradient(180deg, #02102b 0%, #02153c 100%);
    color: var(--text);
    min-height: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.hidden-link {
    display: none !important;
}

/* =========================
   LOGIN
========================= */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(20, 43, 96, 0.92);
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.login-card h1 {
    margin: 0 0 20px;
    font-size: 2rem;
    line-height: 1.1;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    color: var(--text-soft);
    font-size: 0.95rem;
}

.error-text {
    color: #ff9086;
    min-height: 20px;
    margin: 4px 0 0;
    font-size: 0.92rem;
}

/* =========================
   APP LAYOUT
========================= */
.app-shell {
    min-height: 100vh;
}

.topbar {
    height: 54px;
    background: #0a1b5d;
    border-bottom: 1px solid rgba(144, 173, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.brand {
    font-weight: 700;
    color: #ffffff;
    font-size: 1.05rem;
    white-space: nowrap;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-left a {
    color: #eef3ff;
    font-size: 0.88rem;
    opacity: 0.95;
}

.nav-left a:hover {
    opacity: 1;
    color: #ffffff;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(190, 208, 255, 0.12);
    color: #eef4ff;
    font-size: 0.8rem;
}

#logoutBtn {
    color: #ffffff;
    font-size: 0.9rem;
}

.page-wrap {
    max-width: 1180px;
    margin: 22px auto;
    padding: 0 20px 28px;
}

.page-wrap-wide {
    max-width: 1180px;
}

/* =========================
   PANELS
========================= */
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px 16px;
    margin-bottom: 20px;
    width: 100%;
}

.panel-head {
    margin-bottom: 12px;
}

.panel-head h2,
.panel-head h3,
.panel h3 {
    margin: 0 0 4px;
    color: #ffffff;
    line-height: 1.2;
}

.panel-head p,
.panel p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.small-panel {
    min-height: 220px;
}

.split-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

/* =========================
   FORMS / INPUTS
========================= */
.form-label,
label {
    display: block;
    color: var(--text);
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.94rem;
}

.text-input,
.search-input,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"] {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input);
    color: #ffffff;
    padding: 0 12px;
    outline: none;
}

textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input);
    color: #ffffff;
    padding: 10px 12px;
    outline: none;
}

.text-input:focus,
.search-input:focus,
select:focus,
input:focus,
textarea:focus {
    border-color: rgba(124, 163, 255, 0.65);
    box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.18);
}

.text-input[disabled],
.search-input[disabled],
input[disabled],
select[disabled],
textarea[disabled],
button[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

.password-field-wrap {
    position: relative;
}

.password-inside-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    height: 28px;
    min-width: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #dbe6ff;
    cursor: pointer;
}

.guest-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.guest-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.permissions-box {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 4px 0;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-weight: 500;
}

.perm-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

/* =========================
   BUTTONS
========================= */
.primary-btn,
.blue-btn,
.secondary-btn,
.outline-btn,
.success-btn,
.danger-btn,
.gradient-btn,
.success-wide-btn,
.table-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
    font-weight: 600;
}

.primary-btn:hover,
.blue-btn:hover,
.secondary-btn:hover,
.outline-btn:hover,
.success-btn:hover,
.danger-btn:hover,
.gradient-btn:hover,
.success-wide-btn:hover,
.table-btn:hover {
    transform: translateY(-1px);
}

.primary-btn,
.blue-btn {
    background: var(--blue-2);
}

.secondary-btn {
    background: var(--purple-2);
}

.outline-btn {
    background: #3d72ea;
}

.success-btn,
.success-wide-btn {
    background: var(--green-2);
}

.danger-btn {
    background: var(--danger-2);
}

.gradient-btn {
    background: linear-gradient(90deg, #9b5cff 0%, #7f63ff 100%);
}

.success-wide-btn,
.gradient-btn,
.blue-btn,
.secondary-btn {
    width: 100%;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.stack-buttons {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.small-blue-btn {
    background: var(--blue-2);
}

.small-red-btn {
    background: var(--danger-2);
}

.small-green-btn {
    background: var(--green-2);
}

.action-buttons-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================
   TABLES
========================= */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

thead th {
    text-align: left;
    color: #ffffff;
    font-size: 0.9rem;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(160, 184, 255, 0.12);
}

tbody td {
    color: var(--text-soft);
    padding: 12px 8px;
    border-bottom: 1px solid rgba(160, 184, 255, 0.08);
    vertical-align: top;
}

.muted-cell {
    color: var(--text-muted);
}

/* =========================
   DASHBOARD STATS
========================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    min-height: 220px;
    position: relative;
    width: 100%;
}

.stat-card h3 {
    margin: 0 0 16px;
    font-size: 0.98rem;
    color: #ffffff;
}

.stat-number {
    font-size: 3rem;
    line-height: 1;
    font-weight: 800;
    margin-bottom: 12px;
}

.blue-text {
    color: var(--blue);
}

.green-text {
    color: var(--green);
}

.purple-text {
    color: var(--purple);
}

.stat-link {
    display: inline-block;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.dot {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.blue {
    background: var(--blue);
}

.dot.green {
    background: var(--green);
}

.dot.purple {
    background: var(--purple);
}

/* =========================
   DASHBOARD LOCK / REPORTS ROW
========================= */
.dashboard-lock-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.dashboard-lock-panel,
.dashboard-reports-panel {
    min-height: 220px;
    width: 100%;
}

/* =========================
   USER DASHBOARD SPECIAL LAYOUT
========================= */
.user-dashboard-mode {
    max-width: 1250px;
}

.user-dashboard-mode #totalUsersCard {
    display: none !important;
}

.user-dashboard-mode #reportsCard {
    display: none !important;
}

.user-dashboard-mode .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

.user-dashboard-mode .stat-card,
.user-dashboard-mode #manualLockPanel,
.user-dashboard-mode #autoLockPanel {
    min-height: 220px;
    width: 100%;
}

.user-dashboard-mode #dashboardLockRow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
    margin-top: 0;
    margin-bottom: 22px;
}

.user-dashboard-mode #manualLockPanel,
.user-dashboard-mode #autoLockPanel {
    width: 100%;
}

/* =========================
   ADMIN INFO / REPORT BLOCKS
========================= */
.stack-info {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.stack-info p {
    margin: 0;
    color: var(--text-soft);
}

/* =========================
   BADGES / CHIPS / NOTES
========================= */
.badge,
.inline-chip,
.action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.badge.danger {
    background: rgba(255, 107, 92, 0.14);
    border: 1px solid rgba(255, 107, 92, 0.24);
    color: #ffd0cb;
}

.inline-chip {
    background: rgba(255, 255, 255, 0.08);
    color: #dce6ff;
    margin: 0 4px;
}

.inline-note {
    color: var(--text-soft);
    margin: 12px 0;
    line-height: 1.5;
}

.action-pill {
    background: rgba(79, 124, 255, 0.14);
    border: 1px solid rgba(79, 124, 255, 0.24);
    color: #dce6ff;
}

/* =========================
   MESSAGES
========================= */
.profile-message {
    min-height: 22px;
    margin-top: 12px;
    color: var(--text-soft);
}

.success-message {
    color: #79f0a5 !important;
}

.error-message {
    color: #ff9b90 !important;
}

/* =========================
   SEARCH / CHECKIN
========================= */
.guest-toolbar,
.checkin-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.guest-toolbar .search-input,
.checkin-search-row .search-input {
    flex: 1 1 280px;
    min-width: 220px;
}

/* =========================
   UTILITIES
========================= */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

/* =========================
   GUEST TABLE CLASSIC FIX
========================= */
.guest-row td {
    vertical-align: middle;
}

.guest-name-cell {
    min-width: 220px;
    max-width: 240px;
    line-height: 1.35;
    font-weight: 600;
    color: #dce6ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-cell {
    min-width: 220px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-cell {
    white-space: nowrap;
}

.code-cell {
    font-family: Consolas, "Courier New", monospace;
    white-space: nowrap;
    letter-spacing: 0.4px;
    font-weight: 800;
    color: #ffffff;
}

.status-cell {
    white-space: nowrap;
}

.checkin-time-cell {
    min-width: 120px;
    white-space: nowrap;
    color: #b9c8f7;
}

.qr-cell {
    width: 70px;
    min-width: 70px;
    white-space: nowrap;
    text-align: left;
}

.action-buttons-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.guest-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.table-btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.table-btn:hover {
    opacity: 0.94;
}

.table-wrap table {
    min-width: 960px;
}

.table-wrap table td {
    vertical-align: middle;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
    .stats-grid,
    .dashboard-lock-row,
    .content-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .topbar {
        height: auto;
        padding-top: 10px;
        padding-bottom: 10px;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-left,
    .topbar-right,
    .nav-right {
        width: 100%;
    }

    .nav-left {
        gap: 12px;
    }

    .page-wrap {
        padding: 0 12px 24px;
    }

    .stats-grid,
    .dashboard-lock-row,
    .content-grid,
    .user-dashboard-mode .stats-grid,
    .user-dashboard-mode #dashboardLockRow,
    .guest-form-grid {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .dashboard-lock-panel,
    .dashboard-reports-panel,
    .small-panel {
        min-height: auto;
    }

    .button-row,
    .guest-form-actions,
    .guest-toolbar,
    .checkin-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    table {
        min-width: 900px;
    }

    .guest-action-buttons,
    .action-buttons-cell {
        flex-wrap: nowrap;
    }
}
/* =========================
   GUEST TOOLBAR POLISH
========================= */

.guest-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.guest-toolbar .search-input {
    width: 100%;
    min-width: 0;
}

.guest-toolbar .secondary-btn,
.guest-toolbar .success-wide-btn {
    width: auto;
    min-width: 120px;
    height: 40px;
    padding: 0 16px;
}

@media (max-width: 900px) {
    .guest-toolbar {
        grid-template-columns: 1fr;
    }

    .guest-toolbar .secondary-btn,
    .guest-toolbar .success-wide-btn {
        width: 100%;
    }
}

/* The approved login deliberately uses two architectural halves: a bright
   corporate brand field and a navy authentication field. Pseudo-elements add
   restrained map/grid geometry without introducing a fake brand asset. */
.amisda-login-shell {
    min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(430px, .92fr);
    align-items: stretch; gap: 0; padding: 0; background: var(--amisda-navy-dark);
}
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: center; max-width: none; overflow: hidden; padding: clamp(48px, 8vw, 110px); color: var(--amisda-navy); background: #f8fafc; }
.login-brand-panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .48; background: linear-gradient(rgba(23,79,159,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(23,79,159,.08) 1px, transparent 1px), radial-gradient(ellipse at 35% 45%, transparent 28%, rgba(23,79,159,.08) 29%, transparent 30%); background-size: 38px 38px, 38px 38px, 100% 100%; }
.login-brand-panel::after { content: ""; position: absolute; width: 220px; height: 520px; right: -155px; bottom: -180px; transform: rotate(34deg); background: var(--amisda-red); box-shadow: -95px -80px 0 var(--amisda-navy); }
.login-brand-panel > * { position: relative; z-index: 1; }
.amisda-logo-panel { display: inline-flex; align-self: flex-start; margin-bottom: 28px; background: transparent; }
.amisda-official-logo { display: block; width: min(280px, 65vw); height: auto; object-fit: contain; }
.login-brand-panel h1 { margin: 18px 0 14px; font-size: clamp(2.4rem, 5vw, 5rem); line-height: .98; letter-spacing: -.045em; }
.login-brand-panel p { margin: 0; color: #415672; font-size: clamp(1.05rem, 1.7vw, 1.35rem); }
.brand-rule { width: 72px; height: 3px; margin: 34px 0 20px; background: var(--amisda-red); }
.login-brand-panel span { color: #61738b; }
.amisda-login-card { align-self: center; justify-self: center; width: min(calc(100% - 56px), 440px); margin: 0; padding: 42px; color: var(--amisda-navy); background: var(--amisda-white); border-color: rgba(8,35,78,.12); box-shadow: 0 28px 60px rgba(0,0,0,.32); }
.amisda-login-card .login-form label { color: #354a67; }
.amisda-login-card input { color: #132b55; background: #f5f8fc; border-color: #cbd6e4; }
.login-eyebrow { color: var(--amisda-red); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.amisda-login-card h2 { margin: 10px 0 8px; font-size: 2rem; }
.login-intro { margin: 0 0 28px; color: #63748a; }
.amisda-login-card .primary-btn { background: var(--amisda-blue); }

.page-heading { margin-bottom: 22px; }
.page-heading h1 { margin: 4px 0 8px; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.page-heading > p:last-child { margin: 0; color: var(--amisda-muted); }
.password-gate-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 10%, rgba(23,79,159,.28), transparent 38%), var(--amisda-navy-dark); }
.password-gate-card { width: min(100%, 520px); padding: 38px; border-radius: 20px; color: var(--amisda-navy); background: white; box-shadow: var(--shadow); }
.password-gate-card h1 { margin: 6px 0 10px; }
.password-gate-card > p:not(.dashboard-kicker) { color: #63748a; line-height: 1.55; }
.password-gate-card .login-form label { color: #354a67; }
.password-gate-card input { color: #132b55; background: #f5f8fc; border-color: #cbd6e4; }
.password-gate-logo { display: block; width: 190px; height: auto; margin-bottom: 20px; }
.password-gate-card > .outline-btn { width: 100%; margin-top: 12px; background: #64748b; }
.admin-users-frame { display: block; width: 100%; min-height: 980px; border: 0; border-radius: 14px; background: var(--bg-main); }
.embedded-users-page { padding: 0; }
.dashboard-event-selector { width: min(100%, 360px); margin: 12px 0 18px; }
.dashboard-event-selector label { display: block; margin-bottom: 6px; color: var(--amisda-muted); font-size: .8rem; }
.invitation-tool-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--amisda-border); }
.invitation-field-controls { display: grid; gap: 10px; }
.invitation-field-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(120px, 1fr)); gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--amisda-border); border-radius: 12px; }
@media (max-width: 760px) { .invitation-field-row { grid-template-columns: 1fr; } }

/* Dashboard-only command center layout keeps Guests/Users/Admin styling intact. */
.dashboard-command { display: grid; gap: 22px; min-width: 0; }
.dashboard-command > *, .dashboard-primary-grid > *, .dashboard-search-panel .table-wrap { min-width: 0; max-width: 100%; }
.dashboard-hero { display: flex; justify-content: space-between; gap: 28px; align-items: end; padding: 34px 38px; border: 1px solid rgba(120,165,255,.2); border-radius: 18px; background: linear-gradient(125deg, #10233f, #172c4a); box-shadow: 0 18px 46px rgba(0,0,0,.18); }
.dashboard-hero h1 { margin: 6px 0 8px; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.05; }
.dashboard-hero p { margin: 0; color: #adbbce; }
.dashboard-kicker { color: #7eace9 !important; font-size: .72rem; font-weight: 900; letter-spacing: .15em; }
.dashboard-hero-status { display: grid; gap: 8px; min-width: 130px; color: #91a0b4; text-align: right; }
.dashboard-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dashboard-metrics .stat-card { min-width: 0; min-height: 132px; padding: 16px 18px; background: var(--amisda-surface); border-color: var(--amisda-border); }
.dashboard-metrics .stat-number { margin: 8px 0 6px; font-size: clamp(1.65rem, 2.3vw, 2.25rem); line-height: 1; }
.dashboard-metrics .stat-card h3 { font-size: .9rem; }
.stat-caption { color: #7f90a8; font-size: .78rem; }
.dot.amber { background: #d5ad58; }.amber-text { color: #d5ad58; }
.dashboard-primary-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .75fr); gap: 22px; }
.quick-actions-panel { display: flex; flex-direction: column; }
.command-action { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; color: #e9f0fb; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.09); }
.command-action:hover { color: #78a5ff; }
.operations-row { margin: 0; }
@media (max-width: 1100px) { .dashboard-primary-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .amisda-login-shell { grid-template-columns: 1fr; }.login-brand-panel { min-height: 44vh; padding: 46px 28px; }.amisda-login-card { margin: 42px auto; width: min(calc(100% - 44px), 520px); }.dashboard-hero { align-items: flex-start; flex-direction: column; }.dashboard-hero-status { text-align: left; }.dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .login-brand-panel h1 { font-size: 2.35rem; }.amisda-login-card { padding: 28px 22px; }.dashboard-metrics { grid-template-columns: 1fr; }.dashboard-hero { padding: 26px 22px; } }
.code-config-input { min-height: 260px; font: 13px/1.55 Consolas, monospace; }
.invitation-preview-wrap { margin-top: 20px; display: flex; justify-content: center; border-radius: 14px; background: rgba(0,0,0,.18); overflow: hidden; }
.invitation-preview-wrap img:not([src]) { display: none; }
.invitation-preview-wrap img { width: min(100%, 520px); height: auto; object-fit: contain; }

/* Invitation Designer: the 1080x1350 coordinate system is scaled visually,
   while saved coordinates remain identical to the canonical Pillow renderer. */
.invitation-designer-toolbar { display: grid; grid-template-columns: minmax(210px,1fr) minmax(210px,1fr) auto auto minmax(210px,1fr) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.invitation-designer-grid { display: grid; grid-template-columns: minmax(220px,.72fr) minmax(420px,1.65fr) minmax(240px,.78fr); gap: 18px; align-items: start; }
.invitation-gallery-panel,.invitation-properties-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.template-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.template-card { appearance: none; display: grid; gap: 8px; min-width: 0; padding: 7px; color: var(--amisda-text); text-align: left; background: rgba(255,255,255,.035); border: 1px solid var(--amisda-border); border-radius: 10px; cursor: pointer; }
.template-card:hover,.template-card.selected { border-color: var(--amisda-blue); box-shadow: 0 0 0 2px rgba(23,79,159,.2); }
.template-card img,.template-fallback-thumb { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 7px; background: linear-gradient(145deg,#10233f,#1b3b65); }
.template-card span:last-child { display: grid; gap: 2px; }.template-card strong { font-size: .78rem; }.template-card small { color: var(--amisda-muted); font-size: .65rem; }
.template-card-wrap { display:grid; gap:5px; }.template-delete-btn { border:1px solid #b44949; color:#ffb5b5; background:transparent; border-radius:7px; padding:5px; cursor:pointer; }
.designer-upload-block { display: grid; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--amisda-border); }.designer-upload-block h3,.designer-upload-block p { margin: 0; }.designer-upload-block p { color: var(--amisda-muted); font-size: .78rem; line-height: 1.45; }
.invitation-canvas { position: relative; width: min(100%,600px); aspect-ratio: 4/5; margin: 0 auto; overflow: hidden; background: #10233f; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 24px 54px rgba(0,0,0,.28); touch-action: none; }
.canvas-background,.canvas-background-fallback,.canvas-elements { position: absolute; inset: 0; width: 100%; height: 100%; }.canvas-background { object-fit: cover; }.canvas-background-fallback { background: linear-gradient(150deg,#0d2342,#173e6b); }
.canvas-field { position: absolute; z-index: 2; max-width: 100%; padding: 0; color: white; white-space: normal; overflow-wrap: normal; line-height: 1.1; background: transparent; border: 1px dashed transparent; border-radius: 4px; cursor: move; user-select: none; }
.canvas-field:hover,.canvas-field.selected { border-color: #ff3b49; background: rgba(8,25,52,.2); }.canvas-field-qr { display: grid; place-items: center; color: #0b2345 !important; font-size: 12px !important; font-weight: 800 !important; line-height: 1.1; background: repeating-linear-gradient(45deg,#fff 0 5px,#111 5px 8px) !important; border: 8px solid white !important; }
.element-properties { display: grid; gap: 14px; }.designer-toggle { display: flex; gap: 9px; align-items: center; font-weight: 700; }.property-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.property-grid label { color: var(--amisda-muted); font-size: .75rem; }.property-grid .text-input { margin-top: 5px; }.property-help { color: var(--amisda-muted); font-size: .75rem; line-height: 1.5; }
.full-preview-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--amisda-border); }.full-preview-panel .panel-head { display: flex; justify-content: space-between; align-items: center; }.full-preview-panel img { display: block; width: min(100%,600px); margin: 0 auto; border-radius: 10px; }
@media (max-width: 1180px) { .invitation-designer-toolbar { grid-template-columns: repeat(3,minmax(0,1fr)); }.invitation-designer-grid { grid-template-columns: minmax(220px,.75fr) minmax(420px,1.5fr); }.invitation-properties-panel { position: static; grid-column: 1/-1; }.property-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 780px) { .invitation-designer-toolbar,.invitation-designer-grid { grid-template-columns: 1fr; }.invitation-gallery-panel,.invitation-properties-panel { position: static; max-height: none; }.template-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }.property-grid { grid-template-columns: 1fr 1fr; } }
.qr-verification-result {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #d7e1ec;
  border-left: 4px solid #177245;
  border-radius: 10px;
  background: #f8fbfd;
}

.qr-verification-result dl {
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr;
  gap: 8px 16px;
  margin: 12px 0 16px;
}

.qr-verification-result dt { color: #64748b; font-weight: 600; }
.qr-verification-result dd { margin: 0; color: #17233b; font-weight: 700; }
