/* Modern Reset and Centering */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* The Login Card */
.login-container {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 380px;
}

h2 {
    margin-top: 0;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #4A90E2;
}

/* Button Styling */
button {
    width: 100%;
    padding: 12px;
    background-color: #4A90E2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.5rem;
}

button:hover {
    background-color: #357ABD;
}

/* Extra Links */
.footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #777;
}

.footer-text a {
    color: #4A90E2;
    text-decoration: none;
}

/* Dashboard CSS */
:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --primary-red: #e63946;
    --accent-black: #1a1a1a;
    --text-main: #333;
    --border-color: #eee;
    --status-new: #ffca3a;
    --status-active: #2a9d8f;
    --status-denied: #e63946;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;

    /* Override the login page centering + fixed viewport height */
    display: block;
    justify-content: initial;
    align-items: initial;
    height: auto;
    min-height: 100vh;

    /* Allow the page to scroll when lots of rows exist */
    overflow-y: auto;
    overflow-x: hidden;
}

.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Top Header Area */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dash-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--accent-black);
}

.options-btn {
    background-color: var(--accent-black);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.options-btn:hover { opacity: 0.8; }

/*Options Menus Styles */
/* The container that keeps the menu tethered to the button */
.options-wrapper {
    position: relative;
    display: inline-block;
}

/* The actual menu */
.dropdown-box {
    display: none; /* JS toggles this */
    position: absolute;
    top: calc(100% + 8px); /* Sits exactly 8px below the button */
    right: 0;             /* Aligns right edge with button right edge */
    width: 200px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
}

/* Menu items */
.dropdown-box a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.dropdown-box a:last-child { border-bottom: none; }

.dropdown-box a:hover {
    background: #f8f9fa;
    color: var(--accent-black); /* Matches your theme */
}

/* Section Styling */
.section-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    overflow: hidden;

    /* If table gets wider than the card (long emails), allow horizontal scroll */
    overflow-x: auto;
}

.section-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    margin: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
}

/* Make long text (like emails) wrap instead of forcing overflow */
th,
td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.bg-new { background-color: var(--status-new); color: #000; }
.bg-active { background-color: var(--status-active); }
.bg-denied { background-color: var(--status-denied); }

.action-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

/* The semi-transparent background */
#modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

/* The Box itself */
#modal-content {
    background: #fff;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh; /* Keeps it from going off-screen */
    overflow-y: auto; /* Scrollbar for many locations */
    border-radius: 12px;
    position: relative;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Close button */
#modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    z-index: 10;
}
#modal-close:hover { color: #333; }

/* FULL SCREEN IMAGE LIGHTBOX */
.fullscreen-lightbox {
    display: none;
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    cursor: zoom-out;
    justify-content: center;
    align-items: center;
}
.fullscreen-lightbox img {
    max-width: 95%;
    max-height: 95%;
    border: 3px solid white;
}

/* Full-screen overlay for the zoomed image */
#image-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001; /* Higher than the main modal */
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

/* The actual image in the lightbox */
#lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
    border: 3px solid white;
}

/* Optional Lightbox Close Button */
#lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #eaeaea;
    margin-bottom: 20px;
    border-radius: 8px 8px 0 0;
}

.user-info h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #222;
}

.user-info p {
    margin: 5px 0 0;
    color: #666;
    font-size: 0.95rem;
}

.display_shopify_verified {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e7f3ff;
    color: #007ace;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid #cde4ff;
}

.badge {
    background: #e1f5fe;
    color: #0288d1;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.business-grid {
    width: 300px; /* Adjust based on your modal width */
    float: left;
    margin: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden; /* Clips the image to the border radius */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.business-grid:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Image at the top of the card */
.business-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    background: #eee;
}

/* Content area */
.business-info {
    padding: 15px;
}

.business-info h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.business-info p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.business-info strong {
    color: #111;
    font-weight: 600;
}

/* Mobile Tweak: Make cards full width on small screens */
@media (max-width: 600px) {
    .business-grid {
        width: 100%;
        float: none;
        margin: 10px 0;
    }

    .contact-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}



/* Add Button Style */
.add-btn {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: background 0.2s;
}

.add-btn:hover {
    background-color: var(--accent-black);
}

.header-group {
    display: flex;
    align-items: center;
    gap: 15px;
}



#templateWrapper{
    display:none;
}


/* Layout for the right side of the header */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Button Grouping */
.header-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-deny {
    background: #f44336;
    color: white;
    border: 1px solid #d32f2f;
}
.btn-deny:hover { background: #d32f2f; }

.btn-approve {
    background: #4caf50;
    color: white;
    border: 1px solid #388e3c;
}
.btn-approve:hover { background: #388e3c; }

/* Mobile Adjustment */
@media (max-width: 600px) {
    .contact-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-right {
        align-items: flex-start;
        width: 100%;
        margin-top: 15px;
    }
    .header-actions {
        width: 100%;
    }
    .btn {
        flex: 1; /* Buttons grow to fill width on mobile */
    }
}


.user-form-container {
    max-width: 400px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}
.user-form-container h3 { margin-top: 0; color: #333; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.85rem; }
.form-group input {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;
}
.btn-submit {
    width: 100%; padding: 12px; background: #007ace; color: white; border: none; border-radius: 4px;
    font-weight: bold; cursor: pointer;
}
.btn-submit:hover { background: #005fa3; }


#toast-notice {
    position: fixed;
    top: -100px; /* Start hidden above the screen */
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    padding: 15px 25px;
    border-radius: 0 0 8px 8px; /* Rounded only on the bottom */
    color: white;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 11000; /* Above everything, including modals */
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#toast-notice.success { background-color: #28a745; border: 1px solid #1e7e34; }
#toast-notice.error { background-color: #dc3545; border: 1px solid #bd2130; }
#toast-notice.show { top: 0; }


/* Tab Styles */
.tabs-container {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--accent-black);
    background: rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Location Actions Styling */
.location-actions {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.btn-edit-location {
    background: #4A90E2;
    color: white;
    border: 1px solid #357ABD;
}

.btn-edit-location:hover {
    background: #357ABD;
}

.btn-delete-location {
    background: #e63946;
    color: white;
    border: 1px solid #d32f2f;
}

.btn-delete-location:hover {
    background: #d32f2f;
}

/* Location Form Styling */
.location-form-container {
    max-width: 500px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

.location-form-container h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.location-form-container .form-group {
    margin-bottom: 15px;
}

.location-form-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.85rem;
}

.location-form-container .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.location-form-container .form-group input:focus {
    outline: none;
    border-color: #4A90E2;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #007ace;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.btn-submit:hover {
    background: #005fa3;
}

#locations-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

/* Centered Form Styling */
.centered-form {
    margin: 0 auto;
    max-width: 500px;
}

/* Location Actions Styling */
.location-actions {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.btn-edit-location {
    flex: 1;
    background: #4A90E2;
    color: white;
    border: 1px solid #357ABD;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-edit-location:hover {
    background: #357ABD;
}

.btn-delete-location {
    flex: 1;
    background: #e63946;
    color: white;
    border: 1px solid #d32f2f;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-delete-location:hover {
    background: #d32f2f;
}

/* Location Form Styling */
.location-form-container {
    max-width: 500px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

.location-form-container h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.location-form-container .form-group {
    margin-bottom: 15px;
}

.location-form-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.85rem;
}

.location-form-container .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.location-form-container .form-group input:focus {
    outline: none;
    border-color: #4A90E2;
}

/* Dealer Form Styling */
.dealer-form-container {
    max-width: 500px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

.dealer-form-container h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.dealer-form-container .form-group {
    margin-bottom: 15px;
}

.dealer-form-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.85rem;
}

.dealer-form-container .form-group input,
.dealer-form-container .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.dealer-form-container .form-group input:focus,
.dealer-form-container .form-group textarea:focus {
    outline: none;
    border-color: #4A90E2;
}

.dealer-form-container .file-help {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #007ace;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.btn-submit:hover {
    background: #005fa3;
}

#locations-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

/* Make business grid full width within location wrapper */
.business-grid {
    width: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

/* Two-column modal layout */
.modal-two-col {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    align-items: start;
}

/* Make the right column look like a panel */
.modal-two-col__notes {
    border-left: 1px solid #e5e5e5;
    padding-left: 16px;
    max-height: 70vh;
    overflow: auto;
}

/* Notes entries (optional polish) */
.modal-two-col__notes .note_entry {
    padding: 10px 12px;
    margin: 0 0 10px 0;
    border-radius: 8px;
    background: #f7f7f7;
}

.modal-two-col__notes .note_entry.public {
    background: #eef7ff;
    border: 1px solid #cfe6ff;
}

.modal-two-col__notes .note_entry.private {
    background: #f7f7f7;
    border: 1px solid #e8e8e8;
}

/* Mobile: stack */
@media (max-width: 768px) {
    .modal-two-col {
        grid-template-columns: 1fr;
    }

    .modal-two-col__notes {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid #e5e5e5;
        padding-top: 16px;
        max-height: none;
    }
}


#note_input_field{
    width: 98%;
    height:75px;
}

#note_type_sel_label,#note_from_sel_label{
    display: inline-block;
}