* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', 'Noto Sans Bengali', 'Hind Siliguri', system-ui, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
}
.bn-text {
    font-family: 'Noto Sans Bengali', 'Hind Siliguri', 'Segoe UI', sans-serif;
    line-height: 1.7;
    word-wrap: break-word;
}

/* ── Sidebar ── */
.dashboard-wrapper { display: flex; min-height: 100vh; background: #f1f5f9; }
.sidebar {
    width: 250px;
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}
.sidebar-header {
    padding: 22px 24px;
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 101;
}
.sidebar-header i { color: #6366f1; font-size: 20px; }
.sidebar-menu { flex: 1; display: flex; flex-direction: column; padding: 12px 0; overflow-y: auto; }
.sidebar-item {
    padding: 11px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 14px;
    color: #64748b;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    margin: 1px 0;
    text-decoration: none;
}
.sidebar-item i { width: 20px; text-align: center; font-size: 15px; }
.sidebar-item:hover { background: #1e293b; color: #e2e8f0; }
.sidebar-item.active { background: #1e293b; color: #fff; border-left-color: #6366f1; font-weight: 600; }
.sidebar-item.active i { color: #6366f1; }
.sidebar-footer {
    padding: 18px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: #0b1322;
    font-size: 13px;
}
.sidebar-footer .user-name { font-weight: 600; color: #e2e8f0; margin-bottom: 6px; font-size: 13px; }
.sidebar-footer .user-credits { display: flex; align-items: center; gap: 6px; color: #f59e0b; font-weight: 700; font-size: 14px; }
.sidebar-footer a { color: #ef4444; text-decoration: none; font-weight: 600; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.sidebar-footer a:hover { color: #f87171; }
.sidebar-footer .sidebar-theme-btn {
    background: none; border: none;
    color: var(--sidebar-text, #94a3b8);
    cursor: pointer; font-size: 14px;
    padding: 0; display: flex;
    align-items: center;
    transition: color 0.15s;
}
.sidebar-footer .sidebar-theme-btn:hover { color: #e2e8f0; }

/* ── Main Content ── */
.main-content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1400px;
    min-width: 0;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.page-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.page-header h2 i { color: #6366f1; margin-right: 8px; }
.page-header .header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.page-header .credits-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.stat-card {
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: 0.04;
    transform: translate(20px, -30px);
    background: radial-gradient(circle, currentColor 0%, transparent 70%);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); cursor: default; }
.stat-card:hover .value { color: inherit; }
.stat-card.blue { border-left-color: #6366f1; }
.stat-card.green { border-left-color: #10b981; }
.stat-card.red { border-left-color: #ef4444; }
.stat-card.orange { border-left-color: #f59e0b; }
.stat-card .icon {
    width: 22px; height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-bottom: 4px;
}
.stat-card.blue .icon { background: #eef2ff; color: #6366f1; }
.stat-card.green .icon { background: #d1fae5; color: #10b981; }
.stat-card.red .icon { background: #fce7f3; color: #ef4444; }
.stat-card.orange .icon { background: #fef3c7; color: #f59e0b; }
.stat-card .value { font-size: 18px; font-weight: 800; color: #0f172a; letter-spacing: -0.5px; }
.stat-card .label { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-top: 1px; }

/* ── Cards ── */
.card {
    background: #fff;
    padding: 22px 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: box-shadow 0.15s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.card h2 {
    margin-top: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card h2 i { color: #6366f1; margin-right: 8px; }
.card h3 { font-size: 14px; font-weight: 600; color: #334155; margin-bottom: 10px; }

/* ── Charts ── */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}
@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-container { position: relative; height: 260px; }

/* ── Modem Grid ── */
.modem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.modem-balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; }
.modem-card {
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    position: relative;
}
.modem-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0,0,0,0.15);
    border-color: #cbd5e1;
}
.modem-card.is-online { border-top: 4px solid #10b981; }
.modem-card.is-offline { border-top: 4px solid #ef4444; }
.modem-card.is-stale { border-top: 4px solid #f59e0b; }
.modem-card.is-disabled { border-top: 4px solid #ef4444; opacity: 0.65; }

.modem-card .modem-header-custom {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #f8fafc;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modem-card .modem-badge-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.modem-card .modem-badge-pill.online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.modem-card .modem-badge-pill.stale {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.modem-card .modem-badge-pill.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-green 2.5s infinite;
}
.status-dot.stale { background: #f59e0b; }
.status-dot.offline { background: #ef4444; }

@keyframes pulse-green {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.modem-card .modem-name {
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center;
}
.modem-card .modem-phone {
    font-size: 11px; color: #94a3b8; margin-top: 2px;
}
.modem-card .modem-card-body {
    padding: 12px 16px;
}
.modem-card .modem-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    text-align: center;
}
.modem-card .modem-stat-label {
    font-size: 11px; color: #64748b; margin-bottom: 4px;
}
.modem-card .modem-stat-value {
    font-size: 16px; font-weight: 700;
}
.modem-card .modem-stat-value.blue { color: #6366f1; }
.modem-card .modem-stat-value.green { color: #10b981; }
.modem-card .modem-stat-value.amber { color: #f59e0b; }
.modem-card .modem-stat-value.red { color: #ef4444; }
.modem-card .modem-divider {
    margin-top: 10px; padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.modem-card .modem-meta {
    font-size: 10px; color: #94a3b8;
}
.modem-card .modem-mono {
    font-family: monospace;
}
.modem-card .modem-actions {
    display: flex; gap: 4px;
}
.modem-card .modem-lastseen {
    margin-top: 8px; font-size: 10px;
    color: #94a3b8; text-align: right;
}
.btn-outline-sm {
    font-size: 11px; padding: 4px 8px;
    border-radius: 6px; background: #fff;
    cursor: pointer; border: 1px solid #e2e8f0;
    transition: all 0.15s;
}
.btn-outline-sm:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-outline-sm.warning { border-color: #f59e0b; color: #f59e0b; }
.btn-outline-sm.warning:hover { background: #fffbeb; }
.btn-success-sm {
    display: flex; align-items: center;
    justify-content: center; gap: 6px;
    width: 100%; padding: 6px;
    background: #10b981; color: #fff;
    font-weight: 600; border-radius: 6px;
    cursor: pointer; border: 1px solid transparent;
}
.btn-success-sm:hover { background: #059669; }

.modem-card .modem-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid #f8fafc;
}
.modem-card .modem-row:last-of-type { border-bottom: none; }
.modem-card .modem-label { color: #64748b; font-size: 12px; }
.modem-card .modem-value { font-weight: 600; color: #1e293b; font-size: 13px; }
.modem-card .modem-time { font-size: 11px; color: #94a3b8; margin-top: 8px; text-align: right; }

/* ── Forms ── */
input, select, textarea {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 14px;
    width: 100%;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    color: #1e293b;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
button {
    background: #6366f1;
    color: #fff;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
button:hover { background: #4f46e5; }
button:active { transform: scale(0.97); }
button.secondary { background: #e2e8f0; color: #475569; }
button.secondary:hover { background: #cbd5e1; color: #1e293b; }
button.danger { background: #ef4444; }
button.danger:hover { background: #dc2626; }
button.success { background: #10b981; color: #fff; }
button.success:hover { background: #059669; }
button.warning { background: #f59e0b; }
button.warning:hover { background: #d97706; }
button.success { background: #10b981; }
button.success:hover { background: #059669; }
button.small { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; }
th {
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 12px;
}
tr:hover td { background: #f8fafc; }

/* ── Badges ── */
.badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-failed { background: #fce7f3; color: #9d174d; }
.badge-cancelled { background: #f1f5f9; color: #475569; }
.badge-local { background: #eef2ff; color: #4338ca; }
.badge-semysms { background: #f3e8ff; color: #7e22ce; }
.badge-admin { background: #dbeafe; color: #1e40af; }
.badge-user { background: #f1f5f9; color: #475569; }

.delivery-sent { color: #10b981; font-weight: 600; }
.delivery-delivered { color: #10b981; font-weight: 600; }
.delivery-failed { color: #ef4444; font-weight: 600; }
.delivery-pending { color: #f59e0b; font-weight: 600; }

/* ── Search Bar ── */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-bar input, .search-bar select { margin: 0; flex: 1; min-width: 160px; height: 38px; font-size: 14px; }
.search-bar button { margin: 0; height: 38px; }

/* ── Alerts ── */
.alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; font-size: 14px; display: none; }
.alert.show { display: block; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }

/* ── Operator Override Select ── */
.operator-select {
    font-size: 11px; padding: 3px 6px; margin: 0;
    border-radius: 4px; border: 1px solid #cbd5e1;
    background: #fff; cursor: pointer;
    color: var(--text-main, #334155); font-weight: 600;
}

/* ── Provider Select ── */
.provider-select { display: flex; gap: 10px; }
.provider-select label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    font-weight: 600;
}
.provider-select label:hover { border-color: #6366f1; }
.provider-select input { display: none; }
.provider-select input:checked + label { border-color: #6366f1; background: #eef2ff; color: #6366f1; }
.provider-select input:disabled + label { opacity: 0.4; cursor: not-allowed; }

/* ── Two Column ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

/* ── API Docs ── */
.api-doc { font-size: 14px; }
.api-doc h3 { font-size: 15px; color: #0f172a; margin-top: 28px; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }
.api-doc code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #6366f1; }
.api-doc pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-size: 12px;
    overflow-x: auto;
    margin: 12px 0;
    line-height: 1.6;
}
.api-doc .method { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-right: 5px; text-transform: uppercase; }
.api-doc .method.get { background: #10b981; color: #fff; }
.api-doc .method.post { background: #6366f1; color: #fff; }
.api-doc .url { color: #6366f1; font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 13px; }
.api-doc .note { color: #64748b; font-size: 12px; margin: 6px 0 16px; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.pagination button { min-width: 36px; height: 36px; padding: 0; justify-content: center; }
.pagination button.active { background: #6366f1; color: #fff; }

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 300px;
    font-weight: 600;
    font-size: 14px;
    pointer-events: auto;
}
.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(100%); opacity: 0; } }

/* ── Copy Btn ── */
.copy-btn { background: #f1f5f9; border: none; color: #64748b; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; transition: all 0.15s; }
.copy-btn:hover { background: #6366f1; color: #fff; }

/* ── Loader ── */
.loader { width: 18px; height: 18px; border: 2px solid #e2e8f0; border-top-color: #6366f1; border-radius: 50%; animation: spin 0.8s linear infinite; display: none; }
.loader.active { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tabs (hidden; sidebar replaces) ── */
.tabs { display: none !important; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Chat UI ── */
.chat-container { display: flex; flex-direction: column; gap: 20px; max-width: 920px; margin: 0 auto; }
.chat-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid #e2e8f0; }
.chat-header {
    background: #f8fafc;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.chat-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-weight: 600; color: #0f172a; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.msg-from { font-size: 11px; color: #6366f1; margin: 2px 0 4px; font-weight: 500; }
.chat-count {
    background: #6366f1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 24px; height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-messages {
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 50px;
}
.chat-messages-outbox { background: #f1f5f9; }
.msg-bubble {
    max-width: 85%;
    min-width: 280px;
    padding: 10px 14px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.msg-received {
    align-self: flex-start;
    background: #fff;
    border-radius: 12px 12px 12px 4px;
    border: 1px solid #e2e8f0;
}
.msg-sent {
    align-self: flex-end;
    background: #eef2ff;
    border-radius: 12px 12px 4px 12px;
    border: 1px solid #c7d2fe;
}
.msg-text { font-size: 14px; color: #1e293b; line-height: 1.5; }
.msg-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 6px;
    flex-wrap: wrap;
}
.msg-sent .msg-meta {
    border-top: 1px solid rgba(99, 102, 241, 0.08);
}
.msg-time { font-size: 10.5px; color: #64748b; }
.msg-device { font-size: 10.5px; color: #94a3b8; }
.msg-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.msg-actions { display: flex; gap: 4px; margin-left: 4px; opacity: 0.5; transition: opacity 0.1s; }
.msg-bubble:hover .msg-actions { opacity: 1; }
.msg-actions button { padding: 2px 6px; font-size: 10px; border-radius: 4px; }
.chat-empty { text-align: center; padding: 50px; color: #64748b; font-size: 14px; background: #f8fafc; border-radius: 8px; }

/* ── Utility Classes ── */
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.m-0 { margin: 0; }
.p-8 { padding: 8px; }
.p-10 { padding: 10px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-18 { padding: 18px; }
.p-20 { padding: 20px; }
.text-muted { color: #64748b; }
.text-primary { color: #6366f1; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-9  { font-size: 9px; }
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fs-28 { font-size: 28px; }
.fs-32 { font-size: 32px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-break { word-break: break-all; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.5px; }
.border { border: 1px solid #e2e8f0; }
.border-top { border-top: 1px solid #f1f5f9; }
.border-bottom { border-bottom: 1px solid #f1f5f9; }
.bl-indigo { border-left: 4px solid #6366f1; }
.bl-green { border-left: 4px solid #10b981; }
.bl-amber { border-left: 4px solid #f59e0b; }
.bl-red { border-left: 4px solid #ef4444; }
.bl-cyan { border-left: 4px solid #06b6d4; }
.bl-slate { border-left: 4px solid #64748b; }
.rounded-8 { border-radius: 8px; }
.rounded-10 { border-radius: 10px; }
.rounded-12 { border-radius: 12px; }
.w-full { width: 100%; }
.terminal-bg { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; }
.p-4 { padding: 4px; }
.p-4-8 { padding: 4px 8px; }
.inline-flex { display: inline-flex; gap: 4px; align-items: center; }
.api-key-display {
    font-size: 15px; padding: 10px 12px;
    background: #f8fafc; border-radius: 6px;
    flex: 1; word-break: break-all;
}

/* ── Balance Card (modem balance grid) ── */
.balance-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.balance-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: #cbd5e1; }
.balance-card .dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
    box-shadow: 0 0 0 2px #fff;
}
.balance-card .dot.online { background: #10b981; }
.balance-card .dot.offline { background: #ef4444; }
.balance-card .dot.stale { background: #f59e0b; }
.balance-card .label { color: #64748b; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.balance-card .value { font-weight: 700; }

/* ── Delivery Chip ── */
.delivery-chip {
    padding: 4px 10px; border-radius: 12px; font-size: 12px;
    font-weight: 600; display: inline-block;
    background: #f1f5f9; color: #64748b;
}
.delivery-chip.green { background: #d1fae5; color: #065f46; }
.delivery-chip.red { background: #fce7f3; color: #9d174d; }
.delivery-chip.blue { background: #dbeafe; color: #1e40af; }
.delivery-chip.amber { background: #fef3c7; color: #92400e; }

/* ── Delivery Badge ── */
.delivery-badge { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delivery-badge.green { color: #10b981; }
.delivery-badge.red { color: #ef4444; }
.delivery-badge.cyan { color: #06b6d4; }
.delivery-badge.amber { color: #f59e0b; }

/* ── Sidebar Toggle ── */
.sidebar-toggle {
    display: none;
    background: none; border: none; color: #64748b;
    font-size: 24px; cursor: pointer; padding: 8px;
    z-index: 101;
    position: relative;
}
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive Tables ── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Sub Card (inner card components) ── */
.sub-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}
.sub-card-title {
    font-size: 13px; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}

/* ── Responsive ── */
.flex-gap-8 { display: flex; gap: 8px; }
@media (max-width: 768px) {
    .dashboard-wrapper { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0;
    }
    .sidebar-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .sidebar-toggle { display: block; }
    .sidebar-menu {
        display: none;
        flex-direction: column;
        padding: 8px 0;
        gap: 0;
        width: 100%;
        position: relative;
        z-index: 100;
    }
    .sidebar-menu.open { display: flex; }
    .sidebar-item {
        padding: 10px 24px;
        border-left: 3px solid transparent;
        border-bottom: none;
        font-size: 13px;
        margin: 0;
    }
    .sidebar-item.active { border-left-color: #6366f1; border-bottom: none; }
    .sidebar-footer { display: none; width: 100%; position: relative; z-index: 100; }
    .sidebar-menu.open ~ .sidebar-footer { display: block; }
    .main-content { padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .modem-grid { grid-template-columns: 1fr; }
    .search-bar { flex-direction: column; }
    .search-bar input, .search-bar select { min-width: 100%; }
    .card { padding: 16px; }
    .main-content { padding: 16px 12px; }

    /* Stack tables on mobile */
    .table-responsive table,
    .card table,
    .chat-messages { font-size: 12px; }
    table th, table td { padding: 6px 8px; }
    .two-col { gap: 16px; }

    /* Outbox mobile fixes */
    .chat-container { gap: 12px; }
    .chat-card { border-radius: 10px; }
    .chat-header { padding: 10px 12px; gap: 10px; }
    .chat-avatar { width: 36px; height: 36px; font-size: 13px; }
    .chat-header-name { font-size: 13px; }
    .chat-messages { padding: 10px; gap: 8px; }
    .msg-bubble { max-width: 100%; padding: 10px 12px; border-radius: 10px; }
    .msg-sent { align-self: stretch; }
    .msg-text { font-size: 13px; }
    .msg-meta { gap: 4px; }
    .msg-badge { font-size: 9px; padding: 2px 5px; }
    .msg-actions { opacity: 1; gap: 6px; }
    .msg-actions button { padding: 6px 10px; font-size: 12px; }
    .msg-time { font-size: 10px; }
    .label-from { font-size: 10px; }
    .chat-empty { padding: 30px; font-size: 13px; }
    .pagination { flex-wrap: wrap; gap: 4px; }
}
