/* TAPSA SMS - Main Stylesheet */
/* ================================ */

/* CSS Variables */
:root {
    /* Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Brand Colors */
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --primary-light: #e0f2fe;
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #6366f1;
    --info-light: #e0e7ff;
    
    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Dark Theme */
.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 300px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.error i {
    color: var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.warning i {
    color: var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast.info i {
    color: var(--info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

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

/* ================================ */
/* AUTH PAGES */
/* ================================ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.auth-page {
    display: none;
    width: 100%;
    max-width: 420px;
}

.auth-page.active {
    display: block;
}

.auth-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

.auth-header .logo i {
    font-size: 28px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i:first-child {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ================================ */
/* BUTTONS */
/* ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn[disabled],
.btn.loading {
    opacity: 0.65;
    cursor: wait;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ================================ */
/* APP LAYOUT */
/* ================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal), transform var(--transition-normal);
}

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

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-header .logo i {
    font-size: 22px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
}

.nav-item a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active a {
    background: var(--primary-light);
    color: var(--primary);
}

.dark-theme .nav-item.active a {
    background: rgba(14, 165, 233, 0.15);
}

.nav-item a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-details span {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details .email {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 99;
}

.mobile-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ================================ */
/* CARDS */
/* ================================ */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.link {
    font-size: 14px;
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.purple {
    background: var(--info-light);
    color: var(--info);
}

.stat-icon.orange {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.yellow {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* ================================ */
/* TABLES */
/* ================================ */

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-options {
    display: flex;
    gap: 12px;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.table th:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.table th:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.table td {
    font-size: 14px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

/* Status Badges */
.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-delivered,
.status-approved,
.status-active {
    background: var(--success-light);
    color: var(--success);
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-failed,
.status-rejected,
.status-inactive {
    background: var(--danger-light);
    color: var(--danger);
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.action-btn.edit {
    background: var(--primary-light);
    color: var(--primary);
}

.action-btn.delete {
    background: var(--danger-light);
    color: var(--danger);
}

.action-btn.view {
    background: var(--info-light);
    color: var(--info);
}

.action-btn:hover {
    opacity: 0.8;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================ */
/* FORMS */
/* ================================ */

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input:disabled,
.form-select:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    cursor: pointer;
}

.helper-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

/* Radio & Checkbox Groups */
.recipient-options {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
}

.recipient-input {
    margin-top: 12px;
}

.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.checkbox-item:last-child {
    border-bottom: none;
}

/* Message Counter */
.message-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ================================ */
/* SEND SMS PAGE */
/* ================================ */

.send-sms-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.quick-stat i {
    font-size: 20px;
    color: var(--primary);
}

.quick-stat div {
    display: flex;
    flex-direction: column;
}

.quick-stat .label {
    font-size: 12px;
    color: var(--text-secondary);
}

.quick-stat .value {
    font-size: 18px;
    font-weight: 600;
}

/* ================================ */
/* CONTACTS SELECTOR */
/* ================================ */

.contacts-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ================================ */
/* GROUPS PAGE */
/* ================================ */

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.group-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-fast);
}

.group-card:hover {
    box-shadow: var(--shadow-md);
}

.group-card.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-tertiary);
}

.group-card.empty i {
    font-size: 40px;
    margin-bottom: 12px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.group-header h4 {
    font-size: 16px;
    font-weight: 600;
}

.group-members {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.group-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ================================ */
/* CREDITS PAGE */
/* ================================ */

.credits-info {
    margin-bottom: 32px;
}

.current-balance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
}

.balance-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.balance-details .label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.balance-details .value {
    font-size: 32px;
    font-weight: 700;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.pricing-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.pricing-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
    border-color: var(--primary);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.package-name {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.package-sms {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.package-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.package-rate {
    font-size: 13px;
    color: var(--text-secondary);
}

.custom-amount-card {
    max-width: 600px;
}

.custom-amount-card h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

/* ================================ */
/* DEVELOPER DOCS PAGE */
/* ================================ */

.docs-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
}

.docs-sidebar {
    position: sticky;
    top: 24px;
    height: fit-content;
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.docs-nav a {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.docs-nav a:hover,
.docs-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.dark-theme .docs-nav a:hover,
.dark-theme .docs-nav a.active {
    background: rgba(14, 165, 233, 0.15);
}

.docs-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.docs-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.docs-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.docs-section h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

.docs-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 20px 0 12px;
    color: var(--text-secondary);
}

.docs-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.endpoint-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.method {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
}

.method.get {
    background: var(--success);
    color: white;
}

.method.post {
    background: var(--primary);
    color: white;
}

.method.put {
    background: var(--warning);
    color: white;
}

.method.delete {
    background: var(--danger);
    color: white;
}

.endpoint {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

.code-block {
    background: #1e293b;
    border-radius: var(--radius-md);
    margin: 12px 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #0f172a;
    font-size: 12px;
    color: #94a3b8;
}

.copy-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.6;
}

.tabs {
    display: flex;
    gap: 4px;
    margin: 20px 0 0;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

.tab-content {
    display: none;
}

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

/* ================================ */
/* MODALS */
/* ================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Payment Modal */
.payment-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 16px;
    font-weight: 600;
}

/* API Key Display */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.api-key-display code {
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    word-break: break-all;
}

/* Request Details */
.request-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.request-details p {
    margin-bottom: 8px;
    font-size: 14px;
}

.request-details p:last-child {
    margin-bottom: 0;
}

/* ================================ */
/* ALERTS */
/* ================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert i {
    font-size: 18px;
    margin-top: 2px;
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid currentColor;
}

.alert-warning {
    background: var(--warning-light);
    color: #b45309;
    border: 1px solid currentColor;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid currentColor;
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid currentColor;
}

/* ================================ */
/* DROPDOWNS */
/* ================================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--bg-tertiary);
}

.dropdown-menu a i {
    width: 16px;
    color: var(--text-secondary);
}

.dropdown-footer {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.dropdown-footer small {
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.4;
}

/* ================================ */
/* PROFILE PAGE */
/* ================================ */

.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

.profile-card {
    text-align: center;
}

.profile-header {
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: var(--primary);
}

.profile-header h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.profile-stat {
    text-align: center;
}

.profile-stat .value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.profile-stat .label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* ================================ */
/* RESPONSIVE */
/* ================================ */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-container {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .send-sms-container {
        grid-template-columns: 1fr;
    }
    
    .docs-container {
        grid-template-columns: 1fr;
    }
    
    .docs-sidebar {
        position: static;
    }
    
    .docs-nav {
        flex-direction: row;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-header {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-cards {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .recipient-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .search-box {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        text-align: center;
    }
    
    .modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .balance-details .value {
        font-size: 24px;
    }
}
