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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Container Styles */
.container {
    width: 100%;
    max-width: none;
    padding: 20px;
}

/* Login page specific container */
body:not(.dashboard-container) .container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    max-width: 500px;
    margin: 0 auto;
}

/* Dashboard Container */
.dashboard-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    width: 100%;
    max-width: none;
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-title i {
    font-size: 2rem;
    color: #25D366;
}

.dashboard-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.dashboard-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.api-secret-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 211, 102, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(37, 211, 102, 0.2);
    font-size: 0.9rem;
    color: #155724;
    font-weight: 600;
}

.api-secret-display i {
    color: #25D366;
    font-size: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 211, 102, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(37, 211, 102, 0.2);
    font-size: 0.9rem;
    color: #155724;
    font-weight: 600;
    width: 100%;
    flex-wrap: wrap;
}

.user-info i {
    color: #25D366;
    font-size: 1rem;
}

.api-secret-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9em;
    background: rgba(255, 193, 7, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 193, 7, 0.2);
    margin-top: 8px;
}

.api-secret-info i {
    color: #FFC107;
}

.api-secret-text {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ddd;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-secret-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.copy-secret-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #0056b3;
}

.copy-secret-btn:active {
    transform: scale(0.95);
}

/* Impersonation styles */
.impersonation-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}

.impersonation-badge {
    background: #ffc107;
    color: #000;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.impersonation-badge i {
    color: #000;
    font-size: 1rem;
}

.back-to-admin-btn {
    background: #dc3545 !important;
    color: white !important;
    text-decoration: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.back-to-admin-btn:hover {
    background: #c82333 !important;
    color: white !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn.warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.action-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.action-btn.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.action-btn.info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

.loading-message i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #25D366;
}

/* Login Container */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #25D366;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.logo-image {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

/* Form Styles */
.login-form {
    margin-bottom: 20px;
}

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

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

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

.input-group i {
    position: absolute;
    left: 15px;
    color: #666;
    z-index: 1;
}

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

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    z-index: 1;
}

.toggle-password:hover {
    color: #25D366;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    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;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
}

.login-footer {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
}

.login-footer a {
    color: #25D366;
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Registration Form Styles */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.registration-form label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.registration-form small {
    color: #666;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 30px;
}

/* Enhanced form styles for Send Test Message modal */
#sendTestMessageModal .modal-content {
    max-width: 600px;
    width: 90%;
}

#sendTestMessageModal .form-group {
    margin-bottom: 25px;
}

/* Enhanced form styles for Link Account modal */
#linkAccountModal .modal-content {
    max-width: 500px;
    width: 90%;
}

#linkAccountModal .form-group {
    margin-bottom: 25px;
}

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

#linkAccountModal select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 50px;
    cursor: pointer;
}

#linkAccountModal select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
    background-color: #fff;
}

#linkAccountModal select:hover {
    border-color: #25D366;
}

#linkAccountModal select option {
    padding: 10px;
    background-color: #fff;
    color: #333;
}

#sendTestMessageModal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#sendTestMessageModal .input-group {
    position: relative;
}

#sendTestMessageModal input[type="text"],
#sendTestMessageModal textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
}

#sendTestMessageModal input[type="text"]:focus,
#sendTestMessageModal textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
    transform: translateY(-1px);
}

#sendTestMessageModal textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
    font-size: 15px;
}

#sendTestMessageModal .form-text {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

#sendTestMessageModal .modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

#sendTestMessageModal .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

#sendTestMessageModal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#sendTestMessageModal .btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

#sendTestMessageModal .btn.secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

#sendTestMessageModal .btn.primary {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

#sendTestMessageModal .btn.primary:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
}

/* Dashboard Styles */
.dashboard-content {
    padding: 30px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.accounts-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.accounts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.accounts-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.accounts-header h3 {
    color: #333;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.search-container {
    flex: 1;
    max-width: 500px;
    min-width: 300px;
}

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

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

.search-input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.search-input-group input:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
    transform: translateY(-1px);
}

.search-input-group input::placeholder {
    color: #999;
    font-style: italic;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.clear-search-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.clear-search-btn i {
    font-size: 0.8rem;
}

.accounts-header h3 i {
    color: #25D366;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.stat-card i {
    font-size: 2rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.action-btn.primary {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.action-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

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

.accounts-section h3 {
    margin-bottom: 0;
    color: #333;
    font-size: 1.2rem;
}

.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-card {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.account-card:hover {
    border-color: #25D366;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.1);
    background: #f0f8f0;
}

.account-card.disconnected {
    background: #fef7f7;
}

.account-card.disconnected:hover {
    background: #fef2f2;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.account-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.account-status.connected {
    background: #d4edda;
    color: #155724;
}

.account-status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.account-details {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: #666;
    flex-wrap: wrap;
}

.account-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.account-detail strong {
    color: #333;
    font-weight: 600;
    font-size: 0.75rem;
}

.account-detail span {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #495057;
}

.server-info {
    background: #e3f2fd !important;
    border: 1px solid #2196f3 !important;
    color: #1976d2 !important;
    font-family: 'Segoe UI', sans-serif !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.account-actions .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    min-width: auto;
}

.business-name-input {
    font-size: 0.7rem;
    padding: 2px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.business-name-display {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e9ecef;
    font-size: 0.7rem;
    white-space: nowrap;
}

.business-name-display:hover {
    background: #dee2e6;
}

.server-info i {
    color: #1976d2;
    font-size: 0.9rem;
}

.sent-messages-count {
    color: #25D366 !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: rgba(37, 211, 102, 0.1) !important;
    border-color: #25D366 !important;
}

.sent-messages-count i {
    color: #25D366;
    font-size: 0.9em;
}

.savings-count {
    color: #28a745 !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: rgba(40, 167, 69, 0.1) !important;
    border-color: #28a745 !important;
}

.savings-count i {
    color: #28a745;
    font-size: 0.9em;
}

/* Business Name Input Styles */
.business-name-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #ffffff;
    color: #495057;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.business-name-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.business-name-input:hover {
    border-color: #adb5bd;
}

.business-name-input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Button Styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn.primary {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.btn.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.btn.danger:hover {
    opacity: 1;
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
}

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

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

/* Server Selection Modal Styles */
.server-selection-container {
    text-align: center;
}

.server-selection-container p {
    margin-bottom: 20px;
    color: #666;
    font-size: 1.1rem;
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.server-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.server-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.server-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.server-info i {
    font-size: 1.5rem;
    color: #2196f3;
}

.server-details h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.server-details p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.server-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: 5px;
}

.server-status.online {
    background: #d4edda;
    color: #155724;
}

.server-status.offline {
    background: #f8d7da;
    color: #721c24;
}

.server-item i.fa-chevron-right {
    color: #999;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.server-item:hover i.fa-chevron-right {
    transform: translateX(3px);
    color: #2196f3;
}

.loading-message, .error-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-message i, .error-message i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.error-message {
    color: #dc3545;
}

.error-message i {
    color: #dc3545;
}

/* Monitor Dashboard Styles */
.monitor-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.monitor-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.monitor-section h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #007cba;
}

.notification-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.notification-phone {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-details {
    display: flex;
    gap: 10px;
    align-items: center;
}

.notification-user {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.notification-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.notification-status.status-connected {
    background: #d4edda;
    color: #155724;
}

.notification-status.status-disconnected {
    background: #f8d7da;
    color: #721c24;
}

.notification-time {
    color: #666;
    font-size: 0.9rem;
}

.config-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.config-item strong {
    color: #333;
}

.config-item span {
    color: #666;
    font-family: monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
}

.setup-instructions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setup-step {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #28a745;
}

.setup-step h4 {
    color: #333;
    margin-bottom: 10px;
}

.setup-step p {
    color: #666;
    margin-bottom: 10px;
}

.setup-step code {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: monospace;
    color: #333;
    display: block;
    margin-top: 10px;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-data i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
    color: #ccc;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

/* Responsive design for monitor dashboard */
@media (max-width: 768px) {
    .monitor-sections {
        grid-template-columns: 1fr;
    }
    
    .notification-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .config-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #25D366;
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .subscription-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .account-details {
        gap: 12px;
    }
    
    .account-card {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .account-header {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .login-container {
        padding: 30px 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-actions {
        flex-direction: column;
    }
    
    .dashboard-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .api-secret-display {
        font-size: 0.8rem;
        padding: 6px 10px;
        word-break: break-all;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .account-details {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .account-detail span {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    
    .account-actions {
        gap: 4px;
    }
    
    .account-actions .btn {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
    
    .business-name-input {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .accounts-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-container {
        max-width: none;
        min-width: auto;
    }
    
    .search-input-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .chart-wrapper {
        height: 350px;
    }
    
    .subscription-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 300px;
}

.toast.success {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border-left: 4px solid #0F5132;
}

.toast.error {
    background: linear-gradient(135deg, #DC3545, #C82333);
    color: white;
    border-left: 4px solid #721C24;
}

.toast.info {
    background: linear-gradient(135deg, #0DCAF0, #0AA2C0);
    color: white;
    border-left: 4px solid #055160;
}

.toast.warning {
    background: linear-gradient(135deg, #FFC107, #E0A800);
    color: #212529;
    border-left: 4px solid #856404;
}

.toast i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast .toast-content {
    flex: 1;
    line-height: 1.4;
}

.toast .toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.toast .toast-close:hover {
    opacity: 1;
}

.toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: toastProgress 5s linear;
}

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

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

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Placeholder styles for inline messages */
.error-placeholder, .info-placeholder {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-placeholder {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.info-placeholder {
    background: rgba(13, 202, 240, 0.1);
    color: #055160;
    border: 1px solid rgba(13, 202, 240, 0.2);
}

/* Responsive toast */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* QR Code Modal Styles */
.qr-code-container {
    text-align: center;
    padding: 20px 0;
}

.qr-instructions {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #25D366;
}

.qr-instructions p {
    margin: 10px 0;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.qr-instructions i {
    color: #25D366;
    font-size: 1.2rem;
    width: 20px;
}

.qr-code-display {
    margin: 30px 0;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e1e5e9;
}

.qr-code-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.qr-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-weight: 600;
}

.qr-status i {
    color: #25D366;
}

.qr-details {
    margin-top: 20px;
    text-align: left;
}

.qr-details details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.qr-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.qr-string {
    margin: 10px 0;
    word-break: break-all;
}

.api-debug-info {
    margin: 15px 0;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
}

.debug-details {
    margin-top: 8px;
}

.debug-details div {
    margin: 5px 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.debug-details span {
    color: #1976d2;
    font-weight: 500;
}

.qr-string code {
    background: #e9ecef;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: block;
    margin-top: 5px;
    word-break: break-all;
}

.info-link {
    margin: 10px 0;
    word-break: break-all;
}

/* Account Info Display Styles */
.account-info-display {
    font-family: inherit;
}

.info-section {
    margin-bottom: 20px;
}

.info-section h3 {
    color: #25D366;
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section h3 i {
    font-size: 1.1rem;
}

.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-item strong {
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    color: #212529;
    font-size: 1rem;
    font-weight: 500;
}

.info-item .unique-id {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    background: #ffffff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.connected {
    background: rgba(37, 211, 102, 0.1);
    color: #155724;
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.status-badge.disconnected {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* Subscription Section Styles */
.subscription-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.subscription-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscription-section h3 i {
    color: #25D366;
}

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

.usage-card {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.usage-card:hover {
    border-color: #25D366;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.1);
}

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

.usage-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    text-transform: capitalize;
}

.usage-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.usage-icon.sms_send { background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); }
.usage-icon.sms_receive { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.usage-icon.ussd { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.usage-icon.notifications { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.usage-icon.contacts { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.usage-icon.devices { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.usage-icon.apikeys { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.usage-icon.webhooks { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.usage-icon.actions { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.usage-icon.scheduled { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.usage-icon.wa_send { background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); }
.usage-icon.wa_receive { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.usage-icon.wa_accounts { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

.usage-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.usage-numbers {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.usage-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.usage-limit {
    font-size: 0.9rem;
    color: #666;
}

.usage-percentage {
    font-size: 1.2rem;
    font-weight: 600;
    color: #25D366;
}

.usage-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.usage-progress {
    height: 100%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-progress.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
}

.usage-progress.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.usage-progress.unlimited {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Amount Saved Widget Styles */
.amount-saved-card {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

.amount-saved-card .usage-title {
    color: white;
}

.amount-saved-card .usage-current {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
}

.amount-saved-card .usage-limit {
    color: rgba(255, 255, 255, 0.8);
}

.amount-saved-card .usage-percentage {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.amount-saved-card .usage-icon.amount-saved {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.amount-saved-card .usage-progress.savings {
    background: rgba(255, 255, 255, 0.3);
}

.savings-info {
    margin-top: 8px;
    text-align: center;
}

.savings-info small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
}

/* Usage Graph Section */
.usage-graph-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.usage-graph-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.usage-graph-section h3 i {
    color: #25D366;
}

.graph-container {
    position: relative;
}

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

.period-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
}

.period-info i {
    color: #25D366;
}

.refresh-btn {
    padding: 8px 16px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.refresh-btn:hover {
    background: #128C7E;
}

.refresh-btn i {
    font-size: 0.8rem;
}

.chart-wrapper {
    position: relative;
    height: 500px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e1e5e9;
    width: 100%;
}

.chart-wrapper canvas {
    max-height: 360px;
}

.error-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #dc3545;
    text-align: center;
    gap: 10px;
}

.error-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    text-align: center;
    gap: 10px;
}

.loading-message i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.info-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #25D366;
    text-align: center;
    gap: 10px;
}

.info-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Responsive adjustments for subscription */
@media (max-width: 768px) {
    .subscription-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .usage-card {
        padding: 15px;
    }
    
    .usage-current {
        font-size: 1.2rem;
    }
    
    .usage-percentage {
        font-size: 1rem;
    }

    .graph-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-wrapper {
        height: 300px;
        padding: 15px;
    }
}

/* Footer Styles */
.app-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 25px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.footer-text {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.footer-version {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-divider {
    color: #ccc;
    margin: 0 10px;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-left,
    .footer-right {
        justify-content: center;
    }
    
    .footer-text {
        font-size: 0.8rem;
    }
    
    .footer-version {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
}
