/* Explain: App-specific component classes (add as needed). */
/* Buttons */
.btn-mg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    padding: 0.7rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    text-align: center;
    min-height: 44px;
    white-space: nowrap;
}
.btn-mg:active { transform: translateY(1px); }
.btn-mg-primary { background: var(--primary-color); color: #fff; box-shadow: var(--shadow-sm); }
.btn-mg-primary:hover { background: var(--primary-hover); }
.btn-mg-gold { background: var(--accent-color); color: #2a1d00; }
.btn-mg-gold:hover { background: var(--accent-hover); }
.btn-mg-outline { background: transparent; color: var(--text-color); border-color: var(--border-color); }
.btn-mg-outline:hover { border-color: var(--primary-color); color: var(--primary-color); background: var(--primary-soft); }
.btn-mg-ghost { background: transparent; color: var(--text-muted); }
.btn-mg-ghost:hover { background: var(--surface-alt); color: var(--text-color); }
.btn-mg-danger { background: var(--danger-soft); color: var(--danger-color); }
.btn-mg-danger:hover { background: var(--danger-color); color: #fff; }
.btn-mg-block { width: 100%; }
.btn-mg-lg { padding: 0.9rem 1.6rem; font-size: 1rem; }
.btn-mg-sm { padding: 0.5rem 0.85rem; font-size: 0.82rem; min-height: 38px; }
.btn-mg[disabled], .btn-mg.is-loading { opacity: 0.65; pointer-events: none; }

/* Cards */
.card-mg {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.card-mg-pad { padding: 1.5rem; }
.card-mg-hover { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.card-mg-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
}

/* Badges */
.badge-mg {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
}
.badge-success { background: var(--primary-soft); color: var(--primary-color); }
.badge-pending { background: var(--warning-soft); color: var(--warning-color); }
.badge-danger { background: var(--danger-soft); color: var(--danger-color); }
.badge-neutral { background: var(--surface-alt); color: var(--text-muted); }
.badge-info { background: var(--secondary-soft); color: var(--secondary-color); }

/* Forms */
.field-mg { display: flex; flex-direction: column; gap: 0.4rem; }
.label-mg { font-size: 0.82rem; font-weight: 600; color: var(--text-color); }
.input-mg, .select-mg, .textarea-mg {
    width: 100%;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-color);
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    min-height: 44px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input-mg::placeholder, .textarea-mg::placeholder { color: #9aa8a0; }
.input-mg:focus, .select-mg:focus, .textarea-mg:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color) 14%, transparent);
}
.textarea-mg { min-height: 110px; resize: vertical; }
.input-mg[disabled], .select-mg[disabled], .textarea-mg[disabled] {
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: not-allowed;
}
.hint-mg { font-size: 0.76rem; color: var(--text-muted); }

/* Nav */
.nav-mg-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.18s ease, background 0.18s ease;
}
.nav-mg-link:hover { color: var(--primary-color); background: var(--primary-soft); }

/* Header */
.mg-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.mg-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 1.05rem;
    box-shadow: var(--shadow-sm);
    flex: 0 0 auto;
}
.mg-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: #fff;
    color: var(--text-color);
    cursor: pointer;
}
.mg-mobile-menu {
    border-top: 1px solid var(--border-color);
    background: #fff;
    box-shadow: var(--shadow-md);
}
.mobile-mg-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text-color);
}
.mobile-mg-link:hover { background: var(--surface-color); }

/* Stats */
.stat-mg { display: flex; flex-direction: column; gap: 0.3rem; }
.stat-mg-value { font-family: var(--font-heading); font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-mg-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1rem;
    flex: 0 0 auto;
}

/* Table */
.table-mg { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table-mg th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    white-space: nowrap;
}
.table-mg td { padding: 0.85rem 0.9rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.table-mg tbody tr:hover { background: var(--surface-color); }
.table-mg tbody tr:last-child td { border-bottom: none; }

/* Alerts */
.alert-mg {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    border: 1px solid transparent;
}
.alert-info { background: var(--secondary-soft); color: #0b4f4a; }
.alert-success { background: var(--primary-soft); color: var(--primary-hover); }
.alert-warning { background: var(--warning-soft); color: var(--warning-color); }
.alert-danger { background: var(--danger-soft); color: var(--danger-color); }

/* Toast */
#mgToastWrap {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 92vw;
}
.toast-mg {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: #10241a;
    color: #fff;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    animation: mgToastIn 0.25s ease;
}
.toast-mg.toast-success { background: var(--primary-color); }
.toast-mg.toast-error { background: var(--danger-color); }
.toast-mg.toast-info { background: #10241a; }
@keyframes mgToastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.tab-mg {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}
.tab-mg:hover { background: var(--surface-color); color: var(--text-color); }
.tab-mg.is-active { background: var(--primary-soft); color: var(--primary-color); }

/* Action tiles */
.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    min-height: 88px;
}
.action-tile i { font-size: 1.15rem; color: var(--primary-color); }
.action-tile:hover { border-color: var(--primary-color); background: var(--primary-soft); transform: translateY(-2px); }

/* Misc */
.chip-mg {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-alt);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}
.divider-mg { height: 1px; background: var(--border-color); border: 0; margin: 0; }
.link-mg { color: var(--primary-color); font-weight: 600; cursor: pointer; }
.link-mg:hover { text-decoration: underline; }
.amount-in { color: var(--primary-color); font-weight: 700; }
.amount-out { color: var(--danger-color); font-weight: 700; }
.empty-mg { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); font-size: 0.9rem; }
.footer-link { color: var(--text-muted); transition: color 0.18s ease; }
.footer-link:hover { color: var(--primary-color); }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
}