/* ----- RESET & BASE ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f7fc;
    color: #1a2332;
    display: flex;
    min-height: 100vh;
}

/* ----- SIDEBAR ----- */
.sidebar {
    width: 260px;
    background: #0f1a2b;
    color: #c8d6e5;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-brand {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    padding-bottom: 24px;
    border-bottom: 1px solid #1e2d42;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}
.sidebar-brand span { color: #4facfe; }
.sidebar-nav {
    list-style: none;
    flex: 1;
}
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #a0b4c9;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s;
    cursor: pointer;
}
.sidebar-nav a:hover {
    background: #1a2a40;
    color: #fff;
}
.sidebar-nav a.active {
    background: #1e3a5f;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15);
}
.sidebar-nav a .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}
.sidebar-footer {
    border-top: 1px solid #1e2d42;
    padding-top: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: #6a7f9a;
}
#userEmailSidebar {
    color: #c8d6e5;
    font-weight: 500;
    margin-bottom: 8px;
    word-break: break-all;
}
#logoutBtn {
    background: none;
    border: 1px solid #3a4a62;
    color: #c8d6e5;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    transition: 0.2s;
}
#logoutBtn:hover {
    background: #3a4a62;
    color: #fff;
}

/* ----- MAIN CONTENT (for protected pages) ----- */
.main {
    margin-left: 260px;
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
}
.main > * { width: 100%; max-width: 1280px; margin-right: auto; margin-left: auto; }

/* ----- CARDS & GRID ----- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 26, 43, 0.08);
}
.stat-card-balance { border-left: 4px solid #4facfe; }
.stat-card-sent { border-left: 4px solid #1a7d4a; }
.stat-card-remaining { border-left: 4px solid #e0a11a; }
.stat-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex: 0 0 auto;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-card-balance .stat-icon { background: #e8f4ff; color: #1976c9; }
.stat-card-sent .stat-icon { background: #e7f6ed; color: #1a7d4a; }
.stat-card-remaining .stat-icon { background: #fff5d9; color: #a66b00; }
.dashboard-header { margin-bottom: 18px; }
.dashboard-header h1 { margin-bottom: 3px; }
.dashboard-header .sub { min-height: 18px; }
.dashboard-description { max-width: 680px; line-height: 1.5; }
.history-header { margin-bottom: 18px; }
.history-header h1 { margin-bottom: 4px; }
.app-header { display: flex; align-items: center; gap: 14px; min-height: 48px; margin-bottom: 30px; }
.app-wordmark { color: #0f1a2b; font-size: 20px; font-weight: 700; }
.app-wordmark span { color: #4facfe; }
.app-header .hamburger { display: none; }
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.header-campaign { white-space: nowrap; }
.profile-menu { position: relative; }
.profile-pill { display: flex; align-items: center; gap: 9px; padding: 4px 7px 4px 4px; border: 1px solid #e1e8f0; border-radius: 999px; background: #fff; color: #1a2332; cursor: pointer; }
.profile-pill:hover { border-color: #bfd0e2; box-shadow: 0 3px 12px rgba(15, 26, 43, 0.08); }
.profile-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e8f4ff; color: #1976c9; font-size: 12px; font-weight: 700; }
.profile-pill { width: 40px; height: 40px; padding: 3px; justify-content: center; border-color: #cbd5e1; background: #f1f5f9; color: #334155; }
.profile-pill:hover { background: #e2e8f0; }
.profile-avatar { width: 32px; height: 32px; background: transparent; color: #334155; font-weight: 500; }
.profile-email { max-width: 190px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-chevron { color: #7a8fa8; font-size: 17px; }
.profile-email, .profile-chevron { display: none; }
.profile-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 150; display: flex; flex-direction: column; min-width: 210px; padding: 8px; border: 1px solid #e1e8f0; border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(15, 26, 43, 0.14); }
.profile-dropdown[hidden] { display: none; }
.profile-dropdown-email { padding: 8px; overflow: hidden; color: #7a8fa8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown button { padding: 9px 8px; border: 0; border-radius: 7px; background: transparent; color: #c0392b; text-align: left; cursor: pointer; font: inherit; font-size: 13px; }
.profile-dropdown button:hover { background: #fff0f0; }
.dashboard-intro { margin-bottom: 24px; }
.dashboard-intro h1 { margin-bottom: 7px; color: #0f1a2b; font-size: 2rem; font-weight: 600; }
.dashboard-intro .dashboard-description { color: #7a8fa8; font-size: 14px; }
.stat-copy { min-width: 0; }
.stat-card .value { white-space: nowrap; }
.stat-link { display: inline-block; margin-top: 8px; color: #1976c9; font-size: 12px; font-weight: 600; text-decoration: none; }
.stat-link:hover { text-decoration: underline; }
.stat-trend { display: block; margin-top: 8px; color: #1a7d4a; font-size: 12px; font-weight: 600; }
.progress-track { width: 100%; height: 6px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #e7f6ed; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #1a7d4a; transition: width .3s ease; }
.activity-controls { display: flex; align-items: center; gap: 10px; }
.activity-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 8px; background: #f0f4fa; }
.activity-tab { padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: #7a8fa8; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.activity-tab.active { background: #fff; color: #1976c9; box-shadow: 0 1px 4px rgba(15, 26, 43, 0.08); }
.message-preview { display: block; overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-stats { grid-template-columns: 1fr; }
.messages-card table { table-layout: fixed; }
.messages-card table th:nth-child(1), .messages-card table td:nth-child(1) { width: 35%; }
.messages-card table th:nth-child(2), .messages-card table td:nth-child(2) { width: 20%; }
.messages-card table th:nth-child(3), .messages-card table td:nth-child(3) { width: 20%; }
.messages-card table th:nth-child(4), .messages-card table td:nth-child(4) { width: 25%; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 16px; color: #7a8fa8; font-size: 12px; }
.pagination-button { padding: 6px 10px; border: 1px solid #dce3ed; border-radius: 7px; background: #fff; color: #4a5f78; cursor: pointer; font: inherit; }
.pagination-button:hover:not(:disabled) { border-color: #4facfe; color: #1976c9; }
.pagination-button:disabled { cursor: not-allowed; opacity: .45; }
.messages-card { width: 100%; padding: 1rem; border-radius: 0.75rem; border: 1px solid rgba(203, 213, 225, 0.8); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.messages-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}
.messages-toolbar .card-title { margin-bottom: 3px; }
.table-caption { color: #7a8fa8; font-size: 13px; }
.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 18rem;
    padding: 9px 12px;
    border: 1px solid #dce3ed;
    border-radius: 9px;
    color: #7a8fa8;
    background: #fbfcfe;
}
.search-field:focus-within { border-color: #4facfe; box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.12); }
.search-field svg { width: 17px; height: 17px; flex: 0 0 auto; }
.search-field input { border: 0; outline: 0; width: 100%; background: transparent; font: inherit; color: #1a2332; }
.search-field input::placeholder { color: #92a1b3; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.empty-table { text-align: center; color: #7a8fa8; padding: 28px 8px; font-size: 13px; }
.skeleton-row span {
    display: block;
    height: 12px;
    width: 75%;
    border-radius: 4px;
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-row td:nth-child(2) span { width: 90%; }
.skeleton-row td:nth-child(3) span { width: 48px; }
@keyframes skeleton-pulse { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.stat-card .label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #7a8fa8;
}
.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #0f1a2b;
    margin-top: 4px;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #eef2f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #0f1a2b;
}

/* ----- TABLES ----- */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table th {
    text-align: left;
    padding: 11px 12px 11px 0;
    border-bottom: 2px solid #eef2f7;
    color: #4a5f78;
    font-weight: 600;
}
table td {
    padding: 13px 12px 13px 0;
    border-bottom: 1px solid #f0f4fa;
    vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tbody tr { transition: background 0.18s ease; }
table tbody tr:hover { background: #f8fbff; }
table th:nth-child(1), table td:nth-child(1) { width: 20%; }
table th:nth-child(2), table td:nth-child(2) { width: 35%; }
table th:nth-child(3), table td:nth-child(3) { width: 15%; }
table th:nth-child(4), table td:nth-child(4) { width: 15%; }
table th:nth-child(5), table td:nth-child(5) { width: 15%; }
.empty-text { color: #92a1b3; font-style: italic; }
.cost-unit { color: #7a8fa8; font-size: 12px; }

.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #eef2f7;
    color: #4a5f78;
}
.badge.approved { background: #d4edda; color: #155724; }
.badge.pending { background: #fff3cd; color: #856404; }
.badge.rejected { background: #f8d7da; color: #721c24; }
.badge.success { background: #d4edda; color: #155724; }
.badge.failed { background: #f8d7da; color: #721c24; }
.badge.queued { background: #dceeff; color: #1769aa; }
.badge.unknown { background: #eef2f7; color: #4a5f78; }

/* ----- FORMS ----- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1a2a40;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.2s;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #4facfe;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.12);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary { background: #0f1a2b; color: #fff; }
.btn-primary:hover { background: #1a2a40; transform: translateY(-1px); }
.btn-success { background: #1a7d4a; color: #fff; }
.btn-success:hover { background: #14633a; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-outline {
    background: transparent;
    border: 1px solid #dce3ed;
    color: #1a2a40;
}
.btn-outline:hover { background: #f0f4fa; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ----- SEND SMS ----- */
.send-header { margin-bottom: 18px; }
.send-header h1 { margin-bottom: 4px; }
.send-card { max-width: 900px; padding: 24px; border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 26, 43, 0.06); }
.send-card .form-group { margin-bottom: 22px; }
.send-card .form-group:last-of-type { margin-bottom: 20px; }
.field-helper { display: block; color: #7a8fa8; font-size: 13px; margin: -1px 0 10px; }
.recipient-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: #f0f4fa; border-radius: 10px; }
.recipient-tab { flex: 1; border: 0; border-radius: 8px; background: transparent; color: #5a6f88; padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.recipient-tab:hover { color: #0f1a2b; }
.recipient-tab.active { background: #fff; color: #0f1a2b; box-shadow: 0 2px 6px rgba(15, 26, 43, 0.08); }
.recipient-panel.is-hidden { display: none; }
.recipient-summary { display: flex; align-items: center; gap: 8px; margin: 14px 0 9px; color: #4a5f78; font-size: 13px; font-weight: 600; }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: #e8f4ff; color: #1976c9; font-size: 12px; }
.recipient-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 46px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fbfcfe; }
.recipient-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 8px 6px 11px; border-radius: 999px; background: #e8f4ff; color: #1769aa; font-size: 13px; font-weight: 600; }
.recipient-chip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(23, 105, 170, 0.14); color: #1769aa; cursor: pointer; font-size: 16px; line-height: 1; }
.recipient-chip button:hover { background: #1769aa; color: #fff; }
.recipient-empty { align-self: center; color: #92a1b3; font-size: 13px; font-style: italic; }
.field-validation { display: none; color: #c0392b; font-size: 12px; margin-top: 6px; }
.field-validation.is-visible { display: block; }
.send-card input.input-invalid, .send-card textarea.input-invalid { border-color: #c0392b; background: #fff9f9; box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08); }
.template-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.template-label { color: #5a6f88; font-size: 12px; font-weight: 600; }
.template-row select { width: auto; padding: 7px 10px; border: 1px solid #dce3ed; border-radius: 8px; color: #4a5f78; font: inherit; font-size: 12px; }
.message-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; }
.send-submit { min-width: 140px; justify-content: center; padding: 12px 20px; }
.send-icon { width: 18px; height: 18px; }
.send-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; animation: send-spin 0.7s linear infinite; }
.send-submit.is-loading .send-icon { display: none; }
.send-submit.is-loading .send-spinner { display: block; }
@keyframes send-spin { to { transform: rotate(360deg); } }

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7a8fa8;
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

/* ----- MISC ----- */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.gap-8 { gap: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: #7a8fa8; font-size: 13px; }
.text-center { text-align: center; }

.key-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 12px 0;
    font-size: 14px;
    color: #856404;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 20px 16px; }
    .hamburger { display: flex !important; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 22px; }
    .app-header { margin-bottom: 22px; }
    .app-header .hamburger { display: block; }
    .activity-controls { align-items: stretch; flex-direction: column; }
    .activity-controls .search-field { width: 100%; }
    .activity-tabs { width: max-content; }
    .messages-toolbar { flex-direction: column; }
    .search-field { width: 100%; }
}
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: #0f1a2b;
    cursor: pointer;
    padding: 4px 8px;
}
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #c8d6e5;
    font-size: 24px;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 8px;
}
@media (max-width: 768px) { .sidebar-close { display: block; } }

@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .messages-card { padding: 18px 14px; }
    .send-card { padding: 18px 14px; }
    .recipient-tabs { flex-direction: column; }
    .template-row, .message-meta { align-items: stretch; flex-direction: column; }
    .template-row select { width: 100%; }
    .dashboard-intro h1 { font-size: 1.65rem; }
    .header-campaign { padding: 8px 11px; font-size: 12px; }
    .dashboard-stats { grid-template-columns: 1fr; }
}

/* ----- LOGIN PAGE (full page, no sidebar) ----- */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f4f7fc;
    margin: 0;
}
.login-container {
    background: #fff;
    padding: 40px 36px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.login-container h1 {
    font-size: 28px;
    margin-bottom: 6px;
    color: #0f1a2b;
}
.login-container h1 span { color: #4facfe; }
.login-container .sub {
    color: #5a6f88;
    margin-bottom: 24px;
    font-size: 15px;
}
.login-container input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    font-size: 15px;
    transition: 0.2s;
}
.login-container input:focus {
    border-color: #4facfe;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15);
}
.login-container .btn-primary {
    width: 100%;
    padding: 14px;
    background: #0f1a2b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.login-container .btn-primary:hover { background: #1a2a40; }
.login-container .toggle-auth {
    margin-top: 16px;
    font-size: 14px;
    color: #5a6f88;
}
.login-container .toggle-auth a {
    color: #4facfe;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}
.login-container .toggle-auth a:hover { text-decoration: underline; }
.login-error {
    color: #e74c6f;
    font-size: 14px;
    margin-bottom: 12px;
    min-height: 20px;
}

/* ----- API KEYS ----- */
.api-keys-header { margin-bottom: 18px; }
.api-keys-header h1 { margin-bottom: 4px; }
.api-keys-layout { display: grid; grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr); gap: 20px; width: 100%; }
.api-keys-layout .card { padding: 24px; border-radius: 12px; }
.api-generate-card .card-title, .api-list-card .card-title { margin-bottom: 4px; }
.api-generate-card .table-caption, .api-list-card .table-caption { margin-bottom: 20px; }
.api-generate-submit { min-width: 140px; justify-content: center; }
.api-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: api-spin .7s linear infinite; }
.api-generate-submit.is-loading .api-generate-label { display: none; }
.api-generate-submit.is-loading .api-spinner { display: block; }
@keyframes api-spin { to { transform: rotate(360deg); } }
.api-docs { margin-top: 24px; border-top: 1px solid #eef2f7; padding-top: 14px; }
.api-docs summary { color: #1976c9; cursor: pointer; font-size: 13px; font-weight: 600; }
.api-docs pre { overflow-x: auto; padding: 10px; margin: 10px 0 0; border-radius: 7px; background: #f8fafd; color: #4a5f78; font-size: 11px; }
.api-docs code { font-family: Consolas, monospace; }
.api-list-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.docs-link { color: #1976c9; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.docs-link:hover { text-decoration: underline; }
.api-list-card table { table-layout: fixed; }
.api-list-card table th:nth-child(1), .api-list-card table td:nth-child(1) { width: 23%; }
.api-list-card table th:nth-child(2), .api-list-card table td:nth-child(2) { width: 22%; }
.api-list-card table th:nth-child(3), .api-list-card table td:nth-child(3) { width: 16%; }
.api-list-card table th:nth-child(4), .api-list-card table td:nth-child(4) { width: 17%; }
.api-list-card table th:nth-child(5), .api-list-card table td:nth-child(5) { width: 13%; }
.api-list-card table th:nth-child(6), .api-list-card table td:nth-child(6) { width: 9%; }
.masked-api-key { color: #5a6f88; font-size: 12px; }
.api-list-card table tbody tr { transition: background .18s ease; }
.api-list-card table tbody tr:hover { background: #f8fbff; }
.api-action { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #f5c6cb; border-radius: 8px; background: #fff; color: #c0392b; cursor: pointer; }
.api-action:hover { background: #fff0f0; }
.api-loading { padding: 32px 8px; color: #7a8fa8; text-align: center; }
.api-empty { display: flex; align-items: center; flex-direction: column; gap: 7px; padding: 42px 20px; color: #7a8fa8; text-align: center; }
.api-empty strong { color: #1a2332; font-size: 16px; }
.api-empty span { font-size: 13px; }
.api-empty-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 5px; border-radius: 15px; background: #eef6ff; color: #4facfe; font-size: 24px; }
.key-modal { width: min(100%, 520px); padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(15,26,43,.2); }
.raw-api-key { display: block; overflow-wrap: anywhere; padding: 14px; margin: 18px 0; border: 1px solid #e4ebf3; border-radius: 8px; background: #f8fafd; color: #0f1a2b; font-size: 13px; }
.key-modal > .btn { width: 100%; justify-content: center; }

@media (max-width: 780px) {
    .api-keys-layout { grid-template-columns: 1fr; }
    .api-keys-layout .card { padding: 18px 14px; }
    .api-list-header { flex-direction: column; }
    .docs-link { white-space: normal; }
}

/* ----- GROUPS ----- */
.groups-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.groups-header h1 { margin-bottom: 4px; }
.groups-card { width: 100%; padding: 24px; border-radius: 12px; }
.groups-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.groups-toolbar .card-title { margin-bottom: 3px; }
.group-search { display: flex; align-items: center; gap: 8px; width: 240px; padding: 9px 11px; border: 1px solid #dce3ed; border-radius: 9px; color: #7a8fa8; background: #fbfcfe; }
.group-search:focus-within { border-color: #4facfe; box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.12); }
.group-search svg { width: 17px; height: 17px; flex: 0 0 auto; }
.group-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #1a2332; font: inherit; font-size: 13px; }
.groups-card table { table-layout: fixed; }
.groups-card table th, .groups-card table td { padding: 14px 12px 14px 0; }
.groups-card table th:nth-child(1), .groups-card table td:nth-child(1) { width: 38%; }
.groups-card table th:nth-child(2), .groups-card table td:nth-child(2) { width: 20%; }
.groups-card table th:nth-child(3), .groups-card table td:nth-child(3) { width: 20%; }
.groups-card table th:nth-child(4), .groups-card table td:nth-child(4) { width: 22%; }
.group-description { display: block; overflow: hidden; max-width: 95%; margin-top: 3px; color: #92a1b3; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.group-actions { display: flex; gap: 5px; }
.groups-card .icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #dce3ed; border-radius: 8px; background: #fff; color: #5a6f88; cursor: pointer; font-size: 16px; transition: 0.2s; }
.groups-card .icon-button:hover { border-color: #4facfe; background: #e8f4ff; color: #1976c9; }
.groups-card .icon-button.danger:hover { border-color: #c0392b; background: #fff0f0; color: #c0392b; }
.group-empty-state { padding: 44px 24px 48px; text-align: center; }
.group-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: #eef6ff; color: #4facfe; }
.group-empty-icon svg { width: 32px; height: 32px; }
.group-empty-state h2 { color: #0f1a2b; font-size: 20px; margin-bottom: 8px; }
.group-empty-state p { max-width: 440px; margin: 0 auto 20px; color: #7a8fa8; font-size: 14px; line-height: 1.6; }
.modal-backdrop { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(15, 26, 43, 0.48); }
.modal-backdrop[hidden] { display: none; }
.group-modal { width: min(100%, 500px); padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(15, 26, 43, 0.2); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.modal-header h2 { color: #0f1a2b; font-size: 20px; margin-bottom: 4px; }
.modal-header p { color: #7a8fa8; font-size: 13px; }
.modal-close { border: 0; background: transparent; color: #7a8fa8; cursor: pointer; font-size: 26px; line-height: 1; }
.modal-close:hover { color: #0f1a2b; }
.optional-label { color: #92a1b3; font-size: 12px; font-weight: 400; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@media (max-width: 600px) {
    .groups-header, .groups-toolbar { flex-direction: column; }
    .groups-header .btn, .group-search { width: 100%; }
    .groups-card { padding: 18px 14px; }
    .groups-card .table-wrap { overflow-x: auto; }
    .group-actions { flex-wrap: wrap; }
    .group-modal { padding: 20px 16px; }
}

/* ----- ADMIN ----- */
.admin-header { margin-bottom: 18px; }
.admin-header h1 { margin-bottom: 4px; }
.admin-broadcast-card, .admin-requests-card { width: 100%; padding: 24px; border-radius: 12px; }
.admin-broadcast-card .card-title, .admin-requests-card .card-title { margin-bottom: 4px; }
.admin-broadcast-card .table-caption, .admin-requests-card .table-caption { margin-bottom: 18px; }
.admin-message-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: #7a8fa8; font-size: 12px; }
.admin-broadcast-card textarea { min-height: 112px; resize: vertical; }
.admin-broadcast-card .btn-danger { margin-top: 2px; }
.admin-table-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.admin-search { display: flex; align-items: center; gap: 8px; width: min(100%, 260px); padding: 9px 11px; border: 1px solid #dce3ed; border-radius: 9px; color: #7a8fa8; background: #fbfcfe; }
.admin-search:focus-within { border-color: #4facfe; box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.12); }
.admin-search svg { width: 17px; height: 17px; flex: 0 0 auto; }
.admin-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #1a2332; font: inherit; font-size: 13px; }
.admin-filter-tabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; border-bottom: 1px solid #eef2f7; }
.admin-filter { flex: 0 0 auto; padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #7a8fa8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.admin-filter:hover, .admin-filter.active { color: #1976c9; }
.admin-filter.active { border-bottom-color: #4facfe; }
.admin-requests-card table { table-layout: fixed; }
.admin-requests-card table th:nth-child(1), .admin-requests-card table td:nth-child(1) { width: 24%; }
.admin-requests-card table th:nth-child(2), .admin-requests-card table td:nth-child(2) { width: 17%; }
.admin-requests-card table th:nth-child(3), .admin-requests-card table td:nth-child(3) { width: 29%; }
.admin-requests-card table th:nth-child(4), .admin-requests-card table td:nth-child(4) { width: 15%; }
.admin-requests-card table th:nth-child(5), .admin-requests-card table td:nth-child(5) { width: 15%; }
.admin-truncate { display: block; overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.admin-truncate:hover { overflow: visible; position: relative; z-index: 1; width: max-content; max-width: min(420px, 80vw); padding: 3px 6px; border-radius: 5px; background: #fff; box-shadow: 0 4px 14px rgba(15, 26, 43, 0.14); white-space: normal; }
.admin-row-actions { display: flex; gap: 6px; }
.admin-action { display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid #dce3ed; border-radius: 8px; background: #fff; cursor: pointer; font-size: 18px; font-weight: 700; line-height: 1; transition: 0.2s; }
.admin-action.approve { color: #1a7d4a; }
.admin-action.approve:hover { border-color: #1a7d4a; background: #e7f6ed; }
.admin-action.reject { color: #c0392b; }
.admin-action.reject:hover { border-color: #c0392b; background: #fff0f0; }
.admin-empty { padding: 34px 8px; color: #7a8fa8; text-align: center; }
.admin-confirm-modal { width: min(100%, 480px); padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(15, 26, 43, 0.2); }
.admin-confirm-submit { min-width: 145px; justify-content: center; }
.admin-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; animation: admin-spin 0.7s linear infinite; }
.admin-confirm-submit.is-loading .admin-confirm-label { display: none; }
.admin-confirm-submit.is-loading .admin-spinner { display: block; }
@keyframes admin-spin { to { transform: rotate(360deg); } }

@media (max-width: 650px) {
    .admin-broadcast-card, .admin-requests-card { padding: 18px 14px; }
    .admin-broadcast-card .form-row { grid-template-columns: 1fr; }
    .admin-table-toolbar { flex-direction: column; }
    .admin-table-toolbar .admin-search { width: 100%; }
    .admin-message-meta { flex-direction: column; gap: 4px; }
    .admin-broadcast-card .btn-danger { width: 100%; justify-content: center; }
}

/* ----- BUY SMS ----- */
.buy-header { margin-bottom: 18px; }
.buy-header h1 { margin-bottom: 4px; }
.checkout-card { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 20px; max-width: 1000px; margin: 0 auto; align-items: start; }
.checkout-card .card { padding: 24px; border-radius: 12px; }
.payment-details .card-title, .order-summary .card-title { margin-bottom: 4px; }
.checkout-helper { margin-bottom: 20px; color: #7a8fa8; font-size: 13px; }
.payment-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-badge { padding: 7px 10px; border: 1px solid #dce3ed; border-radius: 8px; background: #fbfcfe; color: #4a5f78; font-size: 12px; font-weight: 600; }
.order-summary { position: sticky; top: 24px; }
.price-line, .total-line { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; color: #5a6f88; font-size: 14px; }
.price-line { border-bottom: 1px solid #eef2f7; }
.price-line strong { color: #1a2332; }
.buy-breakdown { padding: 16px 0 12px; color: #1976c9; font-size: 15px; font-weight: 700; }
.total-line { margin-top: 4px; border-top: 2px solid #eef2f7; color: #1a2332; font-weight: 700; }
.total-line strong { color: #1a7d4a; font-size: 22px; }
.minimum-hint { margin-bottom: 18px; color: #7a8fa8; font-size: 12px; line-height: 1.5; }
.minimum-hint.is-warning { color: #a66b00; }
.payment-details input.input-invalid { border-color: #c0392b; background: #fff9f9; box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08); }
.buy-submit { width: 100%; justify-content: center; padding: 12px 20px; }
.buy-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; animation: buy-spin 0.7s linear infinite; }
.buy-submit.is-loading .buy-label { display: none; }
.buy-submit.is-loading .buy-spinner { display: block; }
@keyframes buy-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
    .checkout-card { grid-template-columns: 1fr; }
    .order-summary { position: static; }
    .checkout-card .form-row { grid-template-columns: 1fr; }
}

/* ----- SENDER IDS ----- */
.senderids-header { margin-bottom: 18px; }
.senderids-header h1 { margin-bottom: 4px; }
.sender-request-card, .sender-requests-card { padding: 24px; border-radius: 12px; }
.sender-request-card .card-title { margin-bottom: 4px; }
.sender-request-card .table-caption { margin-bottom: 18px; }
.sender-request-card .form-group { margin-bottom: 18px; }
.sender-request-card .form-group label { font-weight: 600; }
.sender-request-card input.input-invalid { border-color: #c0392b; background: #fff9f9; box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08); }
.sender-submit { min-width: 150px; justify-content: center; }
.sender-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; animation: sender-spin 0.7s linear infinite; }
.sender-submit.is-loading .sender-submit-label { display: none; }
.sender-submit.is-loading .sender-spinner { display: block; }
@keyframes sender-spin { to { transform: rotate(360deg); } }
.sender-requests-card table { table-layout: fixed; }
.sender-requests-card table th:nth-child(1), .sender-requests-card table td:nth-child(1) { width: 22%; }
.sender-requests-card table th:nth-child(2), .sender-requests-card table td:nth-child(2) { width: 18%; }
.sender-requests-card table th:nth-child(3), .sender-requests-card table td:nth-child(3) { width: 36%; }
.sender-requests-card table th:nth-child(4), .sender-requests-card table td:nth-child(4) { width: 24%; }
.sender-requests-card table tbody tr { transition: background 0.18s ease; }
.sender-requests-card table tbody tr:hover { background: #f8fbff; }
.sender-loading { padding: 32px 8px; color: #7a8fa8; text-align: center; }
.table-loader { display: inline-block; width: 15px; height: 15px; margin-right: 8px; vertical-align: -3px; border: 2px solid #dce3ed; border-top-color: #4facfe; border-radius: 50%; animation: sender-spin 0.7s linear infinite; }
.sender-empty { display: flex; align-items: center; flex-direction: column; gap: 7px; padding: 42px 20px; color: #7a8fa8; text-align: center; }
.sender-empty strong { color: #1a2332; font-size: 16px; }
.sender-empty span { font-size: 13px; }
.sender-empty-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 5px; border-radius: 15px; background: #eef6ff; color: #4facfe; font-size: 24px; }
.sender-toast { position: fixed; top: 24px; right: 24px; z-index: 400; max-width: min(360px, calc(100vw - 32px)); padding: 13px 17px; border: 1px solid #b8e0c5; border-radius: 9px; background: #f0fbf3; box-shadow: 0 8px 24px rgba(15, 26, 43, 0.12); color: #155724; font-size: 14px; }
.sender-toast.error { border-color: #f5c6cb; background: #fff5f5; color: #721c24; }

@media (max-width: 600px) {
    .sender-request-card, .sender-requests-card { padding: 18px 14px; }
    .senderids-header { flex-direction: column; }
    .sender-request-card .form-row { grid-template-columns: 1fr; }
    .sender-submit { width: 100%; }
    .sender-toast { top: 16px; right: 16px; left: 16px; max-width: none; }
}

/* ----- CONTACTS ----- */
.contacts-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.contacts-header h1 { margin-bottom: 4px; }
.contacts-actions, .contacts-list-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.contacts-card { padding: 24px; }
.contacts-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.contacts-toolbar .card-title { margin-bottom: 3px; }
.contacts-list-actions { align-items: center; }
.contact-search { display: flex; align-items: center; gap: 8px; width: 220px; padding: 8px 11px; border: 1px solid #dce3ed; border-radius: 9px; color: #7a8fa8; background: #fbfcfe; }
.contact-search:focus-within { border-color: #4facfe; box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.12); }
.contact-search svg { width: 17px; height: 17px; flex: 0 0 auto; }
.contact-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #1a2332; font: inherit; font-size: 13px; }
.batch-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 0; margin-bottom: 4px; border-top: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; }
.select-all { display: inline-flex; align-items: center; gap: 7px; color: #4a5f78; font-size: 13px; font-weight: 600; }
.select-all input, .contact-check { width: 16px; height: 16px; accent-color: #1976c9; }
.selected-count { margin-right: auto; color: #7a8fa8; font-size: 13px; }
.check-column { width: 40px !important; }
.contacts-card table { table-layout: fixed; }
.contacts-card table th:nth-child(2), .contacts-card table td:nth-child(2) { width: 31%; }
.contacts-card table th:nth-child(3), .contacts-card table td:nth-child(3) { width: 31%; }
.contacts-card table th:nth-child(4), .contacts-card table td:nth-child(4) { width: 22%; }
.contact-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.contact-avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: #e8f4ff; color: #1976c9; font-size: 12px; font-weight: 700; }
.contact-actions { display: flex; gap: 6px; }
.contacts-card .icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #dce3ed; border-radius: 8px; background: #fff; color: #5a6f88; cursor: pointer; font-size: 16px; }
.contacts-card .icon-button:hover { border-color: #4facfe; background: #e8f4ff; color: #1976c9; }
.contacts-card .icon-button.danger:hover { border-color: #c0392b; background: #fff0f0; color: #c0392b; }
.contacts-empty { display: flex; align-items: center; flex-direction: column; gap: 7px; padding: 42px 20px; color: #7a8fa8; }
.contacts-empty strong { color: #1a2332; font-size: 16px; }
.contacts-empty span { font-size: 13px; }
.contact-empty-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 5px; border-radius: 15px; background: #eef6ff; font-size: 22px; }
.contact-form-panel { padding: 16px; margin-bottom: 16px; border: 1px solid #e4ebf3; border-radius: 10px; background: #f8fafd; }
.contact-form-panel[hidden] { display: none; }
.import-caption { margin-top: -10px; margin-bottom: 18px; }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dropzone { position: relative; display: flex; align-items: center; flex-direction: column; gap: 7px; min-height: 154px; padding: 24px 16px; border: 1.5px dashed #bfd0e2; border-radius: 12px; background: #fbfcfe; color: #4a5f78; text-align: center; cursor: pointer; transition: 0.2s; }
.dropzone:hover, .dropzone.is-dragging { border-color: #4facfe; background: #eef7ff; }
.dropzone.has-file { border-color: #1a7d4a; background: #f2fbf5; }
.dropzone svg { width: 31px; height: 31px; color: #4facfe; }
.dropzone strong { color: #1a2332; font-size: 14px; }
.dropzone-hint { overflow: hidden; max-width: 100%; color: #7a8fa8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-badge { padding: 3px 7px; border-radius: 5px; background: #e8f4ff; color: #1976c9; font-size: 10px; font-weight: 700; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-buttons { display: flex; gap: 16px; margin-top: 10px; }
.import-buttons .btn { flex: 1; }

@media (max-width: 700px) {
    .contacts-header, .contacts-toolbar { flex-direction: column; }
    .contacts-actions, .contacts-list-actions, .contact-search { width: 100%; }
    .contacts-actions .btn, .contacts-list-actions .btn { flex: 1; }
    .batch-toolbar { align-items: flex-start; }
    .selected-count { margin-right: 0; }
    .import-grid { grid-template-columns: 1fr; }
}

/* ----- GROUPS ----- */
.groups-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.groups-header h1 { margin-bottom: 4px; }
.groups-card { padding: 24px; }
.groups-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.groups-toolbar .card-title { margin-bottom: 3px; }
.groups-filters { display: flex; align-items: center; gap: 10px; }
.group-search { display: flex; align-items: center; gap: 8px; width: 220px; padding: 9px 11px; border: 1px solid #dce3ed; border-radius: 9px; color: #7a8fa8; background: #fbfcfe; }
.group-search:focus-within { border-color: #4facfe; box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.12); }
.group-search svg { width: 17px; height: 17px; flex: 0 0 auto; }
.group-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #1a2332; font: inherit; font-size: 13px; }
.groups-filters select { padding: 9px 30px 9px 10px; border: 1px solid #dce3ed; border-radius: 9px; background: #fff; color: #4a5f78; font: inherit; font-size: 13px; }
.groups-card table { table-layout: fixed; }
.groups-card table th, .groups-card table td { padding: 14px 12px 14px 0; }
.groups-card table th:nth-child(1), .groups-card table td:nth-child(1) { width: 38%; }
.groups-card table th:nth-child(2), .groups-card table td:nth-child(2) { width: 20%; }
.groups-card table th:nth-child(3), .groups-card table td:nth-child(3) { width: 20%; }
.groups-card table th:nth-child(4), .groups-card table td:nth-child(4) { width: 22%; }
.group-description { display: block; overflow: hidden; max-width: 95%; margin-top: 3px; color: #92a1b3; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.group-actions { display: flex; gap: 5px; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #dce3ed; border-radius: 8px; background: #fff; color: #5a6f88; cursor: pointer; transition: 0.2s; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button:hover { border-color: #4facfe; background: #e8f4ff; color: #1976c9; }
.icon-button.danger:hover { border-color: #c0392b; background: #fff0f0; color: #c0392b; }
.group-empty-state { padding: 44px 24px 48px; text-align: center; }
.group-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: #eef6ff; color: #4facfe; }
.group-empty-icon svg { width: 32px; height: 32px; }
.group-empty-state h2 { color: #0f1a2b; font-size: 20px; margin-bottom: 8px; }
.group-empty-state p { max-width: 440px; margin: 0 auto 20px; color: #7a8fa8; font-size: 14px; line-height: 1.6; }
.modal-backdrop { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(15, 26, 43, 0.48); }
.modal-backdrop[hidden] { display: none; }
.group-modal { width: min(100%, 500px); padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(15, 26, 43, 0.2); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.modal-header h2 { color: #0f1a2b; font-size: 20px; margin-bottom: 4px; }
.modal-header p { color: #7a8fa8; font-size: 13px; }
.modal-close { border: 0; background: transparent; color: #7a8fa8; cursor: pointer; font-size: 26px; line-height: 1; }
.modal-close:hover { color: #0f1a2b; }
.optional-label { color: #92a1b3; font-size: 12px; font-weight: 400; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@media (max-width: 600px) {
    .groups-header, .groups-toolbar { flex-direction: column; }
    .groups-header .btn, .groups-filters, .group-search { width: 100%; }
    .groups-filters { align-items: stretch; flex-direction: column; }
    .groups-filters select { width: 100%; }
    .groups-card { padding: 18px 14px; }
    .groups-card .table-wrap { margin: 0 -2px; }
    .group-actions { flex-wrap: wrap; }
    .group-modal { padding: 20px 16px; }
}

@media (min-width: 769px) {
    .stats-grid, .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .messages-card { padding: 1.5rem; }
}