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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #024985 0%, #013563 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Admin Login Corner Button */
.admin-login-corner {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.admin-login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.admin-login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-container {
    max-width: 400px;
    margin-top: 100px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 16px;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.form-section h2 {
    font-size: 20px;
    color: #ff9210;
    margin-bottom: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #ff9210;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff9210 0%, #e07800 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

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

/* Messages */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    display: none;
}

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

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

/* Back Link */
.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #024985;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    background: white;
    padding: 20px 40px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
    color: #333;
    font-size: 24px;
    margin: 0;
}

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

.refresh-btn {
    background: #ff9210;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover {
    background: #e07800;
    transform: translateY(-2px);
}

.refresh-btn svg {
    transition: transform 0.6s ease;
}

.refresh-btn.spinning svg {
    animation: spin 1s linear;
}

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

.logout-btn {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #ff9210 0%, #e07800 100%);
    color: white;
}

/* Tab Content */
.tab-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.tab-pane {
    display: none;
}

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

.tab-pane h2 {
    color: #333;
    margin-bottom: 20px;
}

/* Request Cards */
.request-card,
.report-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #ff9210;
}

.request-card.processing {
    border-left-color: #ffc107;
    background: #fffbf0;
}

.request-header,
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.request-info h3,
.report-info h3 {
    color: #333;
    margin-bottom: 10px;
}

.request-details,
.report-details {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.request-details p,
.report-details p {
    margin: 5px 0;
}

.request-details strong,
.report-details strong {
    color: #333;
}

.request-actions,
.report-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-actions > div:first-child {
    display: flex;
    gap: 10px;
}

.email-sent-status {
    font-size: 13px;
    color: #28a745;
    padding: 8px 12px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 5px;
    border-left: 3px solid #28a745;
    margin-top: 5px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-approve {
    background: #28a745;
    color: white;
}

.btn-approve:hover {
    background: #218838;
}

.btn-deny {
    background: #dc3545;
    color: white;
}

.btn-deny:hover {
    background: #c82333;
}

.btn-download {
    background: #ff9210;
    color: white;
}

.btn-download:hover {
    background: #024985;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.status-badge.processing {
    background: #ffc107;
    color: #856404;
}

.status-badge.first-timer {
    background: #024985;
    color: white;
}

/* Processing Indicator */
.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff3cd;
    border-radius: 5px;
    color: #856404;
}

.processing-indicator p {
    margin: 0;
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
}

.processing-indicator .spinner {
    border: 3px solid rgba(133, 100, 4, 0.3);
    border-top-color: #856404;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .request-header,
    .report-header {
        flex-direction: column;
    }

    .request-actions,
    .report-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Email Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

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

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

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

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

.modal-body label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.modal-body input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #ddd;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Templates Tab */
.template-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.template-sidebar {
    min-width: 200px;
}

.template-type-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.type-toggle-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.type-toggle-btn:hover {
    border-color: #ff9210;
}

.type-toggle-btn.active {
    background: #ff9210;
    color: white;
    border-color: #ff9210;
}

.template-editor {
    flex: 1;
}

.template-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
}

.template-select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-select:hover {
    border-color: #ff9210;
}

.template-select:focus {
    outline: none;
    border-color: #ff9210;
    box-shadow: 0 0 0 3px rgba(255, 146, 16, 0.1);
}

.template-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.template-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.template-input:focus {
    outline: none;
    border-color: #ff9210;
}

.template-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 300px;
    transition: border-color 0.3s ease;
}

.template-textarea:focus {
    outline: none;
    border-color: #ff9210;
}

.template-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.template-placeholder {
    background: #f8f9fa;
    padding: 60px 20px;
    border-radius: 8px;
    text-align: center;
    color: #666;
}

.template-placeholder p {
    font-size: 16px;
}

/* Responsive templates */
@media (max-width: 768px) {
    .template-container {
        flex-direction: column;
    }

    .template-sidebar {
        min-width: 100%;
    }

    .template-type-toggle {
        flex-direction: row;
    }

    .template-actions {
        flex-direction: column;
    }

    .template-actions .btn {
        width: 100%;
    }
}

/* Clickable Prospect Name */
.clickable-name {
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.clickable-name:hover {
    color: #ff9210;
    text-decoration-color: #ff9210;
}

/* Request Details Modal - Large variant */
.modal-large {
    max-width: 700px;
    max-height: 85vh;
}

.details-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

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

.details-section h3 {
    color: #ff9210;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item strong {
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.detail-item span,
.detail-item a {
    color: #333;
    font-size: 14px;
    word-wrap: break-word;
}

.detail-item a {
    color: #024985;
    text-decoration: none;
}

.detail-item a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .modal-large {
        max-width: 95%;
    }
}

/* Pagination Styles */
.pagination-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
}

.pagination-btn.active {
    background: #ff9210;
    color: white;
    cursor: default;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #666;
    padding: 0 8px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .pagination-controls {
        gap: 5px;
    }

    .pagination-btn {
        min-width: 35px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Email Tags (CC/BCC) Styles */
.email-tags-container {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px;
    background: white;
}

.email-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 28px;
}

.email-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #024985;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.email-tag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.email-tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.email-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.email-input-row input[type="email"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.email-input-row input[type="email"]:focus {
    outline: none;
    border-color: #ff9210;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-width: auto;
}

/* Variable Reference Guide Styles */
.variable-reference {
    margin-top: 30px;
    border: 2px solid #024985;
    border-radius: 8px;
    background: #f0f7ff;
}

.variable-reference-header {
    padding: 12px 15px;
    background: #024985;
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    border-radius: 6px 6px 0 0;
}

.variable-reference-header:hover {
    background: #035aa6;
}

.variable-reference-header span {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.variable-reference-content {
    padding: 15px;
    display: none;
}

.variable-section p {
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.variable-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.variable-list li {
    padding: 8px 10px;
    margin: 5px 0;
    background: white;
    border-left: 3px solid #ff9210;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
}

.variable-list code {
    background: #024985;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
}

.variable-example {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.variable-example strong {
    color: #024985;
    font-size: 13px;
    display: block;
    margin-bottom: 8px;
}

.variable-example pre {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    border-left: 3px solid #ff9210;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
    overflow-x: auto;
    color: #333;
}
