/* ============================
   ZadarmaPhonesServices - Dashboard CSS (Modern SaaS refresh)
   ============================ */

:root {
    /* Beautiful SaaS Brand */
        --primary: #6366F1;
        /* Soft vibrant indigo */
        --primary-dark: #4F46E5;
        --primary-soft: #EEF2FF;
        /* Indigo tint */
        --accent: #10B981;
        /* Vibrant emerald */
        --danger: #EF4444;
        /* Clean rose red */
        --warning: #F59E0B;
        /* Amber */
    
        /* Neutrals */
        --bg: #F8FAFC;
        /* Slate 50 - Very soft blue-gray bg */
        --surface: #FFFFFF;
        --surface-soft: #F1F5F9;
        /* Slate 100 */
        --border: #E2E8F0;
        /* Slate 200 */
    
        /* Text */
        --text: #0F172A;
        /* Slate 900 - Deep slate for text */
        --muted: #64748B;
        /* Slate 500 */
        --muted-2: #94A3B8;
        /* Slate 400 */
    
        /* Structure - Smooth, Premium UI */
        --radius: 16px;
        /* Elegant rounded cards */
        --radius-sm: 8px;
        /* Softer inputs/buttons */
        --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
        --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        background: var(--bg);
        color: var(--text);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.dashboard-shell {
    display: flex;
    height: 100vh;
}

/* Sidebar - Elegant Dark Indigo */
.main-sidebar {
    width: 240px;
    background: #0F172A;
    color: #F8FAFC;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    padding: 0 12px 12px 12px;
    margin-bottom: 8px;
    background: linear-gradient(to right, #818CF8, #C084FC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    text-decoration: none;
    color: #94A3B8;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #F8FAFC;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #818CF8;
    font-weight: 600;
}

/* Main */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

.header {
    background: transparent;
        padding: 24px 32px 0 32px;
        height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.header h1 {
    font-size: 24px;
        font-weight: 700;
        letter-spacing: -0.5px;
        color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
        background: var(--surface);
        padding: 8px 16px;
        border-radius: 999px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
    }
    
    .header-actions .btn-outline {
        border: none;
        box-shadow: none;
        padding: 6px 12px;
        color: var(--text);
        background: transparent;
    }
    
    .header-actions .btn-outline:hover {
        background: #F1F5F9;
        color: var(--danger);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
}

.status-dot.connected {
    background: var(--accent);
}

.status-dot.disconnected {
    background: var(--danger);
}

.page-wrap {
    padding: 16px;
    overflow: auto;
    flex: 1;
}

/* KPI + panels */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
        gap: 4px;
}

.kpi-card span {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.kpi-card strong {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
}

.overview-panels {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
}

.panel h3 {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
}

.attention-list {
    margin-left: 18px;
    color: var(--muted);
    line-height: 1.6;
}

/* Buttons + controls */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
        gap: 6px;
        border-radius: var(--radius-sm);
        padding: 8px 16px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--surface-soft);
    border-color: #D1D5DB;
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    font-size: 12px;
    padding: 5px 9px;
}

.btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-row input,
.toolbar-row select,
.conversation-filters input,
.conversation-filters select,
.form-group input,
.form-group select,
.form-group textarea,
.compose-area textarea,
.panel input,
.panel select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: var(--text);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02) inset;
    width: 100%;
}

.toolbar-row input,
.toolbar-row select,
.conversation-filters input,
.conversation-filters select {
    width: auto;
    flex: 1;
    min-width: 120px;
}

.toolbar-row select,
.conversation-filters select,
.form-group select,
.panel select {
    padding: 8px 32px 8px 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 18px;
}

.toolbar-row input:focus,
.toolbar-row select:focus,
.conversation-filters input:focus,
.conversation-filters select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.compose-area textarea:focus,
.panel input:focus,
.panel select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.toolbar-row input::placeholder,
.form-group input::placeholder,
.compose-area textarea::placeholder,
.panel input::placeholder {
    color: #94A3B8;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 8px;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
        background: var(--surface);
        position: sticky;
        top: 0;
        z-index: 10;
}

.data-table tbody tr:hover {
    background: var(--surface-soft);
}

/* Conversations page */
body[data-page="conversations"] .page-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversation-filters {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.sidebar {
    width: 320px;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}
.conversation-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.conversation-item:hover {
    background: var(--surface-soft);
}

.conversation-item.active {
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
}

.conversation-phone {
    font-weight: 600;
}

.conversation-preview {
    color: var(--muted);
    font-size: 13px;
}

.conversation-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.conversation-time {
    color: var(--muted-2);
    font-size: 11px;
}

.conversation-badge {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    border-radius: 999px;
        padding: 1px 7px;
}

.main-content {
    flex: 1;
    background: #f7faff;
        min-height: 0;
    display: flex;
    flex-direction: column;
}

#chatView {
    min-height: 0;
}
.chat-header {
    background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
}

.chat-header-info h3 {
    font-size: 15px;
}

.chat-header-info span {
    font-size: 12px;
    color: var(--muted);
}

.messages-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 72%;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.45;
}

.message.incoming {
    align-self: flex-start;
    background: #fff;
        border: 1px solid var(--border);
}

.message.outgoing {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
}

.message-meta {
    margin-top: 4px;
    display: flex;
    gap: 6px;
    font-size: 11px;
    opacity: 0.8;
}

.message.outgoing .message-meta {
    justify-content: flex-end;
}

.compose-area {
    background: #fff;
        border-top: 1px solid var(--border);
        padding: 12px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.compose-area textarea {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 120px;
}

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted-2);
    gap: 8px;
}

/* Forms/modals/profile/admin */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 12px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    }
    
    .profile-meta {
        display: grid;
        grid-template-columns: repeat(3, minmax(100px, 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .profile-meta div {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 8px 12px;
        background: var(--surface-soft);
    }
    
    .profile-meta span {
        font-size: 11px;
        color: var(--muted);
        text-transform: uppercase;
    }
    
    .profile-meta strong {
        font-size: 13px;
    }
    
    .form-help {
        font-size: 12px;
        color: var(--muted);
    }
    
    .form-error {
        font-size: 12px;
        color: var(--danger);
    }
    
    .admin-kpi-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
    
    .admin-role-card {
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface-soft);
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .admin-role-header {
        display: flex;
    align-items: center;
    justify-content: space-between;
        gap: 8px;
}

.admin-role-perms {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.admin-audit-json {
    margin-top: 6px;
}

.admin-audit-json summary {
    cursor: pointer;
    font-size: 11px;
    color: var(--primary-dark);
}

.admin-audit-json pre {
    margin-top: 6px;
    background: #0f172a;
    color: #dbeafe;
    border-radius: 8px;
    padding: 8px;
    max-height: 180px;
    overflow: auto;
    font-size: 11px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
        background: rgba(2, 6, 23, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 500px;
    max-width: 90vw;
    background: #fff;
        border-radius: 14px;
        border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 20px;
}

.modal h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

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

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #334155;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

/* ==========================================
   Device Detail Page
   ========================================== */
.device-detail-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dd-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dd-info h2 {
    margin: 0;
    font-size: 20px;
}

.dd-numbers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.num-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    font-family: monospace;
}

.num-pill.primary {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

.dd-actions {
    display: flex;
    gap: 6px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Command Center cards */
.dd-cmd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.dd-cmd-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.dd-cmd-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.dd-cmd-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 2px var(--primary);
}

.dd-cmd-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.dd-cmd-key {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}

.dd-cmd-template {
    display: block;
    font-size: 11px;
    color: var(--text);
    background: var(--bg);
    padding: 4px 6px;
    border-radius: 4px;
    word-break: break-all;
}

/* Variable input rows */
.variable-input-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.variable-input-row label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.variable-input-row input {
    font-size: 13px;
}

/* Variable editor rows (command template editor) */
.variable-editor-row {
    display: grid;
    grid-template-columns: 1fr 90px 1fr 32px;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.variable-editor-row input,
.variable-editor-row select {
    font-size: 12px;
    padding: 4px 6px;
}

/* Execution detail */
.exec-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.exec-detail-grid>div {
    display: flex;
    flex-direction: column;
}

.exec-detail-grid>div>span {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
}

.exec-detail-grid>div>strong {
    font-size: 14px;
}

.exec-detail-section {
    margin-bottom: 12px;
}

.exec-detail-section h4 {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.exec-code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow: auto;
}

/* Status pills */
.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill.status-active,
.status-pill.status-sent,
.status-pill.status-delivered,
.status-pill.status-response_received {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.status-pill.status-paused,
.status-pill.status-queued {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.status-pill.status-offline,
.status-pill.status-timeout,
.status-pill.status-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.status-pill.status-retired,
.status-pill.status-cancelled {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

/* Chat device context */
.chat-device-context {
    font-size: 12px;
    padding: 6px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chat-command-panel {
    padding: 6px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.chat-command-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cmd-quick-btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
}

/* Table row states */
.row-inactive {
    opacity: 0.5;
}

.row-inactive:hover {
    opacity: 0.8;
}

/* Panel header row */
.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.panel-header-row h3 {
    margin: 0;
}

/* Button variants */
.btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}
.admin-permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 8px;
    max-height: 360px;
    overflow: auto;
}

.admin-permission-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: var(--surface-soft);
    display: flex;
    gap: 8px;
    cursor: pointer;
}

.admin-permission-item span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.admin-permission-item small {
    color: var(--muted);
    font-size: 11px;
}

.api-key-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f9;
    }
    
    .api-key-name {
        font-weight: 600;
        }
        
        .api-key-value {
        font-family: 'Consolas', monospace;
            font-size: 12px;
        color: var(--muted);
            margin-top: 2px;
        }
        
        .api-key-status {
            font-size: 11px;
        border-radius: 999px;
            padding: 2px 8px;
            margin-left: 8px;
}

.api-key-status.active {
    background: #dcfce7;
    color: #166534;
}

.api-key-status.revoked {
    background: #fee2e2;
        color: #991b1b;
    }
    
    .tabs {
        display: flex;
        border-bottom: 1px solid var(--border);
        margin-bottom: 12px;
    }
    
    .tab {
        padding: 8px 14px;
        color: var(--muted);
        border-bottom: 2px solid transparent;
        cursor: pointer;
    }
    
    .tab.active {
        color: var(--primary-dark);
        border-bottom-color: var(--primary);
    }
    
    /* Auth page */
    .auth-body {
        overflow: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 24px;
        background: var(--bg);
    }
    
    .auth-card {
        width: 100%;
        max-width: 420px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow-lg);
        padding: 24px;
    }
    
    .auth-card h1 {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .auth-subtitle {
        color: var(--muted);
        margin-bottom: 16px;
    }
    
    .auth-form {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .auth-submit {
        width: 100%;
        margin-top: 6px;
    }
    
    .auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
        color: #b91c1c;
        padding: 8px;
        border-radius: 8px;
        font-size: 13px;
    }
    
    .auth-hint {
        margin-top: 12px;
        font-size: 12px;
        color: var(--muted);
    }
    
    .auth-hint code {
        background: #f1f5f9;
        border-radius: 4px;
        padding: 1px 5px;
}

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

.toast {
    color: #fff;
    border-radius: 10px;
    padding: 11px 14px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: slideIn .25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-msg {
    flex: 1;
}

.toast-action {
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.toast-action:hover {
    background: rgba(255,255,255,0.35);
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast.info {
    background: #2563eb;
}

@keyframes slideIn {
    from {
            transform: translateX(100%);
                opacity: 0;
            }
    
                                                                                                                                                                                                                                                                to {
                                                                                                                                                                                                                                                                    transform: translateX(0);
                                                                                                                                                                                                                                                                    opacity: 1;
                                                                                                                                                                                                                                                                }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 7px;
        height: 7px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #c7d5ea;
        border-radius: 999px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #adc3e2;
    }
    
    /* Status pills */
    .status-sent {
        background: #dbeafe;
        color: #1d4ed8;
    }
    
    .status-delivered {
        background: #dcfce7;
        color: #166534;
    }
    
    .status-failed {
        background: #fee2e2;
        color: #991b1b;
    }
    
    .status-pending {
        background: #fef3c7;
        color: #92400e;
}

.status-received {
    background: #e0f2fe;
    color: #0c4a6e;
}

/* ==============================
   Skeleton / Loading States
   ============================== */

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

/* Generic skeleton block (apply to any element) */
.skeleton {
    background: linear-gradient(90deg, var(--surface-soft) 25%, #e2e8f0 50%, var(--surface-soft) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
    color: transparent !important;
}

@keyframes skeleton-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

.skeleton * { visibility: hidden; }

/* Inputs inside a loading modal pulse twice on open */
.modal-loading .form-group input,
.modal-loading .form-group select,
.modal-loading .form-group textarea {
    animation: skeleton-pulse 0.8s ease-in-out 2;
    pointer-events: none;
    user-select: none;
}

/* Button loading spinner */
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.55s linear infinite;
}

.btn-outline.btn-loading::after {
    border-color: rgba(99, 102, 241, 0.25);
    border-top-color: var(--primary);
}

/* Responsive */
@media (max-width: 1200px) {

    .kpi-grid,
    .admin-kpi-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 960px) {
    .main-sidebar {
        width: 190px;
    }

                                                                                                                                .overview-panels,
                                                                                                                                .profile-grid,
                                                                                                                                .kpi-grid,
                                                                                                                                .admin-kpi-grid {
                                                                                                                                    grid-template-columns: 1fr;
                                                                                                                                }
                                                                                                                                }