/* Bill-Vill CRM Design System & Styles */
:root {
    --bg-color: #070913;
    --sidebar-bg: #0c0e1b;
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #7c3aed, #4f46e5);
    --secondary-gradient: linear-gradient(135deg, #ec4899, #8b5cf6);
    --success-color: #10b981;
    --error-color: #f43f5e;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Authentication Screen (Full Screen Glassmorphism) */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, #111428 0%, var(--bg-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.auth-logo {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.auth-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    color: #ffffff;
    padding: 0.9rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.auth-footer-text {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-link {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 100;
}

.sidebar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.sidebar-link.active {
    border-left: 3px solid #7c3aed;
    border-radius: 0 12px 12px 0;
    padding-left: calc(1rem - 3px);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    max-width: 140px;
    overflow: hidden;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.logout-btn:hover {
    color: var(--error-color);
}

.change-password-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.change-password-btn:hover {
    color: #a78bfa;
}

/* Main Dashboard Panel */
.main-panel {
    flex-grow: 1;
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Left Panel: Customer Directory list */
.directory-section {
    width: 380px;
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    background: #080a15;
}

.directory-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #7c3aed;
    background: rgba(255, 255, 255, 0.06);
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.add-cust-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.add-cust-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.customer-list {
    overflow-y: auto;
    flex-grow: 1;
    padding: 1rem;
}

.customer-item {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.customer-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--card-border);
}

.customer-item.active {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.3);
}

.customer-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.customer-biz-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.customer-phone {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.customer-owner {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-ready {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-missing {
    background: rgba(244, 63, 94, 0.15);
    color: var(--error-color);
}

/* Right Panel: Detail view */
.detail-section {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background: #090b16;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    stroke: var(--text-muted);
}

/* Customer Profile Banner */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-info {
    flex-grow: 1;
}

.profile-biz {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.profile-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Grid layout for Catalogue and Secure Distribution */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    flex-grow: 1;
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Distribution Panel details */
.dist-item {
    margin-bottom: 1.25rem;
}

.dist-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.dist-value-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dist-value {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: monospace;
    flex-grow: 1;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secure-link {
    width: 100%;
    background: var(--secondary-gradient);
    border: none;
    color: #ffffff;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-secure-link:hover {
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* Menu catalogue table styling */
.menu-table-container {
    overflow-x: auto;
    max-height: 350px;
}

.menu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.menu-table th {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-table td {
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Catalogue Upload forms */
.catalogue-actions {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.02);
}

.dropzone-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
    stroke: var(--text-secondary);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0f1122;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Notifications toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 17, 34, 0.9);
    border: 1px solid var(--card-border);
    border-left: 4px solid #7c3aed;
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

/* Avatar edit overlay styles */
.profile-avatar-container {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.profile-avatar-container:hover .avatar-edit-overlay {
    opacity: 1;
}

.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.7rem;
    color: #ffffff;
    font-weight: 600;
}

/* Product Catalogue Photo Styles */
.product-thumbnail-container {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-photo-upload-btn {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.product-photo-upload-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.product-thumbnail-container:hover .product-photo-edit-overlay {
    opacity: 1;
}

.product-photo-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #ffffff;
    cursor: pointer;
}

.template-link:hover {
    color: #c084fc !important;
    text-decoration: underline !important;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-container .form-input {
    padding-right: 3rem;
}

.toggle-password-btn {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--text-primary);
}

.toggle-password-btn svg {
    pointer-events: none;
}

