/* AINet Reseller — Premium Mobile */

:root {
    --primary: #0092e7;
    --primary-dark: #0068b8;
    --primary-deep: #044a86;
    --primary-light: #3bb4f0;
    --primary-soft: #e8f6fd;
    --primary-softer: #f3faff;
    --success: #0ea472;
    --success-soft: #e6f8f1;
    --warning: #d97706;
    --warning-soft: #fff7e8;
    --danger: #e11d48;
    --danger-soft: #ffe8ee;
    --info: #0891b2;
    --info-soft: #e6f7fb;
    --dark: #0f2740;
    --text: #16324d;
    --muted: #6b7c8d;
    --border: #d7e5f0;
    --surface: #ffffff;
    --bg: #eef4f9;
    --bottom-nav-h: 72px;
    --header-h: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 39, 64, .04), 0 6px 16px rgba(15, 39, 64, .05);
    --shadow-md: 0 4px 10px rgba(15, 39, 64, .05), 0 16px 36px rgba(15, 39, 64, .08);
    --shadow-primary: 0 10px 28px rgba(0, 104, 184, .28), 0 2px 8px rgba(0, 104, 184, .12);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
    height: 100%;
    height: 100dvh;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.app-logo {
    display: block;
    width: min(280px, 82%);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    background: transparent;
    border: 0;
    box-shadow: none;
    outline: none;
}

/* ==================== LOGIN ==================== */

#loginScreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    overflow: auto;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(59, 180, 240, .45), transparent 55%),
        radial-gradient(900px 500px at 110% 110%, rgba(4, 74, 134, .55), transparent 50%),
        linear-gradient(160deg, var(--primary-deep) 0%, var(--primary-dark) 42%, var(--primary) 100%);
}

#loginScreen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 80%);
    pointer-events: none;
}

.login-card {
    position: relative;
    background: rgba(255, 255, 255, .96);
    border-radius: 24px;
    padding: 32px 24px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 1px 0 rgba(255,255,255,.7) inset,
        0 24px 60px rgba(4, 74, 134, .28);
    border: 1px solid rgba(255, 255, 255, .7);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 18px;
}

.login-brand {
    font-size: 1.05rem;
    text-align: center;
    margin: 0 0 22px;
    color: var(--dark);
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.3;
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: .9rem;
    pointer-events: none;
}

.input-icon input {
    padding-left: 40px !important;
    padding-right: 42px;
}

.input-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
}

.input-toggle:active { background: var(--primary-softer); }

.login-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffe8ee;
    border: 1px solid #f9c2d0;
    color: #be123c;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.4;
}

.login-error:not(.hidden)::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
}

#loginScreen .form-group.is-invalid input {
    border-color: #e11d48;
    background: #fff7f8;
}

.login-submit {
    padding: 14px !important;
    margin-top: 10px;
    border-radius: 14px !important;
    font-size: .98rem !important;
    letter-spacing: .01em;
    box-shadow: var(--shadow-primary);
}

.login-foot {
    margin-top: 18px;
    text-align: center;
    font-size: .72rem;
    color: var(--muted);
    font-weight: 500;
}

.login-copyright {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #e8f0f6;
    text-align: center;
    font-size: .64rem;
    color: #8a9aab;
    font-weight: 600;
    letter-spacing: .03em;
    line-height: 1.45;
}

/* ==================== FORMS ==================== */

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

.form-group label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #3d5368;
    letter-spacing: .01em;
}

.form-group label .req { color: var(--danger); }

.form-group input:not([type="file"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: .92rem;
    font-family: inherit;
    outline: none;
    background: #f8fbfe;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.form-group textarea { resize: vertical; min-height: 72px; }

.form-group input:not([type="file"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 146, 231, .12);
}

.form-group .hint {
    display: block;
    font-size: .74rem;
    color: var(--muted);
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input { flex: 1; }

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: .9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s, box-shadow .18s, background .18s, opacity .18s;
    text-decoration: none;
}

.btn:active { transform: scale(.97); }
.btn-primary {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 55%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.btn-success {
    background: linear-gradient(180deg, #1ec58a, var(--success));
    color: #fff;
    box-shadow: 0 8px 20px rgba(14, 164, 114, .28);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline {
    background: #fff;
    border: 1px solid var(--border);
    color: #3d5368;
}
.btn-sm { padding: 9px 11px; font-size: .8rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
    flex-shrink: 0;
}

.header-btn {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,.28) !important;
    color: #fff !important;
    background: rgba(255,255,255,.18) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(255,255,255,.28) inset;
    border-radius: 12px !important;
}
.header-btn i { color: #fff !important; }
.header-btn:active { background: rgba(255,255,255,.24) !important; }

/* ==================== APP SHELL ==================== */

#appShell {
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
}

.app-header {
    position: relative;
    height: calc(var(--header-h) + var(--safe-top));
    padding: var(--safe-top) 12px 0;
    background:
        linear-gradient(135deg, var(--primary-deep) 0%, var(--primary-dark) 48%, var(--primary) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 100;
    box-shadow:
        0 1px 0 rgba(255,255,255,.16) inset,
        0 10px 24px rgba(4, 74, 134, .22);
    overflow: hidden;
}

.app-header::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    right: -40px;
    top: -70px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    pointer-events: none;
}

.app-header > * { position: relative; z-index: 1; }

.app-header h1 {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.app-header h1 i {
    font-size: .86em;
    margin-right: 4px;
    opacity: .9;
}

.app-header .user-name {
    font-size: .7rem;
    opacity: .86;
    font-weight: 500;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px calc(var(--bottom-nav-h) + var(--safe-bottom) + 18px);
    background:
        radial-gradient(900px 280px at 50% -80px, rgba(0, 146, 231, .08), transparent 70%),
        var(--bg);
}

.tab-panel { display: none; animation: fadeUp .28s ease; }
.tab-panel.active { display: block; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ==================== STATS ==================== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 8px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(215, 229, 240, .9);
    min-width: 0;
}

.stat-card i {
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .92rem;
}

.stat-card .value {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.stat-card .label {
    font-size: .66rem;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stat-card.success i { background: var(--success-soft); color: var(--success); }
.stat-card.success .value { color: var(--success); }
.stat-card.danger i { background: var(--danger-soft); color: var(--danger); }
.stat-card.danger .value { color: var(--danger); }

.finance-stats {
    grid-template-columns: 1fr;
    gap: 10px;
}

.finance-stats .stat-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    text-align: left;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.finance-stats .stat-card .stat-icon {
    width: 68px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.finance-stats .stat-card .stat-icon i {
    margin: 0;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    font-size: 1.55rem;
    color: #fff;
}

.finance-stats .stat-card.profit .stat-icon { background: #28a745; }
.finance-stats .stat-card.fee .stat-icon { background: #f39c12; }
.finance-stats .stat-card.total .stat-icon { background: #d2d6de; }
.finance-stats .stat-card.total .stat-icon i { color: #4b5563; }

.finance-stats .stat-card .stat-copy {
    min-width: 0;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.finance-stats .stat-card .label {
    margin: 0 0 2px;
    color: #6c757d;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.finance-stats .stat-card .value {
    color: #212529;
    font-size: 1.22rem;
    font-weight: 700;
}

.month-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-template-columns: auto 1fr;
}

.month-bar > i {
    color: var(--primary);
    width: 18px;
    text-align: center;
}

/* ==================== SEARCH & FILTER ==================== */

.search-wrap {
    position: relative;
    margin-bottom: 10px;
}

.search-wrap > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: .9rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: .9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s, box-shadow .18s;
}

.search-wrap .search-input { margin: 0; }

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 146, 231, .12);
}

.filter-bar {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(215, 229, 240, .9);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.filter-bar.single {
    grid-template-columns: 1fr;
}

.filter-bar select,
.filter-bar input[type="month"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .84rem;
    font-family: inherit;
    background: #f8fbfe;
    color: var(--text);
    outline: none;
}

.filter-bar select:focus,
.filter-bar input[type="month"]:focus {
    border-color: var(--primary);
    background: #fff;
}

.filter-bar select + select { margin-top: 0; }

.filter-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .76rem;
    color: var(--muted);
    margin: 0 0 12px;
    padding: 9px 12px;
    background: var(--primary-softer);
    border: 1px solid rgba(0, 146, 231, .12);
    border-radius: 12px;
    font-weight: 500;
}

.filter-hint i { color: var(--primary); }

/* ==================== PAGINATION ==================== */

.pager {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid rgba(215, 229, 240, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.pager.is-empty { display: none; }

.pager-info {
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    letter-spacing: .01em;
}

.pager-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pager-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pager-btn:disabled {
    opacity: .38;
    cursor: default;
}

.pager-btn.is-current {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-dark));
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.pager-ellipsis {
    min-width: 18px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

#customerPager {
    margin: 4px 0 0;
}

#customerList.is-loading {
    opacity: .45;
    pointer-events: none;
}

/* ==================== LIST CARDS ==================== */

.item-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(215, 229, 240, .85);
    border-left: 4px solid var(--primary);
    cursor: pointer;
    transition: transform .14s, box-shadow .18s;
}

.item-card:active {
    transform: scale(.985);
    box-shadow: var(--shadow-md);
}

.item-card.inactive { border-left-color: var(--danger); }
.item-card.status-online { border-left-color: var(--success); }
.item-card.status-offline { border-left-color: #94a3b8; }
.item-card.status-isolir {
    border-left-width: 6px;
    border-left-color: var(--danger);
    border-color: rgba(225, 29, 72, .28);
    background:
        linear-gradient(180deg, rgba(225, 29, 72, .08), rgba(255, 232, 238, .45) 28%, var(--surface) 72%);
    box-shadow: 0 1px 2px rgba(225, 29, 72, .06), 0 10px 22px rgba(225, 29, 72, .08);
}

.item-card.status-offline .card-avatar {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: 0 6px 14px rgba(100, 116, 139, .22);
}
.item-card.status-isolir .card-avatar {
    position: relative;
    background: linear-gradient(135deg, #fb7185, #be123c);
    box-shadow: 0 6px 14px rgba(190, 18, 60, .28);
}
.item-card.status-isolir .card-title { color: #9f1239; }

.isolir-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: -14px -14px 10px;
    padding: 7px 12px;
    background: linear-gradient(90deg, #e11d48, #be123c);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-radius: var(--radius) var(--radius) 0 0;
}

.isolir-mark {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    color: #be123c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .5rem;
    box-shadow: 0 1px 4px rgba(15, 39, 64, .2);
    border: 1px solid #fecdd3;
}

.item-card .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 6px 14px rgba(0, 104, 184, .25);
}

.item-card.inactive .card-avatar {
    background: linear-gradient(135deg, #fb7185, var(--danger));
    box-shadow: 0 6px 14px rgba(225, 29, 72, .22);
}

.card-identity { flex: 1; min-width: 0; }

.item-card .card-title {
    font-weight: 800;
    font-size: .94rem;
    letter-spacing: -.015em;
    line-height: 1.25;
}

.item-card .card-code {
    font-size: .74rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin-top: 2px;
}

.item-card .card-activity {
    font-size: .7rem;
    color: var(--muted);
    font-weight: 600;
    margin-top: 3px;
}

.item-card .card-activity i {
    margin-right: 4px;
    font-size: .65rem;
    color: var(--primary);
}

.card-chevron {
    color: #b7c6d4;
    font-size: .75rem;
    margin-top: 6px;
    flex-shrink: 0;
}

.item-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-left: 52px;
}

.card-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
    padding-left: 52px;
}

.card-fact {
    min-width: 0;
    background: #f5f9fc;
    border: 1px solid #e4eef5;
    border-radius: 10px;
    padding: 8px 10px;
}

.card-fact-label {
    display: block;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
}

.card-fact-value {
    display: block;
    font-size: .78rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    word-break: break-word;
}

.finance-card { cursor: pointer; }
.finance-card:active { transform: scale(.985); }

.finance-card .card-meta { padding-left: 0; }
.finance-card .card-facts { padding-left: 0; }

.finance-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.finance-head {
    min-width: 0;
    flex: 1;
}

.finance-card .card-title {
    font-size: .92rem;
    line-height: 1.3;
}

.finance-sub {
    margin-top: 4px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
}

.finance-sub i {
    margin-right: 4px;
    color: var(--primary);
    font-size: .65rem;
}

.finance-amount {
    font-weight: 800;
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 1px;
}

.finance-amount.positive { color: var(--success); }
.finance-amount.negative { color: var(--danger); }

.item-card.finance-in { border-left-color: var(--success); }
.item-card.finance-out { border-left-color: var(--danger); }

.card-fact-ref .card-fact-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .68rem;
    font-weight: 700;
    word-break: break-all;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.badge-success { background: var(--success-soft); color: #06684a; }
.badge-danger { background: var(--danger-soft); color: #9f1239; }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-warning { background: var(--warning-soft); color: #92400e; }
.badge-isolir {
    background: #ffe8ee;
    color: #9f1239;
    border: 1px solid rgba(225, 29, 72, .22);
    font-weight: 800;
}
.badge-isolir i { font-size: .62rem; }
.badge-info { background: var(--info-soft); color: #155e75; }
.badge-secondary { background: #eef2f6; color: #4b5d6e; }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

.empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-softer);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.empty-icon i { font-size: 1.6rem; opacity: .9; }
.empty-state p { font-weight: 600; font-size: .9rem; }

/* ==================== FORMS / DETAIL ==================== */

.form-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 18px 16px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(215, 229, 240, .9);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 18px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8f0f6;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.section-title:first-child { margin-top: 0; }

.photo-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.photo-upload-grid .form-group {
    position: relative;
}

.photo-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.photo-upload-card {
    display: block;
    position: relative;
    min-height: 148px;
    border: 1.5px dashed var(--border);
    border-radius: 14px;
    background: var(--primary-softer);
    overflow: hidden;
    cursor: pointer;
}

.photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 148px;
    padding: 12px 8px;
    color: var(--muted);
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.35;
}

.photo-upload-placeholder i {
    font-size: 1.35rem;
    color: var(--primary);
}

.photo-upload-img {
    display: block;
    width: 100%;
    height: 148px;
    object-fit: cover;
    background: #d7e5f0;
}

.photo-upload-remove {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: .72rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.photo-upload-hint {
    display: block;
    margin: -4px 0 14px;
    font-size: .74rem;
    color: var(--muted);
}

.section-title i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary-soft);
    font-size: .78rem;
}

.detail-profile {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--primary-deep), var(--primary) 70%);
    border-radius: 22px;
    padding: 28px 16px 22px;
    text-align: center;
    margin-bottom: 12px;
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.detail-profile::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    right: -50px;
    top: -60px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
}

.detail-profile .avatar {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    margin: 0 auto 12px;
    background: rgba(255,255,255,.16);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    font-weight: 800;
    border: 2px solid rgba(255,255,255,.35);
    position: relative;
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.detail-profile h2 {
    font-size: 1.15rem;
    margin-bottom: 4px;
    font-weight: 800;
    letter-spacing: -.02em;
    position: relative;
}

.detail-profile .code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: rgba(255,255,255,.82);
    font-size: .82rem;
    position: relative;
}

.detail-profile .badge { margin-top: 10px; }

.detail-profile.is-isolir {
    background: linear-gradient(160deg, #9f1239, #e11d48 70%);
    box-shadow: 0 10px 28px rgba(225, 29, 72, .28), 0 2px 8px rgba(225, 29, 72, .12);
}

.detail-profile .avatar { position: relative; }
.detail-profile .isolir-mark {
    width: 22px;
    height: 22px;
    font-size: .7rem;
    right: -2px;
    bottom: -2px;
}

.detail-section {
    background: var(--surface);
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(215, 229, 240, .9);
}

.detail-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.detail-section h3 i { color: var(--primary); }

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    font-size: .85rem;
    border-bottom: 1px solid #f0f5f9;
    gap: 12px;
}

.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--muted); font-weight: 600; }
.detail-row .value {
    font-weight: 700;
    text-align: right;
    max-width: 62%;
    word-break: break-word;
}
.detail-wa-btn { margin-left: 8px; vertical-align: middle; border-radius: 999px !important; }

.detail-photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-photo-item {
    background: #f8fbfe;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.detail-photo-label {
    font-size: .72rem;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    font-weight: 700;
}

.detail-photo-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.detail-photo-empty {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: .8rem;
}

.detail-map-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.detail-map-frame {
    width: 100%;
    height: 240px;
    border: 0;
    display: block;
}

.detail-map-link { margin: 10px; }
.detail-map-empty {
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}

.pppoe-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f5f9;
}

.pppoe-item:last-of-type { border-bottom: none; }

.pppoe-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pppoe-item .username {
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .86rem;
}

.pppoe-item .plan { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.pppoe-item .pppoe-copy { flex: 1; min-width: 0; }

.pppoe-empty {
    color: var(--muted);
    font-size: .85rem;
    padding: 6px 0 4px;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ==================== BOTTOM NAV ==================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding: 8px 10px var(--safe-bottom);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border-top: 1px solid rgba(215, 229, 240, .7);
    display: flex;
    align-items: stretch;
    gap: 4px;
    z-index: 200;
    box-shadow: 0 -12px 32px rgba(15, 39, 64, .08);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: #8a98a8;
    font-size: .64rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .02em;
    cursor: pointer;
    padding: 4px 2px 6px;
    min-width: 0;
    border-radius: 16px;
    transition: color .2s, transform .16s;
}

.nav-tab:active { transform: scale(.96); }

.nav-tab-icon {
    width: 52px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: background .2s, box-shadow .2s, transform .2s;
}

.nav-tab-icon i { font-size: 1.12rem; }

.nav-tab.active { color: var(--primary-dark); }

.nav-tab.active .nav-tab-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 8px 16px rgba(0, 104, 184, .3);
    transform: translateY(-1px);
}

.nav-tab.active .nav-tab-icon i { color: #fff; }

/* ==================== LOADING / ALERTS ==================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(238, 244, 249, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #d7e8f5;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

.loading-overlay span {
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: .04em;
}

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

.swal2-popup {
    font-family: var(--font) !important;
    border-radius: 20px !important;
}

.swal2-title { font-weight: 800 !important; letter-spacing: -.02em; }
.swal2-confirm {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-dark)) !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
}

.finance-detail-popup { padding: 22px 18px 18px !important; }
.finance-detail-popup .swal2-title {
    font-size: 1.05rem !important;
    color: var(--text) !important;
    padding: 0 4px 4px !important;
}
.finance-detail-popup .swal2-html-container {
    margin: 8px 0 0 !important;
    text-align: left !important;
}
.fd-amount {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    margin: 2px 0 14px;
    text-align: center;
}
.fd-amount.positive { color: var(--success); }
.fd-amount.negative { color: var(--danger); }
.fd-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #f8fbfe;
}
.fd-row {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e8f0f6;
    align-items: start;
}
.fd-row:last-child { border-bottom: 0; }
.fd-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 1px;
}
.fd-value {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}
.fd-desc {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f5f9fc;
    border: 1px solid #e4eef5;
    border-radius: 12px;
    font-size: .74rem;
    color: var(--muted);
    line-height: 1.45;
    word-break: break-word;
}
.fd-deny-btn {
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
}

.fd-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary-dark));
    color: #fff;
    font-family: inherit;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-primary);
}

.fd-download-btn:disabled {
    opacity: .7;
    cursor: default;
}

@media (max-width: 360px) {
    .form-row { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .finance-stats { grid-template-columns: 1fr; }
    .item-card .card-meta { padding-left: 0; }
    .card-facts { padding-left: 0; grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr; }
}
