/* ============================================
   TaxEase — Global Design System
   TaxEase navy + green, mobile-first
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors */
    --bg-primary: #0A1B4F;
    --bg-secondary: #0A1B4F;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f7fb;
    --bg-input: #ffffff;

    --accent: #08CE7F;
    --accent-hover: #08CE7F;
    --accent-glow: rgba(8, 206, 127, 0.15);
    --accent-dim: rgba(8, 206, 127, 0.4);

    --danger: #ff4757;
    --danger-bg: rgba(255, 71, 87, 0.12);
    --warning: #ffa502;
    --warning-bg: rgba(255, 165, 2, 0.12);
    --success: #08CE7F;
    --success-bg: rgba(8, 206, 127, 0.12);

    --text-primary: #F2F3F3;
    --text-secondary: #7b8794;
    --text-muted: #94a0ad;
    --text-accent: var(--accent);

    --border: rgba(8, 20, 61, 0.08);
    --border-accent: rgba(8, 206, 127, 0.25);

    /* Spacing */
    --nav-height: 64px;
    --bottom-nav-height: 72px;
    --page-padding: 20px;
    --card-radius: 8px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    /* Shadows */
    --shadow-card: 0 8px 26px rgba(1, 9, 40, 0.18);
    --shadow-glow: 0 0 20px rgba(8, 206, 127, 0.1);
    --shadow-button: 0 4px 16px rgba(8, 206, 127, 0.3);
}

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

[hidden] {
    display: none !important;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* ============================================
   Admin
   ============================================ */

.app.admin-app {
    width: min(calc(100% - 56px), 1280px);
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.app.admin-app .header {
    position: relative;
    padding: 24px 0 18px;
}

.app.admin-app .page-content {
    padding: 0 0 72px;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-mode-pill {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(8, 206, 127, 0.35);
    border-radius: 999px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-back-btn {
    height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #ffffff;
    color: #0A1B4F;
    font-weight: 800;
}

.admin-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 0 26px;
}

.admin-hero h1 {
    color: #ffffff;
    font-size: 44px;
    line-height: 1.05;
    font-weight: 900;
}

.admin-hero p {
    color: rgba(242, 243, 243, 0.72);
    font-size: 17px;
    margin-top: 8px;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.admin-stat {
    margin-bottom: 0;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.admin-stat span,
.admin-data-grid span {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-stat strong {
    display: block;
    color: #0A1B4F;
    font-size: 30px;
    line-height: 1.2;
    margin-top: 4px;
}

.admin-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
    align-items: end;
    gap: 24px;
    margin-bottom: 16px;
}

.admin-toolbar .form-group {
    margin-bottom: 0;
}

.admin-toolbar-note {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: right;
}

.admin-state {
    color: #0A1B4F;
}

.admin-user-list {
    display: grid;
    gap: 14px;
}

.admin-user-card {
    margin-bottom: 0;
    padding: 22px;
}

.admin-user-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-user-head h2 {
    color: #0A1B4F;
    font-size: 20px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.admin-user-head a {
    font-size: 14px;
    font-weight: 700;
}

.admin-user-meta {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 13px;
}

.admin-user-id {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.admin-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.admin-data-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #e7edf3;
    border-radius: 8px;
    background: #e7edf3;
}

.admin-data-grid > div {
    min-height: 76px;
    padding: 12px;
    background: #fbfdff;
}

.admin-data-grid strong {
    display: block;
    color: #0A1B4F;
    font-size: 14px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .app.admin-app {
        padding: 0;
        width: min(100%, 480px);
    }

    .app.admin-app .header,
    .app.admin-app .page-content {
        padding-left: var(--page-padding);
        padding-right: var(--page-padding);
    }

    .admin-header-actions {
        gap: 8px;
    }

    .admin-mode-pill {
        display: none;
    }

    .admin-back-btn {
        font-size: 13px;
        padding: 0 12px;
    }

    .admin-hero h1 {
        font-size: 34px;
    }

    .admin-toolbar {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .admin-toolbar-note {
        text-align: left;
    }

    .admin-summary-grid,
    .admin-data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-head {
        flex-direction: column;
    }

    .admin-user-meta {
        align-items: flex-start;
    }
}

/* ============================================
   App Shell
   ============================================ */

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Top Header Bar */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--page-padding);
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0;
    background: #0A1B4F;
    border-radius: 4px;
    padding: 4px 8px;
}

.header-logo .logo-img {
    height: 34px;
    width: auto;
}

.header-logo .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: none;
    /* Hidden when using image logo */
}

.header-logo .logo-text span {
    color: var(--accent);
}

.header-avatar {
    width: 38px;
    height: 38px;
    background: var(--bg-card);
    border: 2px solid var(--border-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
}

.header-avatar:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

/* ============================================
   Page Content
   ============================================ */

.page-content {
    flex: 1;
    padding: 0 var(--page-padding) 100px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
    color: #0A1B4F;
}

.task-card,
.month-card {
    color: #0A1B4F;
}

.card .value,
.card .stat-value,
.card .kata-amount,
.task-card .task-title,
.month-card .stat-value,
.item-title {
    color: #0A1B4F;
}

.card .form-input,
.auth-form .form-input {
    color: #0A1B4F;
    border-color: #d7e0e8;
}

.card:hover {
    border-color: var(--border-accent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #0A1B4F;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.card-badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.card-badge.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ============================================
   KATA Keret Card (main highlight)
   ============================================ */

.kata-card {
    background: #ffffff;
    border: 1px solid var(--border-accent);
    position: relative;
    overflow: hidden;
}

.kata-card::before {
    content: none;
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.kata-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.kata-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.kata-amount {
    font-size: 15px;
    color: var(--text-primary);
}

.kata-percent {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.kata-percent.over {
    color: var(--danger);
}

/* Progress bar */
.progress-bar {
    height: 7px;
    background: #edf2f7;
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent) 0%, #08CE7F 100%);
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.progress-fill.over {
    background: linear-gradient(90deg, var(--danger) 0%, #ff6b81 100%);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   Bevallás (Task) Cards
   ============================================ */

.task-row {
    display: flex;
    gap: 12px;
}

.task-card {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
}

.task-card .task-title {
    font-size: 13px;
    font-weight: 600;
    color: #0A1B4F;
    margin-bottom: 12px;
}

.task-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.task-status .icon {
    font-size: 16px;
}

.task-status .text {
    font-size: 13px;
    font-weight: 500;
}

.task-status.done .text {
    color: var(--success);
}

.task-status.pending .text {
    color: var(--warning);
}

.task-deadline {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Monthly Invoice Cards
   ============================================ */

.month-card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    transition: all 0.25s;
}

.month-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.month-card .month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.month-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.month-card .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.month-card .stat-label {
    color: var(--text-secondary);
}

.month-card .stat-value {
    color: var(--text-primary);
    font-weight: 500;
}

.within-limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    cursor: default;
}

.within-limit-badge.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(8, 206, 127, 0.2);
}

.within-limit-badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 71, 87, 0.2);
}

/* ============================================
   Bottom Navigation
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--bottom-nav-height);
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    backdrop-filter: blur(12px);
}

.app {
    background: var(--bg-primary);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 7px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-muted);
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent);
}

.nav-item.active {
    background: rgba(8, 206, 127, 0.14);
}

.nav-item .nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-item .nav-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.flow-hero {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.flow-title {
    font-size: 24px;
    line-height: 1.15;
    font-weight: 800;
}

.flow-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.quick-action {
    min-height: 92px;
    justify-content: space-between;
    align-items: flex-start;
    color: var(--text-primary);
}

.quick-action strong {
    display: block;
    margin-top: 10px;
    font-size: 14px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.status-pill.success {
    color: var(--success);
    background: var(--success-bg);
}

.status-pill.warning {
    color: var(--warning);
    background: var(--warning-bg);
}

.list-card {
    display: grid;
    gap: 10px;
}

.invoice-item,
.knowledge-item {
    display: grid;
    gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.invoice-item:last-child,
.knowledge-item:last-child {
    border-bottom: none;
}

.item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.item-title {
    font-size: 14px;
    font-weight: 700;
}

.item-meta {
    color: var(--text-muted);
    font-size: 12px;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.segmented button {
    border: 0;
    border-radius: 8px;
    padding: 10px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.segmented button.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.empty-state {
    padding: 30px 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(8, 206, 127, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-glow);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   Form Elements
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 6px;
}

/* ============================================
   Welcome / Auth Pages
   ============================================ */

.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 0 18px 80px;
    text-align: center;
    background: var(--bg-primary);
    max-width: 430px;
}

.auth-page .brand-logo {
    width: 100px;
    height: 100px;
    background: var(--accent);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow), 0 8px 32px rgba(8, 206, 127, 0.2);
    animation: floatIn 0.6s ease-out;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-page .brand-logo svg {
    width: 52px;
    height: 52px;
    fill: var(--bg-primary);
}

.auth-page .brand-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-page .brand-title span {
    color: var(--accent);
}

.auth-page .brand-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.auth-form {
    width: 100%;
    max-width: none;
}

.auth-brand-strip {
    width: calc(100% + 36px);
}

.auth-flow-title {
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    margin: 56px 0 30px;
}

.auth-form .form-group {
    text-align: left;
}

#loginView,
#registerView {
    width: 100%;
    max-width: 394px;
}

.auth-form .form-input {
    min-height: 54px;
    border-radius: 10px;
    font-size: 16px;
}

.auth-form .btn {
    min-height: 54px;
    border-radius: 10px;
}

.auth-switch {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   Greeting section
   ============================================ */

.greeting {
    margin-bottom: 24px;
}

.greeting h1 {
    font-size: 24px;
    font-weight: 700;
}

.greeting .wave {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(14deg);
    }

    50% {
        transform: rotate(-4deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* ============================================
   Settings List
   ============================================ */

.settings-list {
    list-style: none;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

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

.settings-item .left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item .icon-circle {
    width: 40px;
    height: 40px;
    background: var(--accent-glow);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
}

.settings-item .label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-item .sublabel {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-item .arrow {
    color: var(--text-muted);
    font-size: 18px;
}

/* ============================================
   Info row (small detail lines)
   ============================================ */

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 13px;
}

.info-row .label {
    color: var(--text-secondary);
}

.info-row .value {
    color: var(--text-primary);
    font-weight: 500;
}

.info-row .value.accent {
    color: var(--accent);
}

.info-row .value.muted {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   Divider
   ============================================ */

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* ============================================
   Section Title
   ============================================ */

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 12px;
}

/* ============================================
   Sync button / card
   ============================================ */

.sync-card {
    text-align: center;
    padding: 32px 20px;
}

.sync-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
}

.sync-icon.spinning {
    animation: spin 1s linear infinite;
}

.sync-status {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ============================================
   Toast notification
   ============================================ */

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    max-width: 400px;
    width: calc(100% - 40px);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

/* ============================================
   Loading skeleton
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-xs);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Responsive tweaks for wider screens
   ============================================ */

@media (min-width: 480px) {
    .app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

/* ============================================
   Page transition
   ============================================ */

.page-enter {
    opacity: 0;
    transform: translateX(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

/* ============================================
   SVG Icon System
   ============================================ */

.icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 1;
    flex-shrink: 0;
}

.icon-svg svg {
    width: 100%;
    height: 100%;
}

.icon-svg.sm {
    font-size: 16px;
}

.icon-svg.md {
    font-size: 20px;
}

.icon-svg.lg {
    font-size: 24px;
}

/* Final contrast pass for the Adalo-style white cards on navy background. */
.card,
.month-card,
.task-card {
    color: #0A1B4F;
}

.card-title,
.task-title,
.task-card .task-title svg,
.card-title svg {
    color: #0A1B4F;
    stroke: #0A1B4F;
}

.month-card .stat-value,
.month-card .stat-label,
.card .value,
.card .label,
.card .kata-amount,
.card .item-title,
.card .item-head strong {
    color: #0A1B4F;
}

.month-card .stat-label,
.card .label,
.item-meta {
    color: #7b8794;
}

.month-card {
    cursor: pointer;
}

.month-open-btn {
    margin-top: 16px;
    padding: 10px 14px;
    border-width: 1px;
}

.invoice-day {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.invoice-day:first-child {
    border-top: 0;
    padding-top: 0;
}

.invoice-day-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #0A1B4F;
    font-size: 13px;
    margin-bottom: 8px;
}

.invoice-day-head span {
    color: #7b8794;
    white-space: nowrap;
}

.source-summary {
    display: grid;
    gap: 6px;
    padding: 10px 0;
    margin: 6px 0 8px;
    border-top: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
}

.source-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #7b8794;
    font-size: 12px;
}

.source-summary-row strong {
    color: #0A1B4F;
    font-weight: 700;
    text-align: right;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 8px;
    margin-left: 6px;
    border-radius: 999px;
    background: #edf2f7;
    color: #0A1B4F;
    font-size: 11px;
    font-weight: 800;
    vertical-align: middle;
}

.source-badge.osa {
    background: rgba(8, 206, 127, 0.14);
    color: #057a51;
}

.source-badge.opg {
    background: rgba(10, 27, 79, 0.12);
    color: #0A1B4F;
}

.source-badge.manual {
    background: rgba(255, 165, 2, 0.16);
    color: #8a5a00;
}

/* Registration / first-run onboarding flow */
.onboarding-app {
    background: var(--bg-primary);
    max-width: 430px;
}

.onboarding-brand {
    background: #ffffff;
    border-bottom-left-radius: 42px;
    border-bottom-right-radius: 42px;
    display: flex;
    justify-content: center;
    padding: 22px 20px 18px;
    margin-bottom: 34px;
}

.onboarding-brand img {
    height: 58px;
    width: auto;
}

.onboarding-stage {
    padding: 0 18px 80px;
}

.onboarding-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px 18px;
    color: #0A1B4F;
    box-shadow: var(--shadow-card);
}

.onboarding-card.wide {
    padding: 18px;
}

.onboarding-card h1,
.onboarding-title-row h1 {
    color: #0A1B4F;
    font-size: 17px;
    line-height: 1.25;
    margin: 0 0 18px;
    font-weight: 800;
}

.onboarding-card .green-title {
    color: var(--accent);
    font-size: 20px;
    margin-bottom: 14px;
}

.onboarding-card .form-group {
    margin-bottom: 12px;
}

.onboarding-card .form-input {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 4px;
    border-color: #d5d9df;
    font-size: 14px;
}

.privacy-row {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: start;
    color: #2f3a4c;
    font-size: 12px;
    line-height: 1.45;
    margin: 8px 0 18px;
}

.privacy-row input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.onboarding-card .btn-primary {
    min-height: 44px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.onboarding-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.info-link {
    width: 28px;
    height: 28px;
    border: 2px solid #8794a6;
    border-radius: 50%;
    color: #0A1B4F;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.segmented.vertical {
    grid-template-columns: 1fr;
    background: transparent;
    border: 0;
    padding: 0;
    margin-bottom: 16px;
}

.segmented.vertical button {
    background: #0A1B4F;
    color: #ffffff;
    border-radius: 4px;
}

.segmented.vertical button.active {
    background: var(--accent);
    color: #ffffff;
}

.lottie-box {
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lottie-box lottie-player {
    width: 230px;
    height: 160px;
}

.choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.muted-inline {
    color: #7b8794;
    font-weight: 500;
}

.sync-fullscreen {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
}

.sync-fullscreen h1 {
    color: #ffffff;
    font-size: 17px;
    margin-top: 18px;
}

.sync-fullscreen p {
    color: #dbe5ee;
    font-size: 13px;
    margin-top: 8px;
}

.big-sync-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 18px solid var(--accent);
    border-top-color: #ffffff;
    animation: spin 0.9s linear infinite;
}

.help-back {
    display: block;
    background: #ffffff;
    color: #0A1B4F;
    font-weight: 700;
    margin-bottom: 14px;
}

.help-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0A1B4F;
    border-radius: 4px;
    margin-bottom: 14px;
}

.help-copy {
    background: #ffffff;
    color: #0A1B4F;
    border-radius: 8px;
    margin-bottom: 22px;
}

.help-copy h1 {
    margin-bottom: 8px;
}

.help-copy p {
    color: #2f3a4c;
    font-size: 15px;
    line-height: 1.45;
}

/* Welcome screen */
.welcome-body {
    background: #ffffff;
    color: #0A1B4F;
    min-height: 100vh;
}

.welcome-shell {
    width: min(100vw, 430px);
    min-height: 100vh;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #d1d5dc;
    box-shadow: 0 16px 38px rgba(7, 20, 61, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 46px 28px;
}

.welcome-main-logo {
    width: 260px;
    max-width: 82%;
    height: auto;
    margin-bottom: 38px;
}

.welcome-illustration {
    width: 160px;
    height: auto;
    margin-bottom: 42px;
}

.welcome-actions {
    width: 100%;
    display: grid;
    gap: 20px;
}

.welcome-register {
    width: 100%;
    height: 42px;
    background: #0A1B4F;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.2px;
    box-shadow: 0 4px 8px rgba(7, 20, 61, 0.24);
}

.welcome-login {
    color: var(--accent);
    text-align: center;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

@media (max-width: 480px) {
    .welcome-shell {
        border: 0;
        box-shadow: none;
    }
}

.icon-svg.xl {
    font-size: 32px;
}

.icon-svg.xxl {
    font-size: 48px;
}

/* Nav icons */
.nav-item .nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-item .nav-icon .icon-svg {
    font-size: 22px;
}

/* colored variants */
.icon-svg.accent {
    color: var(--accent);
}

.icon-svg.success {
    color: var(--success);
}

.icon-svg.danger {
    color: var(--danger);
}

.icon-svg.warning {
    color: var(--warning);
}

.icon-svg.muted {
    color: var(--text-muted);
}

/* Final form contrast pass */
.form-input,
input.form-input,
select.form-input,
textarea.form-input {
    background: #ffffff;
    color: #0A1B4F;
    caret-color: #0A1B4F;
    -webkit-text-fill-color: #0A1B4F;
    color-scheme: light;
}

.form-input::placeholder,
input.form-input::placeholder,
textarea.form-input::placeholder {
    color: #8a96a8;
    opacity: 1;
    -webkit-text-fill-color: #8a96a8;
}

.form-input:focus,
input.form-input:focus,
select.form-input:focus,
textarea.form-input:focus {
    color: #0A1B4F;
    -webkit-text-fill-color: #0A1B4F;
}

input.form-input:-webkit-autofill,
input.form-input:-webkit-autofill:hover,
input.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0A1B4F;
    box-shadow: 0 0 0 1000px #ffffff inset;
}

/* ============================================
   Admin SaaS dashboard override
   ============================================ */

body:has(.admin-app) {
    background: #07133a;
}

.app.admin-app {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    background: #07133a;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: #081846;
}

.admin-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 34px;
}

.admin-brand img {
    width: 148px;
    height: auto;
}

.admin-brand span {
    border: 1px solid rgba(8, 206, 127, 0.35);
    border-radius: 999px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    padding: 6px 9px;
    text-transform: uppercase;
}

.admin-side-nav {
    display: grid;
    gap: 8px;
}

.admin-side-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    border-radius: 8px;
    color: rgba(242, 243, 243, 0.72);
    font-size: 14px;
    font-weight: 800;
    padding: 0 12px;
}

.admin-side-nav a.active,
.admin-side-nav a:hover {
    background: rgba(8, 206, 127, 0.12);
    color: #ffffff;
}

.admin-main {
    min-width: 0;
    padding: 34px 36px 48px;
}

.admin-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-topbar h1 {
    color: #ffffff;
    font-size: 34px;
    font-weight: 900;
    line-height: 1.1;
}

.admin-topbar p {
    color: rgba(242, 243, 243, 0.66);
    font-size: 15px;
    margin-top: 6px;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-summary-grid {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-stat.card {
    min-height: 110px;
    border: 1px solid #e4ebf2;
    box-shadow: none;
}

.admin-stat strong {
    font-size: 26px;
    overflow-wrap: anywhere;
}

.admin-workspace {
    display: grid;
    grid-template-columns: minmax(680px, 1.2fr) minmax(420px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.admin-directory-full {
    width: 100%;
}

.admin-directory.card,
.admin-detail.card {
    margin: 0;
    box-shadow: none;
    border: 1px solid #e4ebf2;
}

.admin-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-panel-head h2 {
    color: #0A1B4F;
    font-size: 20px;
    font-weight: 900;
}

.admin-panel-head p,
.admin-panel-head span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.admin-filters {
    margin-bottom: 14px;
}

.admin-state {
    color: #0A1B4F;
    padding: 18px 0;
}

.admin-table {
    display: grid;
    border: 1px solid #e7edf3;
    border-radius: 8px;
    overflow: hidden;
}

.admin-table-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) 140px minmax(150px, 0.9fr) 140px 150px 150px;
    gap: 14px;
    align-items: center;
    min-height: 64px;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid #e7edf3;
    background: #ffffff;
    color: #0A1B4F;
    font: inherit;
    text-align: left;
}

.admin-table-row:last-child {
    border-bottom: 0;
}

.admin-table-head {
    min-height: 44px;
    background: #f6f9fc;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-user-row {
    cursor: pointer;
}

.admin-user-row:hover,
.admin-user-row.active {
    background: #eefbf6;
}

.admin-user-row strong {
    display: block;
    color: #0A1B4F;
    font-size: 14px;
    font-weight: 900;
}

.admin-user-row small {
    color: var(--text-secondary);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.admin-row-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-detail {
    position: sticky;
    top: 24px;
}

.admin-detail-view {
    display: grid;
    gap: 14px;
}

.admin-detail-full {
    position: relative;
    top: auto;
    width: 100%;
}

.admin-back-link {
    width: fit-content;
    min-height: 40px;
    border: 1px solid rgba(8, 206, 127, 0.35);
    border-radius: 8px;
    background: rgba(8, 206, 127, 0.12);
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    padding: 0 14px;
}

.admin-back-link::before {
    content: "< ";
}

.admin-empty-detail {
    min-height: 300px;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
}

.admin-empty-detail strong {
    color: #0A1B4F;
    font-size: 18px;
}

.admin-empty-detail span {
    color: var(--text-secondary);
}

.admin-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-eyebrow {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 900;
}

.admin-detail-head h2 {
    color: #0A1B4F;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
}

.admin-detail-pills {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.admin-action-row,
.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.admin-edit-btn,
.admin-save-btn {
    background: var(--accent);
    color: #0A1B4F;
    border-radius: 8px;
    font-weight: 900;
    min-height: 42px;
    padding: 0 18px;
}

.admin-delete-btn {
    background: #fff0f2;
    color: var(--danger);
    border: 1px solid rgba(255, 71, 87, 0.24);
    border-radius: 8px;
    font-weight: 900;
    min-height: 42px;
    padding: 0 18px;
}

.admin-cancel-btn {
    background: #eef3f7;
    color: #0A1B4F;
    border-radius: 8px;
    font-weight: 900;
    min-height: 42px;
    padding: 0 18px;
}

.admin-edit-form {
    display: block;
}

.admin-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-edit-field,
.admin-check-field {
    display: grid;
    gap: 7px;
}

.admin-edit-field span,
.admin-check-field span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.admin-check-field {
    align-content: end;
    min-height: 78px;
    border: 1px solid #d7e0e8;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
}

.admin-check-field input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.admin-detail-metrics,
.admin-key-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #e7edf3;
    border-radius: 8px;
    background: #e7edf3;
    margin-bottom: 18px;
}

.admin-detail-metrics > div,
.admin-key-grid > div {
    min-height: 74px;
    padding: 12px;
    background: #fbfdff;
}

.admin-detail-metrics span,
.admin-key-grid span,
.admin-status-list span,
.admin-source-row span {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-detail-metrics strong,
.admin-key-grid strong,
.admin-status-list strong {
    color: #0A1B4F;
    display: block;
    font-size: 16px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.admin-detail-section {
    margin-top: 18px;
}

.admin-detail-section h3 {
    color: #0A1B4F;
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 10px;
}

.admin-status-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.admin-status-list > div {
    border: 1px solid #e7edf3;
    border-radius: 8px;
    padding: 12px;
}

.admin-status-list small {
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.admin-source-bars {
    display: grid;
    gap: 12px;
}

.admin-source-row {
    display: grid;
    grid-template-columns: 150px 1fr 44px;
    align-items: center;
    gap: 12px;
}

.admin-source-row strong {
    color: #0A1B4F;
    display: block;
    font-size: 13px;
    margin-top: 2px;
}

.admin-source-row small {
    color: var(--text-secondary);
    font-weight: 800;
    text-align: right;
}

.admin-mini-bar {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #e7edf3;
}

.admin-mini-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.admin-activity-list {
    display: grid;
    gap: 8px;
}

.admin-activity-item {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #e7edf3;
    border-radius: 8px;
    padding: 10px;
}

.admin-source {
    border-radius: 999px;
    background: rgba(8, 206, 127, 0.12);
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    padding: 5px 7px;
    text-align: center;
}

.admin-activity-item strong,
.admin-activity-item b {
    color: #0A1B4F;
    font-size: 13px;
}

.admin-activity-item small {
    color: var(--text-secondary);
    display: block;
    font-size: 12px;
}

.admin-muted-box {
    border: 1px solid #e7edf3;
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 14px;
}

@media (max-width: 1120px) {
    .app.admin-app {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 24px;
    }

    .admin-brand {
        margin-bottom: 0;
    }

    .admin-side-nav {
        display: flex;
    }

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

    .admin-table-row {
        grid-template-columns: minmax(220px, 1.5fr) 120px minmax(140px, 0.9fr) 110px 130px 130px;
    }

    .admin-detail {
        position: relative;
        top: auto;
    }
}

@media (max-width: 760px) {
    .admin-main {
        padding: 22px 16px 34px;
    }

    .admin-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-table-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 14px;
    }

    .admin-table-head {
        display: none;
    }

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

    .admin-detail-metrics,
    .admin-key-grid,
    .admin-status-list,
    .admin-edit-grid {
        grid-template-columns: 1fr;
    }
}
