:root {
    --primary-color: #248ffa;
    --primary-light: #248ffa;
    --primary-dark: #248ffa;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gradient-primary: #248ffa;
    --gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

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

/* Home Page Styles */
.home-container {
    min-height: 100vh;
    background: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.home-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23a)"/><circle cx="800" cy="300" r="150" fill="url(%23a)"/><circle cx="400" cy="700" r="120" fill="url(%23a)"/></svg>');
    pointer-events: none;
}

.home-header {
    position: relative;
    z-index: 10;
    padding: 2rem 0;
}

.home-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.home-logo {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.home-nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.home-nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.home-nav-links a:hover {
    opacity: 0.8;
}

.btn-outline-white {
    border: 2px solid white;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.home-hero {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    color: white;
}

.home-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.home-hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.home-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.btn-white {
    background: white;
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.home-features {
    background: var(--surface-color);
    padding: 6rem 2rem;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features-header {
    text-align: center;
    margin-bottom: 4rem;
}

.features-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.features-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.home-stats {
    background: var(--gradient-secondary);
    padding: 4rem 2rem;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    min-width: 280px;
    max-width: 360px;
    padding: 0.75rem 1rem;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast.hide {
    opacity: 0;
    transform: translateX(16px);
}
.toast .toast-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toast .toast-icon {
    color: var(--primary-color);
}
.toast.success {
    border-left-color: var(--success-color);
}
.toast.error {
    border-left-color: var(--error-color);
}
.toast.info {
    border-left-color: var(--primary-light);
}
.toast .toast-message {
    flex: 1;
}
.toast .toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}
.toast .toast-close:hover {
    color: var(--text-primary);
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.75rem 0.5rem;
}
.pagination {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.page-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    cursor: pointer;
}
.page-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}
.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.home-footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    opacity: 0.8;
    margin-bottom: 1rem;
}

/* Dashboard Styles */
.container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--primary-dark);
    color: white;
    padding: 20px;
}

.sidebar .logo {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.sidebar .menu {
    list-style: none;
    padding: 0;
}

.sidebar .menu li {
    margin-bottom: 10px;
}

.sidebar .menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.sidebar .menu a:hover,
.sidebar .menu a.active {
    background: var(--primary-light);
    color: white;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

.header .search-bar {
    width: 300px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.header .user-info {
    display: flex;
    align-items: center;
}

.header .user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.card h3 {
    margin-top: 0;
}

.stat-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-value {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

/* Login and Register Page Styles */
.login-container,
.register-container {
    min-height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-box,
.register-box {
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2,
.register-box h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-box p,
.register-box p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

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

.input-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-secondary i {
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #111827;
}

.login-box .btn-primary,
.register-box .btn-primary {
    width: 100%;
    margin-bottom: 1rem;
}

.login-box a,
.register-box a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-box a:hover,
.register-box a:hover {
    text-decoration: underline;
}

/* Modern Login/Register Pages - simplified */
.modern-login-container {
    min-height: 100vh;
    background: #e5f1ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-content {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    padding: 32px 28px 28px;
    text-align: center;
}

.login-branding {
    margin-bottom: 24px;
}

.login-branding .brand-logo {
    margin: 0 auto 16px;
    display: flex;
    justify-content: center;
}

.login-branding .brand-logo img {
    height: 40px;
    width: auto;
}

.login-branding h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #0f172a;
}

.login-branding p {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

.feature-highlights {
    display: none;
}

.login-form-container {
    margin-top: 8px;
}

.login-form-box {
    width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.form-header p {
    color: #666;
    font-size: 1rem;
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

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

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

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

.input-wrapper i {
    position: absolute;
    left: 15px;
    color: #666;
    font-size: 1rem;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #248ffa;
    background: white;
    box-shadow: 0 0 0 3px rgba(20, 89, 217, 0.12);
}

.checkbox-group {
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #248ffa;
    border-color: #248ffa;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.btn-modern-primary {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(42, 82, 152, 0.3);
}

.btn-modern-primary.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-footer p {
    margin: 10px 0;
    color: #666;
    font-size: 0.95rem;
}

.form-footer a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: #1e3c72;
}

.form-result {
    margin-top: 20px;
}

.success-message, .error-message {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modern Modal */
.modern-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modern-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
}

/* Forms */
.sms-form, .client-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.875rem;
}

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

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: #a0aec0;
    z-index: 1;
}

.input-wrapper input, .input-wrapper textarea, .input-wrapper select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.input-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}

.input-wrapper input:focus, .input-wrapper textarea:focus, .input-wrapper select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.input-wrapper textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

.btn-modern-primary {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-modern-primary:hover {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    transform: translateY(-1px);
}

/* API Info Styles */
.api-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.api-section h4 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #2d3748;
}

.api-key-container {
    display: flex;
    gap: 0.5rem;
}

.api-key-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f7fafc;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

.btn-copy {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #3182ce;
}

.btn-copy.copied {
    background: #38a169;
}

.api-endpoint {
    display: block;
    background: #f7fafc;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

.form-select, .form-control {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.form-select:focus, .form-control:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .search-container {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-section {
        grid-template-columns: 1fr;
    }

    .messages-table, .clients-table {
        overflow-x: auto;
    }

    .clients-table .table-header,
    .clients-table .table-row {
        min-width: 920px;
    }

    .table-header, .table-row {
        min-width: 640px;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-input {
        width: 100%;
    }

    .user-name {
        display: none;
    }

    .notification-btn,
    .logout-btn,
    .user-profile {
        padding: 0.75rem;
    }

    .action-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .action-icon {
        order: -1;
    }
}

/* Reports tables explicit alignment overrides */
.clients-table.reports-usage-table .table-header,
.clients-table.reports-usage-table .table-row {
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr;
}

.clients-table.reports-payments-table .table-header,
.clients-table.reports-payments-table .table-row {
    grid-template-columns: 1.5fr 0.8fr 2fr;
}

@media (max-width: 900px) {
    .login-content {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .login-branding {
        padding: 2.25rem 1.5rem;
        text-align: center;
        align-items: center;
    }

    .login-form-container {
        padding: 2.25rem 1.5rem;
    }

    .login-branding h1 {
        font-size: 2rem;
    }

    .login-branding p {
        margin-bottom: 1.5rem;
    }

    .feature-highlights {
        width: 100%;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .modern-login-container {
        padding: 1rem;
    }

    .brand-logo {
        font-size: 1.25rem;
    }

    .brand-logo i {
        font-size: 1.75rem;
    }

    .form-header h2 {
        font-size: 1.6rem;
    }

    .input-wrapper input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    }

    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        top: 0.75rem;
    }

    .toast {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .api-key-container {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-copy {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .home-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 0 1rem;
    }

    .home-nav-links {
        width: 100%;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .home-hero {
        padding: 3rem 1rem;
    }

    .home-hero h1 {
        font-size: 2.5rem;
    }

    .home-hero p {
        font-size: 1.1rem;
    }

    .home-features {
        padding: 4rem 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .home-logo {
        font-size: 1.5rem;
    }

    .home-hero h1 {
        font-size: 2.1rem;
    }

    .home-hero p {
        font-size: 1rem;
    }

    .btn-white,
    .btn-outline-white {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
    }

    .sidebar .logo {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }

    .sidebar .menu {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar .menu li {
        margin-bottom: 0;
    }

    .sidebar .menu a {
        padding: 0.5rem 0.75rem;
    }

    .main-content {
        padding: 1rem;
    }
}

/* Dashboard Styles */
.dashboard-body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Auth Body - Prevent scrolling on login/register pages */
.auth-body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: #248ffa;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

.modern-dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-left: 200px;
    transition: padding-left 0.2s ease;
}

.dashboard-shell {
    display: flex;
    flex: 1;
    min-height: 0;
}

.dashboard-sidebar {
    width: 200px;
    background:  #248ffa;
    color: #ffffff;
    padding: 1.75rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.15);
    overflow-y: auto;
    transition: width 0.2s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
}

.dashboard-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 2.75rem 2rem 2rem;
    min-height: 0;
    background: linear-gradient(180deg, #eef2ff 0%, #f9fafb 60%, #f3f4f6 100%);
}

.dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    height: 56px;
    padding: 0 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    border-bottom: none;
}

.sidebar-logo img {
    width: 95px;
    height: 30px;
    background: #ffffff;
    border-radius: 8px;
    padding: 1px 1px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-section-title {
    padding: 0.75rem 2rem 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    color: rgba(226, 232, 240, 0.9);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    border-radius: 0 999px 999px 0;
    margin-right: 1rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.sidebar-link i {
    font-size: 1rem;
}

.sidebar-link span {
    flex: 1;
}

.sidebar-link:hover {
    background: rgba(15, 23, 42, 0.35);
    color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.7);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    border-left-color: #38bdf8;
}

.sidebar-link.disabled {
    opacity: 0.6;
    cursor: default;
}

/* Dashboard Header */
.dashboard-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.85rem 2rem;
    padding-left: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
}

.brand-logo i {
    color: #90D5FF;
    font-size: 1.5rem;
}

.topbar-logo {
    height: 26px;
    width: auto;
    display: block;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container i {
    position: absolute;
    left: 1rem;
    color: #a0aec0;
    z-index: 1;
}

.search-input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    width: 300px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-btn:hover {
    background: #eff6ff;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e53e3e;
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    min-width: 1.25rem;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile:hover {
    background: #eff6ff;
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: #0f172a;
}

.sidebar-toggle {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    border-radius: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar-toggle:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.logout-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #e53e3e;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #fed7d7;
}

/* Dashboard Main Content */
.dashboard-main {
    flex: 1;
    padding: 1.75rem 2rem 2rem;
    max-width: 1600px;
    margin: 0 auto 0;
    width: 100%;
}

.dashboard-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.dashboard-page-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #0f172a;
}

.dashboard-breadcrumb {
    font-size: 0.85rem;
    color: #6b7280;
}

.dashboard-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.dashboard-breadcrumb a:hover {
    text-decoration: underline;
}

.dashboard-filters-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    margin-bottom: 1.5rem;
}

.dashboard-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.dashboard-filters-row .input-group {
    min-width: 160px;
}

.dashboard-filters-actions {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

.dashboard-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dashboard-charts-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.stat-icon.sent { background: #248ffa; }
.stat-icon.delivered { background: linear-gradient(135deg, #48bb78, #38a169); }
.stat-icon.pending { background: linear-gradient(135deg, #ed8936, #dd6b20); }
.stat-icon.balance { background: linear-gradient(135deg, #9f7aea, #805ad5); }
.stat-icon.clients { background: #248ffa; }
.stat-icon.messages { background: linear-gradient(135deg, #48bb78, #38a169); }
.stat-icon.revenue { background: linear-gradient(135deg, #ed8936, #dd6b20); }
.stat-icon.active { background: linear-gradient(135deg, #9f7aea, #805ad5); }

.stat-content h3 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.25rem 0;
}

.stat-content p {
    color: #718096;
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.stat-change.positive {
    background: #c6f6d5;
    color: #22543d;
}

.stat-change.negative {
    background: #fed7d7;
    color: #742a2a;
}

.stat-change.neutral {
    background: #e2e8f0;
    color: #4a5568;
}

.modern-dashboard.sidebar-collapsed .dashboard-sidebar {
    width: 72px;
}
.modern-dashboard.sidebar-collapsed {
    padding-left: 72px;
}
.modern-dashboard.sidebar-collapsed .sidebar-logo span {
    display: none;
}
.modern-dashboard.sidebar-collapsed .sidebar-section-title {
    display: none;
}
.modern-dashboard.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.65rem 0;
    margin-right: 0;
    border-radius: 0;
}
.modern-dashboard.sidebar-collapsed .sidebar-link span {
    display: none;
}
.modern-dashboard.sidebar-collapsed .sidebar-link i {
    font-size: 1.1rem;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(1px);
    display: none;
    z-index: 90;
}

@media (max-width: 1024px) {
    .modern-dashboard {
        padding-left: 0;
    }
    .dashboard-header {
        height: 60px;
    }
    .dashboard-shell {
        position: relative;
    }
    .dashboard-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        width: 240px; /* use full width for mobile drawer */
    }
    .modern-dashboard.sidebar-open .dashboard-sidebar {
        transform: translateX(0);
        z-index: 100;
    }
    .modern-dashboard.sidebar-open .sidebar-overlay {
        display: block;
    }
}

@media (min-width: 1025px) {
    .modern-dashboard.sidebar-collapsed .dashboard-sidebar:hover {
        width: 250px;
    }
    .modern-dashboard.sidebar-collapsed .dashboard-sidebar:hover .sidebar-section-title,
    .modern-dashboard.sidebar-collapsed .dashboard-sidebar:hover .sidebar-link span,
    .modern-dashboard.sidebar-collapsed .dashboard-sidebar:hover .sidebar-logo span {
        display: inline;
    }
    .modern-dashboard.sidebar-collapsed .dashboard-sidebar:hover .sidebar-link {
        padding: 0.65rem 2rem;
        margin-right: 1rem;
        border-radius: 0 999px 999px 0;
        justify-content: flex-start;
    }
}
/* Action Section */
.action-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.action-card.primary {
    background: #248ffa;
    color: white;
}

.action-card.secondary {
    background: white;
    border: 2px solid #e2e8f0;
}

.action-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.action-content p {
    opacity: 0.8;
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
}

.btn-action, .btn-action-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-action-secondary {
    background: #248ffa;
    color: white;
}

.btn-action-secondary:hover {
    background: #248ffa;
}

.action-icon {
    font-size: 2rem;
    opacity: 0.3;
}

/* Recent Section */
.recent-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.btn-view-all {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-view-all:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* Tables */
.messages-table, .clients-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
}

.clients-table .table-header {
    grid-template-columns: 1.5fr 1fr 1.5fr 1fr 1fr 1fr;
}

.table-body {
    min-height: 200px;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f7fafc;
    align-items: center;
    transition: all 0.2s;
}

.clients-table .table-row {
    grid-template-columns: 1.5fr 1fr 1.5fr 1fr 1fr 1fr;
}

/* reports-payments-table keeps grid-based layout */
.reports-payments-table .table-header,
.reports-payments-table .table-row {
    grid-template-columns: 1.5fr 0.8fr 2fr;
}

.table-row:hover {
    background: #f7fafc;
}

.table-row .col {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* keep flex alignment for grid-based tables only */
.table-header .col.text-right,
.table-row .col.text-right {
    justify-content: flex-end;
}

/* Monthly usage table (admin reports) uses real table markup */
.monthly-usage-table {
    width: 100%;
    border-collapse: collapse;
}

.monthly-usage-table thead th {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
}

.monthly-usage-table tbody td {
    padding: 1rem 0;
    border-bottom: 1px solid #f7fafc;
    font-size: 0.875rem;
    color: #2d3748;
}

.monthly-usage-table th.text-right,
.monthly-usage-table td.text-right {
    text-align: right;
}

.monthly-usage-table .usage-empty-cell {
    text-align: center;
    padding: 16px 0;
    color: #6b7280;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-avatar {
    width: 2rem;
    height: 2rem;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
}

.client-name {
    font-weight: 500;
    color: #2d3748;
}

.api-key {
    background: #f7fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: #4a5568;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy-small {
    background: none;
    border: none;
    padding: 0.25rem;
    border-radius: 0.25rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-small:hover {
    background: #e2e8f0;
}

.balance.positive {
    color: #38a169;
    font-weight: 500;
}

.balance.negative {
    color: #e53e3e;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-edit, .btn-delete {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    color: #4299e1;
}

.btn-edit:hover {
    background: #ebf8ff;
}

.btn-delete {
    color: #e53e3e;
}

.btn-delete:hover {
    background: #fed7d7;
}

/* Empty and Loading States */
.empty-state, .loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.empty-state i, .loading-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.empty-state p, .loading-state p {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
}

.btn-send-first {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send-first:hover {
    background: #3182ce;
}

/* Modern Modals */
.modern-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modern-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    transition: all 0.3s;
}

.modal-content.modal-large {
    max-width: 900px;
    width: 95%;
}

.modern-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
}

/* Forms */
.sms-form, .client-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.875rem;
}

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

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: #a0aec0;
    z-index: 1;
}

.input-wrapper input, .input-wrapper textarea {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.input-wrapper input:focus, .input-wrapper textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.input-wrapper textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

.btn-modern-primary {
    background: #248ffa;
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-modern-primary:hover {
    background: #248ffa;
    transform: translateY(-1px);
}

/* API Info Styles */
.api-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.api-section h4 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #2d3748;
}

.api-key-container {
    display: flex;
    gap: 0.5rem;
}

.api-key-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f7fafc;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

.btn-copy {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #3182ce;
}

.btn-copy.copied {
    background: #38a169;
}

.api-endpoint {
    display: block;
    background: #f7fafc;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .search-container {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-section {
        grid-template-columns: 1fr;
    }

    .messages-table, .clients-table {
        overflow-x: auto;
    }

    .clients-table .table-header,
    .clients-table .table-row {
        min-width: 920px;
    }

    .table-header, .table-row {
        min-width: 640px;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-input {
        width: 100%;
    }

    .user-name {
        display: none;
    }

    .notification-btn,
    .logout-btn,
    .user-profile {
        padding: 0.75rem;
    }

    .action-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .action-icon {
        order: -1;
    }
}

/* Detailed Reports Table (6 columns) */
.messages-table.detailed-reports .table-header,
.messages-table.detailed-reports .table-row {
    grid-template-columns: 1.2fr 1.5fr 0.8fr 0.8fr 1fr 1fr;
}

/* Detailed Messages Table (7 columns) */
.messages-table.detailed-messages .table-header,
.messages-table.detailed-messages .table-row {
    grid-template-columns: 1.2fr 2fr 0.8fr 0.8fr 0.8fr 0.8fr 1.2fr;
}
