/* app.css — стили основного приложения (mobile-first, 480px) */

:root {
    --brand: #667eea;
    --brand-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg: #f6f8fc;
    --text: #222;
    --muted: #888;
    --line: #e0e4f0;
    --danger: #e74c3c;
    --warn: #f39c12;
    --ok: #27ae60;
}

body {
    margin: 0;
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    min-height: 100vh;
}

.mobile-app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    padding-bottom: 72px; /* место под bottom-nav */
    box-sizing: border-box;
}

/* ── HEADER */
.m-header {
    background: var(--brand-grad);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
}
.m-header-user { font-size: 15px; font-weight: 600; }
.m-logout {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

/* ── CONTENT */
.m-content { flex: 1; padding: 16px; }
.m-tab { display: block; }

/* ── BALANCE CARD */
.m-balance {
    background: var(--brand-grad);
    color: #fff;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}
.m-balance-label { opacity: .85; font-size: 13px; }
.m-balance-amount { font-size: 32px; font-weight: 700; margin: 6px 0; }
.m-balance-sub { opacity: .85; font-size: 12px; }

/* ── SECTION */
.m-section {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.m-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
}
.m-sub-title {
    font-size: 14px;
    color: var(--muted);
    margin: 22px 0 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.m-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin: 12px 0 6px;
}
.m-input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
    box-sizing: border-box;
    min-height: 48px;
}
.m-input:focus { outline: none; border-color: var(--brand); }

.m-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    margin-top: 10px;
    transition: transform .1s;
}
.m-btn:active { transform: scale(.98); }
.m-btn:disabled { opacity: .5; cursor: not-allowed; }
.m-btn.primary { background: var(--brand-grad); color: #fff; }
.m-btn.secondary { background: #f0f2f8; color: #555; }
.m-btn.warning { background: #fff3cd; color: #8a6100; border: 1px solid #f7d271; }
.m-btn.danger { background: #fde4e1; color: #a01f0f; border: 1px solid #f3a79c; }

.m-error { color: var(--danger); font-size: 13px; margin: 8px 0; min-height: 18px; }

/* ── RESULT */
.m-result {
    margin-top: 14px;
    padding: 18px;
    border-radius: 14px;
    background: #fff;
    text-align: center;
}
.m-result.success { background: #e8f7ee; }
.m-result.failed { background: #fdeceb; }
.m-result-icon { font-size: 40px; }
.m-result-title { font-weight: 700; font-size: 17px; margin: 6px 0 4px; }
.m-result-msg { color: var(--muted); font-size: 14px; }
.m-result-details {
    text-align: left;
    font-family: monospace;
    font-size: 12px;
    background: #f6f8fc;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-all;
    color: #555;
}

/* ── HISTORY */
.m-history { margin-top: 12px; }
.m-history-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.m-hi-left { display: flex; flex-direction: column; }
.m-hi-dest { font-weight: 600; font-size: 14px; }
.m-hi-date { font-size: 11px; color: var(--muted); }
.m-hi-right { text-align: right; }
.m-hi-amount { font-weight: 700; font-size: 15px; color: var(--danger); }
.m-hi-status { font-size: 11px; }
.m-hi-status.success { color: var(--ok); }
.m-hi-status.failed { color: var(--danger); }

.m-empty { text-align: center; color: var(--muted); padding: 30px; }

/* ── CARDS */
.m-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.m-card-item {
    background: var(--brand-grad);
    color: #fff;
    border-radius: 14px;
    padding: 18px;
    position: relative;
}
.m-card-type { font-size: 12px; opacity: .8; }
.m-card-num { font-size: 18px; font-family: monospace; letter-spacing: 2px; margin: 6px 0; }
.m-card-holder { font-size: 13px; }
.m-card-del {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

/* ── PROFILE */
.m-profile {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    font-size: 14px;
    line-height: 1.8;
}
.m-profile strong { color: var(--muted); font-weight: 500; min-width: 100px; display: inline-block; }
.m-link {
    display: block;
    padding: 13px 14px;
    background: #fff;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    margin-top: 6px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── BOTTOM NAV */
.m-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    z-index: 20;
}
.m-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    min-height: 52px;
}
.m-nav-btn span { font-size: 20px; }
.m-nav-btn.active { color: var(--brand); }

/* ── MODAL */
.m-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.m-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}
.m-modal-body {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    width: 100%;
    max-width: 420px;
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.m-modal-body h3 { margin: 0 0 14px; }
.m-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.m-meta {
    display: flex; justify-content: space-between; font-size: 13px; color: var(--muted);
    margin: 8px 0 12px;
}

/* ── SMS-widget (reused from styles.css, just override positioning for mobile) */
#smsWidget {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 72px;
}
