/* ==========================================================================
   AZsms - Styling System
   Theme: Modern Dark Glassmorphic with Indigo/Violet Highlights
   ========================================================================== */

:root {
    --bg-dark: #090d16;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-input: #1a2234;
    --border-color: #2b364e;
    --border-highlight: #3b82f6;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'Consolas', 'Courier New', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #ffffff;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #0d1322;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.2rem 0.9rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.brand-logo i {
    color: var(--primary);
    transform: rotate(-15deg);
}

.brand-logo .highlight {
    color: var(--accent);
}

.brand-logo.large {
    font-size: 2.4rem;
    justify-content: center;
}

.badge-v {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Account Credit Widget */
.account-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.account-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.offline {
    background: var(--danger);
}

.credit-balance {
    margin: 0.4rem 0;
}

.credit-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credit-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}

.credit-value span {
    font-size: 0.9rem;
    color: var(--primary);
}

.credit-subtext {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-link i {
    font-size: 1.1rem;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-dark);
    text-align: center;
}

/* User Profile Widget & Session Switcher */
.user-profile-widget {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem;
    margin-bottom: 1.2rem;
}

.user-profile-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    font-size: 2.2rem;
    color: var(--primary);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
}

.badge-role-admin {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    width: fit-content;
}

.badge-role-client {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    width: fit-content;
}

.user-select-wrapper label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: block;
}

.user-session-select {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: var(--radius-md);
    cursor: pointer;
}

body.is-client .role-admin-only {
    display: none !important;
}

body.is-admin .role-client-only {
    display: none !important;
}

.lmt-tag {
    color: var(--text-muted);
}

/* Main Content Layout */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 260px);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.subtitle {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 0.8rem;
}

/* Grid & Cards */
.grid-2col {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.card-max-600 {
    max-width: 600px;
    margin: 0 auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-header h2 i {
    color: var(--primary);
}

/* Tab Switching */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms & Inputs */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.flex-1 { flex: 1; }
.flex-center { align-items: center; justify-content: flex-start; }

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.9rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-dark);
    margin-top: 0.2rem;
    display: block;
}

/* Switch & Mode Toggle */
.toggle-mode-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #374151;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 20px;
}
.slider.round:before {
    border-radius: 50%;
}

.switch-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

/* Expression Mode Toolbar & Tag Pills */
.expression-toolbar {
    background: rgba(17, 24, 39, 0.7);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
}

.toolbar-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.6rem;

}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.3));
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 16px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tag-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.empty-tags-notice {
    font-size: 0.8rem;
    color: var(--text-dark);
    font-style: italic;
}

/* SMS Textarea & Metrics */
.label-with-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mode-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.sms-textarea {
    resize: vertical;
    line-height: 1.6;
}

.sms-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.badge-flag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 0.9rem;
}

.ucs2-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
    color: #fbbf24;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Smartphone Live Preview Mockup */
.preview-card {
    display: flex;
    flex-direction: column;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.preview-indexer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.phone-mockup {
    background: #030712;
    border: 10px solid #1f2937;
    border-radius: 36px;
    padding: 1.2rem 0.8rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    position: relative;
    max-width: 320px;
    margin: 0 auto 1.5rem auto;
    width: 100%;
}

.phone-speaker {
    width: 60px;
    height: 6px;
    background: #374151;
    border-radius: 10px;
    margin: 0 auto 1rem auto;
}

.phone-screen {
    background: #111827;
    border-radius: 20px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #374151;
}

.sms-header-bar {
    background: #1f2937;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sms-header-bar i {
    font-size: 1.8rem;
    color: var(--primary);
}

.sms-recipient-info {
    display: flex;
    flex-direction: column;
}

.sms-recipient-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.85rem;
}

.sms-recipient-phone {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sms-body-bubble {
    background: linear-gradient(135deg, #3730a3, #4f46e5);
    color: #ffffff;
    padding: 0.8rem 1rem;
    border-radius: 16px 16px 2px 16px;
    margin: 1.5rem 1rem;
    align-self: flex-end;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    word-break: break-word;
    position: relative;
}

.sms-bubble-sender {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #c7d2fe;
    margin-bottom: 0.3rem;
}

.sms-bubble-text {
    font-size: 0.85rem;
    white-space: pre-wrap;
    line-height: 1.4;
}

.sms-bubble-time {
    font-size: 0.65rem;
    color: #a5b4fc;
    text-align: right;
    margin-top: 0.4rem;
}

.recipient-data-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
}

.recipient-data-card h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.json-preview {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--info);
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

/* CSV Dropzone */
.dropzone-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.01);
}

.dropzone-box:hover, .dropzone-box.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.hidden-file-input {
    display: none;
}

.file-spec-hint {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-dark);
}

.file-spec-hint code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.manual-input-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* Data Tables */
.table-container {
    overflow-x: auto;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    padding-left: 36px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr.row-selected {
    background: rgba(99, 102, 241, 0.12) !important;
}

.data-table input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
}

.empty-state {
    padding: 3rem 1rem !important;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

/* Badges & Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: #374151;
    color: #fff;
}
.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.9rem 1.6rem; font-size: 1rem; }
.btn-ghost { background: transparent; color: var(--primary); padding: 0.3rem 0.6rem; border: none; }
.btn-icon { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border-color); width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-info { background: rgba(6, 182, 212, 0.2); color: var(--info); }
.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Modal & Console Logs */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 650px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.progress-bar-wrapper {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.progress-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

.p-stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.6rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
}

.p-val { font-size: 1.2rem; font-weight: 700; color: #fff; }
.p-lbl { font-size: 0.7rem; color: var(--text-muted); }

.logs-console {
    background: #030712;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    height: 180px;
    overflow-y: auto;
    font-family: var(--font-code);
    font-size: 0.78rem;
}

.log-line { margin-bottom: 0.3rem; }
.log-line.info { color: #60a5fa; }
.log-line.success { color: #34d399; }
.log-line.error { color: #f87171; }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 2000;
}

.toast {
    background: #1f2937;
    color: #fff;
    padding: 0.9rem 1.3rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: toastIn 0.3s ease;
    max-width: 380px;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }

/* Login Screen Landing Styling */
.login-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 70%, #030712 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1.5rem;
}

.login-card {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: loginIn 0.4s ease-out;
}

@keyframes loginIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
    text-align: center;
    margin-bottom: 1.8rem;
}

.login-brand h2 {
    font-size: 1.4rem;
    margin-top: 0.8rem;
    font-weight: 700;
}

.login-brand p.subtitle {
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.login-error-alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.login-form .form-group {
    margin-bottom: 1.2rem;
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-lg {
    padding: 0.8rem 1.5rem;
    font-size: 1.05rem;
}

.demo-credentials-box {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-credentials-box h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.demo-acc-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.demo-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    text-align: left;
    color: var(--text-light);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-chip:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.demo-chip code {
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    color: #a5b4fc;
}

/* User Profile Management Modal Styles */
.profile-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.profile-avatar-large {
    font-size: 3rem;
    color: var(--primary);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.profile-stat-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.profile-stat-box .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-stat-box .stat-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.avatar-option {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-height: 48px;
}

.avatar-option:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.avatar-option.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    color: #a5b4fc;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.avatar-upload-option {
    border: 2px dashed rgba(129, 140, 248, 0.6);
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    flex-direction: column;
    gap: 2px;
}

.avatar-upload-option:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #818cf8;
    color: #ffffff;
}

.upload-badge-text {
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1;
}

/* --- Custom Profile Avatar Image Styles --- */
.user-avatar-custom {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: inline-block;
    vertical-align: middle;
}

.profile-avatar-custom-large {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    display: inline-block;
    vertical-align: middle;
}

.avatar-option-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--primary-light);
}

/* Vertical Responsiveness for 13-inch Laptops and Small Displays */
@media (max-height: 850px) {
    .sidebar {
        padding: 0.9rem 0.75rem;
    }
    .brand-header {
        margin-bottom: 0.8rem;
        padding-bottom: 0.5rem;
    }
    .user-profile-widget {
        padding: 0.65rem;
        margin-bottom: 0.75rem;
    }
    .account-widget {
        padding: 0.65rem;
        margin-bottom: 0.75rem;
    }
    .nav-link {
        padding: 0.5rem 0.75rem;
    }
    .sidebar-footer {
        padding-top: 0.6rem;
    }
}

/* Theme Selection Cards & Light Mode Styles */
.theme-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.theme-card {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    color: var(--text-main);
}

.theme-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.theme-card.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.theme-preview {
    height: 95px;
    border-radius: var(--radius-md);
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.theme-preview-dark {
    background: #090d16;
}

.theme-preview-dark .tp-sidebar {
    width: 32%;
    background: #0d1322;
    border-right: 1px solid #2b364e;
}

.theme-preview-dark .tp-content {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-preview-dark .tp-bar {
    height: 12px;
    background: #111827;
    border-radius: 3px;
}

.theme-preview-dark .tp-box {
    flex: 1;
    background: #1f2937;
    border-radius: 4px;
}

.theme-preview-light {
    background: #f1f5f9;
}

.theme-preview-light .tp-sidebar {
    width: 32%;
    background: #ffffff;
    border-right: 1px solid #cbd5e1;
}

.theme-preview-light .tp-content {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-preview-light .tp-bar {
    height: 12px;
    background: #ffffff;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
}

.theme-preview-light .tp-box {
    flex: 1;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
}

.theme-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-title {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Light Theme Variables Overrides */
body.theme-light {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    --border-color: #cbd5e1;
    --border-highlight: #6366f1;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dark: #475569;

    --shadow-card: 0 4px 15px -3px rgba(0, 0, 0, 0.08), 0 2px 6px -2px rgba(0, 0, 0, 0.04);
}

body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light h4,
body.theme-light h5,
body.theme-light h6 {
    color: #0f172a;
}

body.theme-light .sidebar {
    background: #ffffff;
    border-right-color: #cbd5e1;
}

body.theme-light .brand-logo {
    color: #0f172a;
}

body.theme-light .user-name {
    color: #0f172a;
}

body.theme-light .user-profile-widget,
body.theme-light .account-widget {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.theme-light .user-session-select {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

body.theme-light .nav-link {
    color: #475569;
}

body.theme-light .nav-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.theme-light .nav-link.active {
    background: #e0e7ff;
    color: var(--primary);
}

body.theme-light .form-control {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-light .form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
}

body.theme-light .data-table {
    background: #ffffff;
}

body.theme-light .data-table th {
    background: #f8fafc;
    color: #475569;
    border-bottom-color: #cbd5e1;
}

body.theme-light .data-table td {
    border-bottom-color: #f1f5f9;
    color: #0f172a;
}

body.theme-light .data-table tr:hover {
    background: #f8fafc;
}

body.theme-light .card {
    background: #ffffff;
    border-color: #cbd5e1;
}

body.theme-light .modal-content {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-light .top-header {
    border-bottom-color: #cbd5e1;
}

body.theme-light .login-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-light .login-brand h2 {
    color: #0f172a;
}

body.theme-light .login-footer {
    color: #64748b;
}

body.theme-light .sms-bubble-text {
    background: #e2e8f0;
    color: #0f172a;
}

body.theme-light .profile-card-header,
body.theme-light .profile-stat-box {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* --- Pagination Bar Styling --- */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pg-page-size-box {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pg-size-select {
    width: auto !important;
    padding: 0.25rem 0.6rem !important;
    font-size: 0.8rem !important;
    height: auto !important;
}

.pg-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pg-numbers {
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

.pg-num-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-size: 0.8rem;
    line-height: 26px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pg-num-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
}

.pg-num-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: bold;
}

body.theme-light .pagination-container {
    background: #f8fafc;
    border-top-color: #cbd5e1;
}

body.theme-light .pg-num-btn {
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-light .pg-num-btn:hover {
    background: #e2e8f0;
}

body.theme-light .pg-num-btn.active {
    background: var(--primary);
    color: #ffffff;
}

body.theme-light .theme-card {
    background: #ffffff;
    color: #0f172a;
}

/* ==========================================================================
   MOBILE RESPONSIVE & ERGONOMIC SYSTEM (SMARTPHONES & TABLETS)
   ========================================================================== */

/* --- Mobile Header Bar --- */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #0d1322;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 99;
    width: 100%;
}

.mobile-menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #ffffff;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
    background: var(--primary);
}

.mobile-logo {
    font-size: 1.3rem !important;
}

.mobile-header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-credits-chip {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}

/* --- Mobile Sidebar Backdrop Overlay --- */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 998;
    transition: opacity 0.3s ease;
}

/* --- Responsive Table Container & Touch Scroll --- */
.table-container {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

/* --- Media Queries: Tablets & Laptops (<= 992px) --- */
@media (max-width: 992px) {
    .mobile-header {
        display: flex;
    }

    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -290px;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(290px);
    }

    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
        padding: 1.2rem 1rem !important;
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        margin-bottom: 1.2rem;
    }

    .header-title h1 {
        font-size: 1.4rem;
    }

    .header-title .subtitle {
        font-size: 0.85rem;
    }

    .grid-2col {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .metrics-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 0.75rem;
    }
}

/* --- Media Queries: Mobile Smartphones (<= 768px) --- */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    .card {
        padding: 1rem !important;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .card-header h2 {
        font-size: 1.05rem;
    }

    .form-row {
        flex-direction: column !important;
        gap: 0.75rem;
    }

    .form-control, button, input, select, textarea {
        font-size: 0.9rem !important;
    }

    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
        touch-action: manipulation;
    }

    .btn-row {
        flex-direction: column !important;
        width: 100%;
    }

    .btn-row .btn {
        width: 100% !important;
        justify-content: center;
    }

    /* Modal Responsive Touch Optimization */
    .modal-content {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: 10px auto !important;
        padding: 1.2rem 1rem !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
        border-radius: 14px;
    }

    .modal-header h3 {
        font-size: 1.05rem;
    }

    /* Dropzone & Manual Paste Boxes */
    .dropzone-box {
        padding: 1.5rem 1rem !important;
    }

    .dropzone-box h3 {
        font-size: 1rem;
    }

    /* Pagination Mobile Stack */
    .pagination-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.6rem;
        padding: 0.75rem 0.5rem;
    }

    .pagination-controls {
        flex-direction: column;
        width: 100%;
        gap: 0.6rem;
    }

    .pg-page-size-box {
        justify-content: center;
    }

    .pg-buttons {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }

    /* Table Toolbar */
    .table-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .search-box {
        width: 100% !important;
    }

    .search-box input {
        width: 100% !important;
    }

    /* Smartphone Phone Mockup Preview */
    .phone-mockup {
        max-width: 100% !important;
        margin: 0 auto;
    }

    /* Login Screen Card on Small Phones */
    .login-card {
        width: 92vw !important;
        max-width: 440px !important;
        padding: 1.5rem 1.2rem !important;
        border-radius: 16px;
    }

    .login-brand h2 {
        font-size: 1.3rem;
    }
}

/* Light Theme Mobile Header */
body.theme-light .mobile-header {
    background: #ffffff;
    border-bottom-color: #cbd5e1;
}

body.theme-light .mobile-menu-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* --- Ultra-Visible Flag Language Switcher Styling --- */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid rgba(129, 140, 248, 0.7);
    border-radius: 28px;
    padding: 3px 5px;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 14px rgba(99, 102, 241, 0.35);
    transition: all 0.25s ease;
}

.lang-btn {
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 6px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    filter: brightness(0.9);
}

.lang-btn .flag-icon {
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.lang-btn:hover {
    opacity: 1;
    filter: brightness(1.2);
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: #a5b4fc;
    opacity: 1;
    filter: brightness(1.25);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.8);
    transform: scale(1.1);
}

body.theme-light .lang-switcher {
    background: #ffffff;
    border: 2px solid #64748b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.theme-light .lang-btn {
    background: #f1f5f9;
    opacity: 0.65;
}

body.theme-light .lang-btn:hover {
    opacity: 1;
    background: #e2e8f0;
}

body.theme-light .lang-btn.active {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    border-color: #6366f1;
    opacity: 1;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.45);
}

/* --- Audit Logs Styling --- */
.badge-audit-auth {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-audit-credit {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-audit-user {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-audit-api {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-audit-campaign {
    background: rgba(6, 182, 212, 0.18);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.4);
}

.badge-audit-profile {
    background: rgba(236, 72, 153, 0.18);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.4);
}

.badge-audit-system {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.audit-details-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

/* =============================================
   DASHBOARD STYLES
   ============================================= */

/* KPI Cards Row */
.dashboard-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.kpi-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.08;
    border-radius: inherit;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

.kpi-blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.kpi-green  { background: linear-gradient(135deg, #15803d, #22c55e); }
.kpi-purple { background: linear-gradient(135deg, #7e22ce, #a855f7); }
.kpi-amber  { background: linear-gradient(135deg, #b45309, #f59e0b); }
.kpi-cyan   { background: linear-gradient(135deg, #0e7490, #06b6d4); }

.kpi-icon {
    font-size: 2rem;
    opacity: 0.9;
    color: rgba(255,255,255,0.85);
    flex-shrink: 0;
    margin-top: 2px;
}

.kpi-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-trend {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Dashboard Chart Layout */
.dashboard-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-chart-card {
    display: flex;
    flex-direction: column;
}

.dashboard-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    position: relative;
    height: 260px;
    padding: 0.5rem 0.25rem 0.5rem;
    flex: 1;
}

.chart-container-sm {
    height: 210px;
}

/* Chart Custom Legend */
.chart-legend-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0.75rem 0.75rem;
    font-size: 0.78rem;
}

.chart-legend-custom .legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
}

.chart-legend-custom .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Responsive dashboard */
@media (max-width: 1200px) {
    .dashboard-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .dashboard-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-kpi-row {
        grid-template-columns: 1fr 1fr;
    }
    .kpi-value {
        font-size: 1.35rem;
    }
}

/* --- PRICE CALCULATOR & SMS RATE STYLES --- */
.price-rate-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-rate-pill {
    flex: 1;
    min-width: 75px;
    padding: 0.6rem 0.5rem;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background-color: var(--bg-card, #ffffff);
    color: var(--text-color, #334155);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.btn-rate-pill:hover {
    border-color: var(--primary-color, #4f46e5);
    background-color: rgba(79, 70, 229, 0.05);
}

.btn-rate-pill.active {
    border-color: var(--primary-color, #4f46e5);
    background-color: var(--primary-color, #4f46e5);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.calculator-preview-box {
    background: var(--bg-card-alt, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
}

.calc-preview-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color, #4f46e5);
    margin-bottom: 0.75rem;
}

.calc-results-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: #ffffff;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.calc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.calc-result-item.highlight {
    margin-top: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    font-weight: 700;
}

.calc-val-large {
    font-size: 1.2rem;
    font-weight: 800;
}

.badge-sms-rate {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

/* ─── Delivery Status: PENDING badge with pulse animation ──────────── */
.badge-pending {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 3px 9px;
    border-radius: 20px;
    animation: badge-pulse-bg 2s ease-in-out infinite;
}

@keyframes badge-pulse-bg {
    0%, 100% { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
    50%       { background: rgba(245, 158, 11, 0.22); border-color: rgba(245, 158, 11, 0.60); }
}

.pulse-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse-dot-anim 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.6); }
}

/* ─── Enriched Push Detail Modal & Per-Contact SMS Info ──────────── */

.push-detail-summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.1rem;
}

.push-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.push-summary-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.push-summary-value {
    font-size: 0.9rem;
    font-weight: 700;
    word-break: break-all;
}

.push-message-preview {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.1rem;
}

.push-message-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.push-message-body {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 90px;
    overflow-y: auto;
}

.push-sms-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.sms-loading-spinner {
    font-size: 0.8rem;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.msisdn-code {
    color: #818cf8;
    font-weight: 700;
    font-family: var(--font-code);
    font-size: 0.85rem;
}

.btn-eye-sms {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--primary);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.78rem;
}

.btn-eye-sms:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: scale(1.1);
}

.sms-detail-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* SMS Info Popup Styling */
.sms-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.2rem;
}

.sms-info-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sms-info-table tr:last-child {
    border-bottom: none;
}

.sms-info-label {
    padding: 0.55rem 0;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 38%;
}

.sms-info-value {
    padding: 0.55rem 0;
    font-size: 0.88rem;
    color: var(--text-main);
    text-align: right;
}

.sms-info-message-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.sms-info-message-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sms-info-message-content {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-main);
    word-break: break-word;
}

#smsInfoPopup {
    z-index: 10500 !important;
}

#smsInfoPopup .modal-content {
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

