* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f1eb 0%, #e8ddd4 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 90vh;
    display: flex;
    align-items: flex-start;
    padding-top: 2rem;
}

.login-card, .dashboard-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(139, 121, 93, 0.15);
    overflow: visible;
    animation: slideUp 0.6s ease-out;
    width: 100%;
    min-height: 600px;
    position: relative;
}

.dashboard-card {
    min-height: 700px;
    padding: 2.5rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header, .dashboard-header {
    background: linear-gradient(135deg, #d4c4a8 0%, #b8a082 100%);
    color: #5d4e37;
    padding: 3rem 2rem 2.5rem;
    text-align: center;
    border-radius: 16px 16px 0 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 3rem 2.5rem 2.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5d4e37;
    border: 1px solid rgba(93, 78, 55, 0.2);
}

.login-header h1, .dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Login Forms Container */
.login-forms {
    padding: 2rem;
    min-height: 400px;
}

.login-form {
    margin-bottom: 0;
}

.login-form.hidden {
    display: none;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f8f6f1 0%, #f0ede6 100%);
    margin: 0 0 3rem 0;
    border-radius: 16px;
    border: 2px solid #e8ddd4;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #8b795d 0%, #5d4e37 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(139, 121, 93, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5d4e37;
}

.user-details h2 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.25rem;
}

.user-details p {
    margin: 0 0 1rem 0;
    color: #666;
}

.verification-status {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #e8f5e8;
    color: #2d5a2d;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-item svg {
    width: 14px;
    height: 14px;
}

.api-section, .admin-section {
    margin-bottom: 2rem;
}

.api-section h3, .admin-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.method {
    background: #d4c4a8;
    color: #5d4e37;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.path {
    font-family: monospace;
    color: #333;
    font-weight: 500;
    min-width: 120px;
}

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

.admin-content {
    padding: 1.5rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.api-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-family: monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.logout-btn {
    padding: 0.5rem 1rem !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 2px solid #f5f1eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: #e8ddd4;
    box-shadow: 0 4px 12px rgba(139, 121, 93, 0.05);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f5f1eb;
}

.section-icon {
    color: #b8a082;
    flex-shrink: 0;
}

.form-section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8ddd4;
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #8b795d;
    font-weight: 500;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #f0ede7;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #faf9f7;
    height: 52px;
}

.form-group input:focus {
    outline: none;
    border-color: #b8a082;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(184, 160, 130, 0.1);
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.country-select-wrapper {
    position: relative;
    flex-shrink: 0;
}

.country-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #f0ede7;
    border-radius: 8px;
    background: #faf9f7;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 52px;
    min-width: 120px;
}

.country-select:hover {
    border-color: #b8a082;
    background: white;
}

.country-flag {
    font-size: 1.2rem;
}

.country-code {
    font-weight: 600;
    color: #333;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.country-select.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Country Dropdown */
.country-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #f0ede7;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(139, 121, 93, 0.15);
    z-index: 1000;
    max-width: 350px;
    min-width: 280px;
}

.country-search {
    padding: 0.75rem;
    border-bottom: 1px solid #f5f1eb;
}

.country-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #f0ede7;
    border-radius: 6px;
    font-size: 0.9rem;
    height: auto;
}

.country-list {
    max-height: 300px;
    overflow-y: auto;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.country-item:hover {
    background: #faf9f7;
}

.country-item.selected {
    background: #f5f1eb;
}

.country-item-flag {
    font-size: 1.2rem;
    width: 24px;
}

.country-item-name {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

.country-item-code {
    font-weight: 600;
    color: #8b795d;
    font-size: 0.9rem;
}

.phone-input-wrapper {
    flex: 1;
}

.phone-input-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.9rem;
}

.phone-input-wrapper input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #f0ede7;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #faf9f7;
    height: 52px;
}

.phone-input-wrapper input:focus {
    outline: none;
    border-color: #b8a082;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(184, 160, 130, 0.1);
}

/* Verification Code Input */
.code-input-wrapper {
    text-align: center;
}

.code-input-wrapper input {
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5em;
    font-weight: 600;
    font-family: monospace;
    height: 80px;
}

.code-sent-info {
    text-align: center;
    color: #8b795d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1.2rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #d4c4a8 0%, #b8a082 100%);
    color: #5d4e37;
    margin-bottom: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 160, 130, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #8b795d;
    border: 2px solid #f0ede7;
}

.btn-secondary:hover {
    background: #faf9f7;
    border-color: #8b795d;
    color: #5d4e37;
}

.btn-google {
    background: white;
    color: #3c4043;
    border: 2px solid #dadce0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-google:hover {
    background: #faf9f7;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    transform: translateY(-1px);
}

.google-icon {
    flex-shrink: 0;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

/* Form Info */
.form-info {
    text-align: center;
    color: #8b795d;
    font-size: 0.85rem;
}

/* Messages */
.login-message {
    margin: 0 2rem 2rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.login-message.success {
    background-color: #e8f5e8;
    color: #2d5a2d;
    border: 1px solid #c3e6cb;
    display: block;
}

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

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

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 0.5rem;
    }
    
    .login-container, .dashboard-container {
        min-height: 90vh;
    }
    
    .login-card, .dashboard-card {
        border-radius: 12px;
        min-height: 500px;
    }
    
    .login-header, .dashboard-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .login-header h1, .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    .login-forms, .dashboard-content {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .phone-input-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .country-select {
        width: 100%;
        justify-content: space-between;
    }
    
    .country-dropdown {
        max-width: none;
        left: 0;
        right: 0;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        margin: 0 1rem 2rem;
    }
    
    .verification-status {
        justify-content: center;
    }
    
    .endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid #5d4e37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Scrollbar styling for country list */
.country-list::-webkit-scrollbar {
    width: 6px;
}

.country-list::-webkit-scrollbar-track {
    background: #f5f1eb;
}

.country-list::-webkit-scrollbar-thumb {
    background: #b8a082;
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: #8b795d;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    border-bottom: 3px solid #f5f1eb;
    overflow-x: auto;
    padding-bottom: 1.5rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    min-width: 140px;
}

.tab-button:hover {
    background: #f8f9fa;
    color: #5d4e37;
}

.tab-button.active {
    color: #5d4e37;
    background: #f5f1eb;
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1.1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background: #8b795d;
    border-radius: 2px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.section-header h3 {
    color: #5d4e37;
    font-size: 1.8rem;
    font-weight: 700;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 1.1rem;
}

/* Templates Section */
.templates-table {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

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

.templates-table th,
.templates-table td {
    padding: 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.templates-table th {
    background: #f8f9fa;
    font-weight: 700;
    color: #5d4e37;
    font-size: 1.1rem;
}

.templates-table tr:hover {
    background: #f8f9fa;
    cursor: pointer;
}

.templates-table tr:last-child td {
    border-bottom: none;
}

.template-name {
    font-weight: 600;
    color: #5d4e37;
    font-size: 1.1rem;
}

.template-category-badge {
    background: #f5f1eb;
    color: #8b795d;
    padding: 0.25rem 0.8rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-variables-count {
    background: #e7f3ff;
    color: #0056b3;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.template-card {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.template-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-color: #8b795d;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.template-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #5d4e37;
    margin-bottom: 0.5rem;
}

.template-category {
    background: #f5f1eb;
    color: #8b795d;
    padding: 0.25rem 0.8rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-description {
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.template-variables {
    margin: 1rem 0;
}

.template-variables h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #5d4e37;
    margin-bottom: 0.5rem;
}

.variables-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variable-tag {
    background: #e7f3ff;
    color: #0056b3;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
}

.required-variable {
    background: #fff3cd;
    color: #856404;
}

/* Settings Section */
.settings-categories {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.category-tab {
    background: none;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    min-width: 120px;
}

.category-tab:hover {
    color: #5d4e37;
    background: #f8f9fa;
}

.category-tab.active {
    color: #5d4e37;
    border-bottom-color: #8b795d;
    font-weight: 600;
}

.settings-list {
    display: grid;
    gap: 1rem;
}

.setting-item {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.setting-item:hover {
    border-color: #8b795d;
    box-shadow: 0 2px 8px rgba(139, 121, 93, 0.1);
}

.setting-info h5 {
    color: #5d4e37;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.setting-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.setting-value {
    font-family: monospace;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    max-width: 300px;
    word-break: break-all;
}

.setting-value.sensitive {
    background: #fff3cd;
    color: #856404;
}

/* Logs Section */
.logs-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.logs-controls select {
    padding: 0.8rem 1.5rem;
    border: 2px solid #ced4da;
    border-radius: 8px;
    background: white;
    color: #495057;
    font-size: 1rem;
    min-height: 48px;
}

.logs-stats {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    text-align: center;
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #5d4e37;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.logs-list {
    display: grid;
    gap: 1rem;
}

.log-item {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.3s ease;
}

.log-item:hover {
    border-color: #8b795d;
    box-shadow: 0 4px 12px rgba(139, 121, 93, 0.15);
    transform: translateY(-2px);
}

.log-content h5 {
    color: #5d4e37;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.log-content p {
    color: #6c757d;
    margin: 0.4rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.log-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.log-status {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    min-width: 80px;
    text-align: center;
}

.log-status.sent {
    background: #d4edda;
    color: #155724;
}

.log-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.log-status.pending {
    background: #fff3cd;
    color: #856404;
}

.log-date {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.8rem 1.5rem;
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    min-height: 48px;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #f8f9fa;
    border-color: #8b795d;
}

.pagination button.active {
    background: #8b795d;
    color: white;
    border-color: #8b795d;
}

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

/* Responsive Design for Tabs */
@media (max-width: 768px) {
    .dashboard-container {
        max-width: 100%;
        padding: 0.5rem;
    }
    
    .dashboard-tabs {
        padding: 0 0.5rem 1rem;
    }
    
    .tab-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logs-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logs-controls select {
        width: 100%;
    }
    
    .templates-list {
        grid-template-columns: 1fr;
    }
    
    .log-item {
        grid-template-columns: 1fr;
    }
    
    .log-meta {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Template Dialog */
.template-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.dialog-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1001;
    width: 1200px;
}

.dialog-header {
    padding: 2rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f6f1 0%, #f0ede6 100%);
}

.dialog-header h2 {
    margin: 0;
    color: #5d4e37;
    font-size: 1.8rem;
    font-weight: 700;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dialog-close:hover {
    background: rgba(108, 117, 125, 0.1);
    color: #5d4e37;
}

.dialog-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.email-input-section {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.email-input-section label {
    font-weight: 600;
    color: #5d4e37;
    margin-bottom: 0.5rem;
    display: block;
}

.email-input-section input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.email-input-section input:focus {
    outline: none;
    border-color: #8b795d;
    box-shadow: 0 0 0 3px rgba(139, 121, 93, 0.1);
}

.template-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 500px;
}

.editor-column {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.editor-column h3 {
    background: #f8f9fa;
    padding: 1.5rem;
    margin: 0;
    color: #5d4e37;
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: 1px solid #e9ecef;
}

.template-variables-form {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 420px;
}

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

.variable-input label {
    display: block;
    font-weight: 600;
    color: #5d4e37;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.variable-input input,
.variable-input textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.variable-input input:focus,
.variable-input textarea:focus {
    outline: none;
    border-color: #8b795d;
    box-shadow: 0 0 0 2px rgba(139, 121, 93, 0.1);
}

.variable-input textarea {
    resize: vertical;
    min-height: 60px;
}

.template-preview {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 420px;
    background: white;
}

.template-preview iframe {
    width: 100%;
    height: 400px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

/* Additional utility classes */
.text-success { color: #28a745; font-weight: 600; }
.text-danger { color: #dc3545; font-weight: 600; }
.text-warning { color: #ffc107; font-weight: 600; }
.text-muted { color: #6c757d; font-size: 1rem; }

.bg-success { background-color: #d4edda; }
.bg-danger { background-color: #f8d7da; }
.bg-warning { background-color: #fff3cd; }

.border-success { border-color: #28a745; }
.border-danger { border-color: #dc3545; }
.border-warning { border-color: #ffc107; }