/* =========================================
   Google Haritalar İşletme Aracı - Stil Dosyası
   Premium Dark Theme with Glassmorphism
   ========================================= */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161822;
    --bg-card: rgba(22, 24, 34, 0.8);
    --bg-card-hover: rgba(30, 33, 48, 0.9);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(59, 130, 246, 0.4);
    --text-primary: #e8eaed;
    --text-secondary: #9aa0b0;
    --text-muted: #5f6577;
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ====== SIDEBAR ====== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.logo-version {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    color: var(--accent-blue-light);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* Sidebar Sub Navigation (WhatsApp pages) */
.nav-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px 11px 32px;
    /* Adjusted indentation */
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    /* Matched font size */
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 4px;
    opacity: 0.95;
}

/* Prevent browser visited-link purple/underline on sidebar subitems */
.sidebar-nav a.nav-subitem:link,
.sidebar-nav a.nav-subitem:visited {
    color: var(--text-secondary);
    text-decoration: none;
}

.sidebar-nav a.nav-subitem.active:link,
.sidebar-nav a.nav-subitem.active:visited {
    color: #25D366;
}

.nav-subitem:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-subitem.active {
    background: rgba(37, 211, 102, 0.12);
    color: #25D366;
    box-shadow: inset 0 0 0 1px rgba(37, 211, 102, 0.18);
}

.nav-subitem i {
    width: 20px;
    /* Matched icon width */
    text-align: center;
    font-size: 14px;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 8px;
}

/* ... existing code ... */

/* Dashboard */
.wa-dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 1200px) {
    .wa-dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .wa-dash-grid {
        grid-template-columns: 1fr;
    }
}

/* ... existing code ... */

/* Send Grid */
.wa-send-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .wa-send-grid {
        grid-template-columns: 1fr;
    }

    .wa-right-panel {
        order: -1;
        /* Show preview on top on mobile, or remove this line if not desired */
    }
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

/* ====== MAIN CONTENT ====== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ====== TOPBAR ====== */
.topbar {
    height: var(--topbar-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 17, 23, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.btn-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--accent-blue);
    font-size: 16px;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-count-badge {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ====== PAGES ====== */
.page {
    display: none;
    padding: 24px;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== CARDS ====== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header .header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--accent-blue);
    font-size: 14px;
}

.card-body {
    padding: 24px;
}

/* ====== FORMS ====== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group label i {
    margin-right: 4px;
    color: var(--accent-blue);
    font-size: 11px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239aa0b0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.form-range {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.range-value {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue-light);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    min-width: 48px;
    text-align: center;
}

.data-fields {
    margin-top: 20px;
}

.fields-title {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.fields-title i {
    margin-right: 4px;
    color: var(--accent-blue);
    font-size: 11px;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.field-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.field-check:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.field-check input[type="checkbox"] {
    accent-color: var(--accent-blue);
}

/* ====== BUTTONS ====== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-search {
    margin-top: 24px;
    font-size: 15px;
    padding: 16px;
}

/* ====== SEARCH PAGE GRID ====== */
.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    height: calc(100vh - var(--topbar-height) - 48px);
}

.search-form-card {
    overflow-y: auto;
}

.preview-card .card-body {
    height: calc(100% - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-empty {
    text-align: center;
    padding: 40px;
    max-width: 360px;
}

.preview-icon {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.3;
}

.preview-empty p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 13.5px;
    margin-bottom: 24px;
}

.preview-tips {
    text-align: left;
}

.tip {
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--accent-orange);
    margin-bottom: 8px;
}

.tip i {
    margin-right: 6px;
}

/* Loading */
.loading-animation {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.loading-progress {
    width: 260px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.loading-status {
    font-size: 13px;
    color: var(--text-muted);
}

/* ====== RESULTS TABLE ====== */
.results-header {
    flex-wrap: wrap;
    gap: 12px;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.export-buttons {
    display: flex;
    gap: 6px;
}

.btn-export {
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-export:hover {
    transform: translateY(-1px);
}

.btn-json {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue-light);
}

.btn-json:hover {
    background: rgba(59, 130, 246, 0.25);
}

.btn-csv {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.btn-csv:hover {
    background: rgba(16, 185, 129, 0.25);
}

.btn-excel {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-excel:hover {
    background: rgba(16, 185, 129, 0.35);
}

.btn-pdf {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.btn-pdf:hover {
    background: rgba(239, 68, 68, 0.25);
}

.result-count {
    font-size: 12px;
    background: var(--accent-blue);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    padding: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table th {
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue-light);
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.th-num {
    width: 50px;
    text-align: center;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background: rgba(59, 130, 246, 0.15);
}

.sortable i {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.5;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

.data-table td:first-child {
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
}

.td-name {
    font-weight: 600;
    color: var(--text-primary) !important;
}

.td-phone {
    color: var(--accent-green) !important;
    font-weight: 500;
}

.td-phone a {
    color: var(--accent-green);
    text-decoration: none;
}

.td-phone a:hover {
    text-decoration: underline;
}

.td-website a {
    color: var(--accent-blue-light);
    text-decoration: none;
    font-size: 12px;
}

.td-website a:hover {
    text-decoration: underline;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.star-filled {
    color: var(--accent-orange);
}

.rating-number {
    font-weight: 600;
    color: var(--accent-orange);
}

.rating-count {
    font-size: 11px;
    color: var(--text-muted);
}

.empty-row {
    text-align: center !important;
    padding: 60px 20px !important;
    color: var(--text-muted) !important;
    font-size: 14px !important;
}

.empty-row i {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.pagination button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.pagination button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

/* ====== MAP ====== */
.map-card {
    height: calc(100vh - var(--topbar-height) - 48px);
}

.map-count {
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 8px;
}

/* ====== STATS ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-blue .stat-icon {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
}

.stat-green .stat-icon {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
}

.stat-purple .stat-icon {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
}

.stat-orange .stat-icon {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-height: 280px;
}

/* ====== HISTORY ====== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
}

.history-item:hover {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.03);
}

.history-icon {
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 16px;
    flex-shrink: 0;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-keyword {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
}

.history-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-actions {
    display: flex;
    gap: 6px;
}

.btn-history {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-history-view {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue-light);
}

.btn-history-view:hover {
    background: rgba(59, 130, 246, 0.25);
}

.btn-history-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.btn-history-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.3;
    display: block;
}

.empty-state p {
    font-size: 14px;
}

/* ====== TOAST ====== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease;
    backdrop-filter: blur(20px);
    min-width: 280px;
}

.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast-error {
    border-left: 3px solid var(--accent-red);
}

.toast-info {
    border-left: 3px solid var(--accent-blue);
}

.toast-success i {
    color: var(--accent-green);
}

.toast-error i {
    color: var(--accent-red);
}

.toast-info i {
    color: var(--accent-blue);
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
    .search-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .preview-card {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .btn-menu {
        display: block;
    }

    .topbar {
        padding: 0 16px;
    }

    .page {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .results-actions {
        width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group .form-input {
        flex: 1;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════
   WHATSAPP TOPLU MESAJ MODÜLÜ
   ═══════════════════════════════════════════════════════════ */

/* Sidebar WhatsApp Nav */
.nav-whatsapp i {
    color: #25D366 !important;
}

.nav-whatsapp:hover {
    background: rgba(37, 211, 102, 0.08) !important;
}

.nav-whatsapp.active {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(37, 211, 102, 0.05)) !important;
    color: #25D366 !important;
    box-shadow: inset 0 0 0 1px rgba(37, 211, 102, 0.2) !important;
}

/* WhatsApp Shell */
.wa-shell {
    --wa-accent: #25D366;
    --wa-accent-dark: #075E54;
    font-family: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.wa-shell .btn-primary {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.95), rgba(7, 94, 84, 0.85));
    border-color: rgba(37, 211, 102, 0.28);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.14);
}

.wa-shell .btn-primary:hover {
    filter: brightness(1.05);
}

.wa-shell .btn-secondary:hover {
    border-color: rgba(37, 211, 102, 0.24) !important;
}

/* Hero */
.wa-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(37, 211, 102, 0.14);
    background: linear-gradient(135deg, rgba(7, 94, 84, 0.25), rgba(37, 211, 102, 0.06));
    overflow: hidden;
}

.wa-hero::before {
    content: "";
    position: absolute;
    inset: -120px -60px;
    background:
        radial-gradient(circle at 22% 20%, rgba(37, 211, 102, 0.35), transparent 55%),
        radial-gradient(circle at 78% 80%, rgba(7, 94, 84, 0.32), transparent 58%);
    opacity: 0.8;
    pointer-events: none;
}

.wa-hero-left,
.wa-hero-actions {
    position: relative;
    z-index: 1;
}

.wa-hero-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wa-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.18);
    color: rgba(232, 234, 237, 0.92);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.2px;
}

.wa-hero-badge i {
    color: var(--wa-accent);
}

.wa-hero-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.wa-hero-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
    max-width: 64ch;
}

.wa-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Workspace Layout */
.wa-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.wa-panel {
    min-width: 0;
}

/* Ban Protection Bar */
.wa-protection-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: rgba(37, 211, 102, 0.05);
    border: 1px solid rgba(37, 211, 102, 0.15);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease;
}

.wa-prot-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.wa-prot-item i {
    color: #25D366;
    font-size: 14px;
}

.wa-prot-active {
    color: #25D366;
}

.wa-risk-indicator strong {
    color: #10b981;
}

.wa-risk-indicator.risk-medium strong {
    color: #f59e0b;
}

.wa-risk-indicator.risk-high strong {
    color: #ef4444;
}

/* Side Tabs */
.wa-tabs.wa-tabs-side {
    margin-bottom: 0;
    flex-direction: column;
    position: sticky;
    top: calc(var(--topbar-height) + 18px);
    max-height: calc(100vh - var(--topbar-height) - 44px);
    overflow: auto;
}

.wa-tabs.wa-tabs-side .wa-tab {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 12px 14px;
    font-family: inherit;
}

.wa-tabs.wa-tabs-side .wa-tab i {
    width: 18px;
    text-align: center;
}

/* Tabs */
.wa-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px;
}

.wa-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wa-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.wa-tab.active {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.12), rgba(37, 211, 102, 0.05));
    color: #25D366;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.1);
}

.wa-tab i {
    font-size: 14px;
}

/* Tab Content */
.wa-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wa-tab-content.active {
    display: block;
}

/* Send Grid */
.wa-send-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .wa-send-grid {
        grid-template-columns: 1fr;
    }
}

/* Editor Card */
.wa-editor-card .card-header h2 i {
    color: #25D366 !important;
}

.wa-char-count {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 6px;
}

.wa-char-count span {
    color: #25D366;
    font-weight: 700;
}

/* Template Row */
.wa-template-row {
    display: flex;
    gap: 8px;
}

.wa-template-row select {
    flex: 1;
}

.btn-danger-sm {
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: var(--accent-red) !important;
}

.btn-danger-sm:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

/* Message Toolbar */
.wa-msg-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
}

.wa-msg-toolbar button {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wa-msg-toolbar button:hover {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.3);
}

.wa-toolbar-divider {
    color: var(--border-color);
    line-height: 30px;
    margin: 0 4px;
}

/* Textarea */
.wa-textarea {
    border-radius: 0 0 var(--radius) var(--radius) !important;
    min-height: 160px;
    resize: vertical;
    line-height: 1.6;
}

/* Consent Box */
.wa-consent-box {
    padding: 14px 18px;
    background: rgba(37, 211, 102, 0.04);
    border: 1px solid rgba(37, 211, 102, 0.1);
    border-radius: var(--radius);
}

.wa-consent-box .wa-toggle-label i {
    color: #25D366;
}

.wa-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.wa-toggle-label input[type="checkbox"] {
    accent-color: #25D366;
    width: 16px;
    height: 16px;
}

.wa-toggle-slider {
    display: none;
}

.wa-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* Dashboard */
.wa-dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.wa-kpi-card .card-header {
    justify-content: space-between;
}

.wa-kpi-badge {
    font-size: 11px;
    font-weight: 700;
    color: rgba(232, 234, 237, 0.9);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 999px;
}

.wa-kpi-value {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0.2px;
    color: var(--text-primary);
}

.wa-kpi-value-sm {
    font-size: 14px;
    font-weight: 800;
}

.wa-kpi-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.wa-kpi-bar {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    margin-top: 12px;
}

.wa-kpi-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(37, 211, 102, 0.9), rgba(37, 211, 102, 0.25));
}

.wa-kpi-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.wa-dash-split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
}

.wa-chart-wrap {
    height: 240px;
    position: relative;
}

.wa-dash-note {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.wa-dash-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.wa-mini-item {
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.wa-mini-label {
    font-size: 11px;
    color: var(--text-muted);
}

.wa-mini-value {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
}

.wa-dash-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.wa-dash-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.wa-dash-list-title {
    font-weight: 800;
    font-size: 13px;
    color: var(--text-primary);
}

.wa-dash-campaign {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--transition);
    cursor: pointer;
}

.wa-dash-campaign:hover {
    background: rgba(37, 211, 102, 0.06);
    border-color: rgba(37, 211, 102, 0.18);
}

.wa-dash-campaign-title {
    font-weight: 800;
    font-size: 13px;
    color: var(--text-primary);
}

.wa-dash-campaign-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.wa-dash-empty {
    text-align: center;
    padding: 18px 12px;
    color: var(--text-muted);
}

.wa-dash-empty i {
    font-size: 26px;
    opacity: 0.35;
    display: block;
    margin-bottom: 10px;
}

/* Speed Section */
.wa-speed-section {
    margin-top: 8px;
}

.wa-speed-section>label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.wa-speed-section>label i {
    color: #25D366;
    margin-right: 4px;
}

.wa-speed-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.wa-speed-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.wa-speed-btn small {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.7;
}

.wa-speed-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.wa-speed-btn.active {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.08);
    color: #25D366;
}

.wa-speed-btn[data-speed="turbo"].active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.wa-speed-btn[data-speed="fast"].active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

.wa-speed-detail {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.wa-speed-info {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.wa-speed-info strong {
    color: #25D366;
}

/* Risk Bar */
.wa-risk-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.wa-risk-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #10b981, #25D366, #f59e0b, #ef4444);
    transition: width 0.5s ease;
}

.wa-risk-text {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ---- Phone Mockup Preview ---- */
.wa-phone-mockup {
    background: #0b141a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.wa-phone-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #1f2c34;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.wa-phone-header>i {
    color: #8696a0;
    font-size: 16px;
}

.wa-phone-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.wa-phone-avatar {
    width: 36px;
    height: 36px;
    background: #2a3942;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8696a0;
    font-size: 16px;
}

.wa-phone-name {
    font-size: 14px;
    font-weight: 600;
    color: #e9edef;
}

.wa-phone-status {
    font-size: 11px;
    color: #8696a0;
}

.wa-phone-actions {
    display: flex;
    gap: 16px;
    color: #8696a0;
    font-size: 18px;
}

.wa-phone-body {
    min-height: 200px;
    padding: 16px;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.wa-msg-bubble {
    max-width: 85%;
    align-self: flex-end;
    background: #005c4b;
    border-radius: 10px 10px 2px 10px;
    padding: 8px 12px;
    margin-top: 4px;
    position: relative;
}

.wa-msg-bubble p {
    font-size: 13.5px;
    color: #e9edef;
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.wa-msg-time {
    display: block;
    text-align: right;
    font-size: 10px;
    color: rgba(233, 237, 239, 0.5);
    margin-top: 4px;
}

/* Summary Card */
.wa-summary-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.wa-sum-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
}

.wa-sum-item i {
    color: #25D366;
    font-size: 18px;
}

.wa-sum-item strong {
    color: var(--text-primary);
}

/* Device / Target / Scheduler */
.wa-device-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wa-device-row select {
    flex: 1;
}

.wa-target-toggle {
    display: flex;
    gap: 8px;
    margin: 10px 0 14px 0;
}

.wa-target-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wa-target-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.wa-target-btn.active {
    color: #fff;
    border-color: rgba(37, 211, 102, 0.6);
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.wa-schedule-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wa-schedule-row input {
    flex: 1;
}

/* Groups */
.wa-group-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.wa-group-toolbar input {
    flex: 1;
}

.wa-group-list {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
}

.wa-group-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.wa-group-item:last-child {
    border-bottom: none;
}

.wa-group-name {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.wa-group-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Devices Tab */
.wa-devices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.wa-device-item,
.wa-schedule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
}

.wa-device-title,
.wa-schedule-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13px;
}

.wa-device-meta,
.wa-schedule-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

.wa-device-actions,
.wa-schedule-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.wa-qr-wrap {
    margin-top: 14px;
    border: 1px dashed rgba(37, 211, 102, 0.35);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(37, 211, 102, 0.04);
    text-align: center;
}

.wa-qr-img {
    width: 280px;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #fff;
}

.wa-schedule-error {
    margin-top: 6px;
    color: #ef4444;
    font-size: 12px;
}

@media (max-width: 900px) {
    .wa-devices-grid {
        grid-template-columns: 1fr;
    }

    .wa-group-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .wa-target-toggle {
        flex-direction: column;
    }
}

/* Send Button */
.btn-wa-send {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}

.btn-wa-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
}

.btn-wa-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-wa-send i {
    font-size: 18px;
}

/* Progress Card */
.wa-progress-bar-wrap {
    position: relative;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.wa-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #25D366, #128C7E);
    border-radius: 14px;
    transition: width 0.5s ease;
}

.wa-progress-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.wa-progress-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.wa-prog-stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 12.5px;
    font-weight: 500;
}

.wa-stat-sent {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}

.wa-stat-failed {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.wa-stat-remaining {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

.wa-prog-stat i {
    font-size: 14px;
}

.wa-progress-log {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 11.5px;
}

.wa-log-entry {
    padding: 3px 0;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.wa-log-entry.success {
    color: #10b981;
}

.wa-log-entry.fail {
    color: #ef4444;
}

.wa-log-entry.info {
    color: #3b82f6;
}

.wa-log-entry.warn {
    color: #f59e0b;
}

/* ---- Numbers Tab ---- */
.wa-numbers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.wa-manual-input {
    display: flex;
    gap: 8px;
}

.wa-import-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.wa-import-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.wa-import-divider span {
    background: var(--bg-card);
    padding: 0 14px;
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.wa-upload-area {
    border: 2px dashed rgba(37, 211, 102, 0.25);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.wa-upload-area:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.03);
}

.wa-upload-area i {
    font-size: 36px;
    color: #25D366;
    margin-bottom: 10px;
}

.wa-upload-area p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.wa-upload-area small {
    font-size: 11.5px;
    color: var(--text-muted);
}

.wa-import-btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    border: 1px dashed rgba(59, 130, 246, 0.3) !important;
    color: var(--accent-blue-light) !important;
}

.wa-import-btn:hover {
    background: rgba(59, 130, 246, 0.06) !important;
    border-color: var(--accent-blue) !important;
}

.wa-import-count {
    background: var(--accent-blue);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
}

/* Number List */
.wa-num-badge {
    background: #25D366;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.wa-list-actions {
    display: flex;
    gap: 6px;
}

.wa-number-list {
    max-height: 500px;
    overflow-y: auto;
}

.wa-number-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}

.wa-number-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.wa-number-item input[type="checkbox"] {
    accent-color: #25D366;
    flex-shrink: 0;
}

.wa-number-item .wa-num-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.wa-number-item .wa-num-phone {
    font-size: 13px;
    color: #25D366;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.wa-number-item .wa-num-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition);
}

.wa-number-item .wa-num-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.wa-empty-list {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.wa-empty-list i {
    font-size: 42px;
    opacity: 0.3;
    margin-bottom: 12px;
}

.wa-empty-list p {
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.wa-empty-list small {
    font-size: 12px;
}

/* ---- History Tab ---- */
.wa-campaign-card {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: all var(--transition);
    cursor: pointer;
}

.wa-campaign-card:hover {
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.02);
}

.wa-campaign-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wa-campaign-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.wa-campaign-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.wa-status-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.wa-status-sending {
    background: rgba(37, 211, 102, 0.12);
    color: #25D366;
}

.wa-status-paused {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.wa-status-failed {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.wa-status-draft {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.wa-campaign-meta {
    display: flex;
    gap: 20px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.wa-campaign-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wa-campaign-meta i {
    font-size: 11px;
}

.wa-campaign-foot {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

/* ---- Campaign Detail Modal ---- */
body.wa-modal-open {
    overflow: hidden;
}

.wa-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.wa-modal.active {
    display: flex;
}

.wa-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wa-modal-dialog {
    position: relative;
    width: min(1100px, 100%);
    max-height: 86vh;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(37, 211, 102, 0.18);
    background: linear-gradient(180deg, rgba(21, 22, 28, 0.98), rgba(16, 17, 22, 0.98));
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.wa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(7, 94, 84, 0.25), rgba(37, 211, 102, 0.05));
}

.wa-modal-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wa-modal-title span:first-child {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-modal-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.wa-modal-close {
    width: 38px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wa-modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(37, 211, 102, 0.22);
}

.wa-modal-body {
    padding: 16px;
    overflow: auto;
    max-height: calc(86vh - 68px);
}

.wa-detail-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.wa-detail-kpi {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 10px 12px;
}

.wa-detail-kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.wa-detail-kpi-value {
    font-size: 18px;
    font-weight: 850;
    color: var(--text-primary);
}

.wa-detail-kpi-value.wa-ok {
    color: #25D366;
}

.wa-detail-kpi-value.wa-bad {
    color: #ef4444;
}

.wa-detail-kpi-value.wa-warn {
    color: #f59e0b;
}

.wa-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.wa-detail-search {
    position: relative;
    flex: 1 1 260px;
    min-width: 220px;
}

.wa-detail-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.wa-detail-search input {
    width: 100%;
    padding-left: 34px;
}

.wa-detail-table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    overflow: auto;
    max-height: 52vh;
}

.wa-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 860px;
}

.wa-detail-table th,
.wa-detail-table td {
    padding: 10px 12px;
    font-size: 12.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

.wa-detail-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(232, 234, 237, 0.88);
    font-weight: 800;
    text-align: left;
}

.wa-detail-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.wa-detail-empty {
    padding: 22px 12px;
    text-align: center;
    color: var(--text-muted);
}

.wa-msg-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.wa-msg-sent {
    background: rgba(37, 211, 102, 0.12);
    color: #25D366;
}

.wa-msg-failed {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.wa-msg-skipped {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.wa-msg-pending {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.wa-detail-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.wa-detail-foot-left {
    color: var(--text-muted);
    font-size: 12.5px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .wa-workspace {
        grid-template-columns: 1fr;
    }

    .wa-tabs.wa-tabs-side {
        position: relative;
        top: 0;
        max-height: none;
        flex-direction: row;
        overflow-x: auto;
    }

    .wa-tabs.wa-tabs-side .wa-tab {
        justify-content: center;
        white-space: nowrap;
    }

    .wa-dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wa-dash-split {
        grid-template-columns: 1fr;
    }

    .wa-send-grid {
        grid-template-columns: 1fr;
    }

    .wa-numbers-grid {
        grid-template-columns: 1fr;
    }

    .wa-speed-presets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wa-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .wa-protection-bar {
        gap: 12px;
    }

    .wa-prot-item {
        font-size: 12px;
    }

    .wa-tabs {
        flex-direction: column;
    }

    .wa-tabs.wa-tabs-side {
        flex-direction: row;
    }

    .wa-summary-stats {
        flex-direction: column;
    }

    .wa-dash-grid {
        grid-template-columns: 1fr;
    }

    .wa-dash-mini {
        grid-template-columns: 1fr;
    }

    .wa-detail-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wa-detail-table {
        min-width: 760px;
    }
}

/* Footer Buttons Fix */
.wa-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.wa-detail-foot-left {
    font-size: 13px;
    color: var(--text-muted);
}

/* Fix broken layout on mobile */
@media (max-width: 992px) {
    .wa-send-grid {
        grid-template-columns: 1fr;
    }

    .wa-dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .wa-dash-grid {
        grid-template-columns: 1fr;
    }
}

/* Nav SubItem Fix */
.nav-subitem {
    padding-left: 20px !important;
    /* Fix excessive indentation */
}