* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
    --blue: #1565C0;
    --blue-dark: #0D47A1;
    --green: #2E7D32;
    --red: #C62828;
    --bg: #F0F4F8;
    --card: #FFFFFF;
    --text: #1A1A2E;
    --muted: #607080;
    --border: #CBD5E0;
    --input-bg: #F7FAFC;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    min-height: 100vh;
    padding-bottom: 72px;
}

/* ---- Header ---- */
.mob-header {
    background: var(--blue);
    color: #fff;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.mob-header {
    display: flex;
    align-items: center;
}
.mob-header span { font-weight: 300; opacity: .85; flex: 1; }
.mob-logout-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Bottom tab bar ---- */
.mob-tabs {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--border);
    z-index: 10;
}
.mob-tab {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 0 10px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.mob-tab.active { color: var(--blue); font-weight: 600; }
.mob-tab .icon { font-size: 22px; }

/* ---- Content ---- */
.mob-content { display: none; padding: 14px 12px; }
.mob-content.active { display: block; }

/* ---- Card ---- */
.card {
    background: var(--card);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}
.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 14px;
}

/* ---- Form fields ---- */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 5px;
}
.field input, .field select {
    width: 100%;
    padding: 13px 12px;
    font-size: 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    appearance: none;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--blue);
}
.field input.selected { border-color: var(--green); background: #F0FFF4; }

/* ---- Autocomplete ---- */
.ac-wrap { position: relative; }
.ac-drop {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1.5px solid var(--blue);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
}
.ac-drop.hidden { display: none; }
.ac-item {
    padding: 13px 12px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.ac-item:last-child { border-bottom: none; }
.ac-item.active { background: #E3F2FD; }
.ac-msg { padding: 13px 12px; font-size: 14px; color: var(--muted); }

/* ---- Buttons ---- */
.btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active:not(:disabled) { background: var(--blue-dark); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-outline {
    background: none;
    color: var(--blue);
    border: 2px solid var(--blue);
}
.btn + .btn { margin-top: 10px; }

/* ---- Step indicator ---- */
.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}
.step-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
}
.step-dot.done { background: var(--green); }
.step-dot.active { background: var(--blue); }

/* ---- Status badge ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.badge-lib { background: #DBEAFE; color: #1D4ED8; }
.badge-and { background: #FEF3C7; color: #92400E; }
.badge-can { background: #FEE2E2; color: #991B1B; }
.badge-fin { background: #D1FAE5; color: #065F46; }
.badge-oth { background: #F3F4F6; color: #374151; }

/* ---- Result card ---- */
.result-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; font-size: 14px; }
.result-label { color: var(--muted); font-size: 12px; }
.result-val { font-weight: 600; text-align: right; max-width: 60%; }

/* ---- Success / Error message ---- */
.msg {
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
}
.msg-ok  { background: #D1FAE5; color: #065F46; }
.msg-err { background: #FEE2E2; color: #991B1B; }
.msg-info { background: #DBEAFE; color: #1E3A8A; }

/* ---- Spinner ---- */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
