:root {
    --primary-color: #1e293b;
    --secondary-color: #334155;
    --accent-color: #0ea5e9;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --red: #ef4444;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-inter: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-inter);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.file-limit{
    color: #e0d6d6;
}
/* Header Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
}

.header-right {
    display: flex;
    gap: 15px;
}

.icon-btn {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Form Styles */
.vendor-form {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-bottom: 100px;
}

.form-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.section-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.half {
    max-width: calc(50% - 10px);
}

.form-group.quarter {
    max-width: calc(25% - 15px);
}

.form-group.single {
    width: 100%;
}

.error-text{
    color: gray;
    font-size:13px;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.required label::before {
    content: '* ';
    color: var(--red);
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
    width: 100%;
    padding: 4px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input.bg-light {
    background-color: #f1f3f5;
}

/* Custom Select Styles */
.custom-select {
    position: relative;
    cursor: pointer;
}

.select-selected {
    padding: 4px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--white);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.select-selected:after {
    content: "";
    border: 5px solid transparent;
    border-top-color: var(--text-muted);
    margin-top: 5px;
}

.select-items {
    position: absolute;
    background-color: var(--white);
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.select-hide {
    display: none;
}

.option {
    padding: 10px 14px;
}

.option:hover {
    background-color: var(--bg-light);
}

.search-box {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.search-box input {
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* Switch Component */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Input Components */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 40px;
}

.file-upload-icon {
    position: absolute;
    right: 10px;
    cursor: pointer;
    color: var(--text-muted);
    background: #f1f3f5;
    padding: 4px;
    border-radius: 4px;
    display: flex;
}

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix input {
    padding-right: 60px;
}

.suffix {
    position: absolute;
    right: 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Table Styles */
.email-table-container {
    overflow-x: auto;
}

.email-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.email-table th {
    text-align: left;
    padding: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--bg-light);
}

.email-table td {
    padding: 12px;
    border-bottom: 1px solid var(--bg-light);
}

/* Buttons */
.add-btn,
.inline-add-btn {
    background: #eef2f7;
    border: none;
    color: var(--accent-color);
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #e0e7f1;
}

.add-email-btn {
    color: var(--accent-color);
    background: none;
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    margin-top: 20px;
}

.footer-right {
    display: flex;
    gap: 15px;
}

.btn-cancel {
    background: none;
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-draft {
    background: #edc990;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

.btn-submit {
    background: #a5c7b2;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

/* Upload Zone Styles (Matched to add_vendor.php) */
.upload-zone {
    border: 2px dashed var(--border-color) !important;
    border-radius: 12px !important;
    padding: 10px !important;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc !important;
    position: relative;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-color) !important;
    background: #f1f5f9 !important;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.1);
}

/* Icon Button Styles */
.btn-icon {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 1rem;
    transition: all 0.2s;
    line-height: 1;
}

.btn-icon:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.ms-2 {
    margin-left: 8px;
}

.btn-sm {
    padding: 1px 4px;
    font-size: 0.8rem;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Low z-index so buttons can be above */
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-muted);
 
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.view-btn {
    position: relative;
    z-index: 10;
    display: inline-block;
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    margin-top: 5px;
    transition: all 0.2s;
    cursor: pointer;
}

.view-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--accent-color);
}

.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2000;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
    color: var(--accent-color);
}

#viewerContent {
    overflow: auto;
    flex-grow: 1;
    background: #f1f5f9;
}

/* MSME Specific Small Zone */
#uz-msme {
    padding: 10px !important;
    min-height: 40px;
    width: 60px;
    margin-top: 0;
}

/* Branch Specifics */
.branch-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 25px;
}

.branch-header {
    background: #fcfcfc;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-muted);
}

/* Floating Chat */
.floating-chat {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: #1a252f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
}

/* Utility */
.mt-s {
    margin-top: 10px;
}

.mt-m {
    margin-top: 20px;
}

.mt-l {
    margin-top: 30px;
}

.mb-s {
    margin-bottom: 10px;
}

.invisible {
    opacity: 0;
    pointer-events: none;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.row-flex {
    display: flex;
    align-items: center;
    gap: 10px;
}

.center-v {
    align-items: center;
}

.label-right span {
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-group.half,
    .form-group.quarter {
        max-width: 100%;
    }
}

/* Error Modal Styles */
.error-modal .modal {
    border-color: rgba(231, 76, 60, 0.4);
    background: #1a0a0a;
}

.error-modal .modal-header {
    background: rgba(231, 76, 60, 0.1);
}

.error-list {
    padding: 20px;
    list-style: none;
}

.error-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ff9f94;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.error-item:last-child {
    border-bottom: none;
}

.error-dot {
    width: 6px;
    height: 6px;
    background: #e74c3c;
    border-radius: 50%;
}

/* Multi-File List Styles */
.file-list-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 4px;
    font-size: 0.85rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.file-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    /* High visibility size */
    position: relative;
    z-index: 20;
    /* High z-index to be clickable above inputs */
}

.btn-preview {
    color: #4ab1bd !important;
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.3);
}

.btn-delete {
    color: #f38686 !important;
    background: rgba(255, 77, 77, 0.15);
    border-color: rgba(255, 77, 77, 0.3);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-preview:hover {
    background: rgba(0, 229, 255, 0.25);
    border-color: #00e5ff;
}

.btn-delete:hover {
    background: rgba(255, 77, 77, 0.25);
    border-color: #ff4d4d;
}

.action-btn i {
    font-size: 0.8rem;
    /* Clearer FontAwesome icons */
}

.status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft {
    background: #f39c12;
    color: #fff;
}


.status-new {
    background: #4ecb36;
    color: #fff;
}
.status-submitted {
    background: #3498db;
    color: #fff;
}

.status-approved {
    background: #2ecc71;
    color: #fff;
}

.status-rejected {
    background: #e74c3c;
    color: #fff;
}

.verify-btn-inline {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.2s;
}

.verify-btn-inline:hover {
    opacity: 0.9;
}

.verify-btn-inline.verified-done {
    background: rgba(46, 204, 113, 0.2) !important;
    color:#2ecc71;
        border: 1px solid rgba(46, 204, 113, 0.3);
    cursor: default;
    pointer-events: none;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
}

.badge-active { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.3); }
.badge-inactive { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.3); }
.badge-verified { background: rgba(52, 152, 219, 0.2); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.3); }

.verify-result-inline {
    font-size: 0.75rem;
    margin-top: 5px;
    font-weight: 500;
}

.text-success { color: #2ecc71; }
.text-danger { color: #e74c3c; }

.upload-zone.error-border {
    border-color: var(--red) !important;
}

.form-group.required label::after {
    content: " (Mandatory)";
    font-size: 0.7rem;
    font-style: italic;
    color: var(--red);
    opacity: 0.7;
}

/* Readonly Select Styles */
.readonly-select .select-selected {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    cursor: not-allowed !important;
    border-color: rgba(0, 229, 255, 0.1) !important;
}
.readonly-select .select-selected:after {
    display: none; /* Hide the arrow */
}
