/* ===== CSS Variables ===== */
:root {
    --primary: #2d5a27;
    --primary-light: #4a7c40;
    --primary-dark: #1a3d17;
    --secondary: #f4a024;
    --secondary-light: #ffb84d;
    --accent-red: #e74c3c;
    --accent-orange: #e67e22;
    --accent-green: #27ae60;
    --bg-light: #f8faf5;
    --bg-white: #ffffff;
    --text-dark: #2c3e50;
    --text-medium: #5a6c7d;
    --text-light: #8b9aab;
    --border: #e1e8ed;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Page Management ===== */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

#login-page.active {
    display: flex;
}

.dashboard-page {
    display: none;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-page.active {
    display: block;
}

/* ===== Login Page ===== */
#login-page {
    background: radial-gradient(circle at top, rgba(20, 50, 25, 0.45) 0%, rgba(12, 14, 18, 1) 75%) !important;
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1300px;
    min-height: 700px;
    background: var(--bg-white);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(45, 90, 39, 0.2);
}

.login-left {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.brand {
    position: relative;
    z-index: 1;
}

.logo {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo i {
    font-size: 32px;
    color: var(--primary);
}

.brand-logo {
    width: 60px;
    height: auto;
}

.brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.brand p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.hero-image {
    position: relative;
    z-index: 1;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.hero-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: var(--transition);
}

.hero-image:hover img {
    transform: scale(1.05);
}

.login-right {
    padding: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-container {
    width: 100%;
    max-width: 380px;
}

.login-form-container h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.subtitle {
    color: var(--text-medium);
    margin-bottom: 30px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1);
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.85rem;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* ===== Checkbox ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-label input:checked+.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked+.checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 11px;
}

.checkbox-label.large {
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    font-size: 1rem;
}

.checkbox-label.large.warning {
    background: #fff5f5;
    border-color: #ffcdd2;
}

.checkbox-label.large.warning .checkbox-text i {
    color: var(--accent-red);
    margin-right: 8px;
}

.checkbox-label.large input:checked+.checkmark {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(45, 90, 39, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 39, 0.4);
}

.btn-secondary {
    background: var(--border);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #d1d9e0;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 16px 24px;
    font-size: 1.05rem;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Demo Accounts ===== */
.demo-accounts {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.demo-accounts p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.demo-list {
    display: flex;
    gap: 10px;
}

.demo-tag {
    padding: 8px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-medium);
    cursor: pointer;
    transition: var(--transition);
}

.demo-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== Navigation ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-admin {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d2137 100%);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
}

.nav-brand i {
    font-size: 1.6rem;
    color: var(--secondary);
}

.nav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 5px;
}

.nav-link {
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
    color: white;
}

.user-info span {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.user-info small {
    opacity: 0.8;
    font-size: 0.8rem;
}

/* ===== Page Headers ===== */
.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h2 i {
    color: var(--primary);
}

.page-header p {
    color: var(--text-medium);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== Products Section ===== */
.section-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1), var(--shadow-hover);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.product-badge.green {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.product-badge.orange {
    background: linear-gradient(135deg, #e67e22, #f39c12);
}

.product-badge.red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.product-info {
    padding: 20px;
}

.product-info h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.product-desc {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
}

.kg-options {
    display: flex;
    gap: 10px;
}

.kg-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.kg-btn:hover,
.kg-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* ===== Order Form ===== */
.order-form-section {
    max-width: 700px;
}

.form-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-card h3 {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
}

.form-card h3 i {
    color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.required {
    color: var(--accent-red);
}

.quantity-input {
    display: flex;
    align-items: center;
    max-width: 200px;
}

.quantity-input input {
    text-align: center;
    border-left: none;
    border-right: none;
    border-radius: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.qty-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border);
    background: var(--bg-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.qty-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===== Order Items Cart ===== */
.add-item-section {
    background: #f0f7f0;
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
    border: 2px dashed var(--primary-light);
}

.add-item-section h4 {
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn-group {
    display: flex;
    align-items: flex-end;
}

.btn-add-item {
    background: var(--secondary);
    color: white;
    border: none;
    height: 50px;
    padding: 0 25px;
    font-weight: 600;
}

.btn-add-item:hover {
    background: #e09400;
    transform: translateY(-2px);
}

.order-items-list {
    margin-bottom: 25px;
}

.order-items-list h4 {
    margin-bottom: 15px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-items-list h4 i {
    color: var(--primary);
}

.items-container {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-light);
    text-align: center;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: white;
    transition: var(--transition);
}

.order-item:hover {
    background: #f8fff8;
}

.order-item:last-child {
    border-bottom: none;
}

.item-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.1rem;
}

.item-icon.green {
    background: #d4edda;
    color: #155724;
}

.item-icon.orange {
    background: #fff3cd;
    color: #856404;
}

.item-icon.red {
    background: #f8d7da;
    color: #721c24;
}

.item-details {
    flex: 1;
}

.item-details h5 {
    font-size: 1rem;
    margin-bottom: 3px;
    color: var(--text-dark);
}

.item-details p {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.item-price {
    text-align: right;
    margin-right: 15px;
}

.item-price .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.item-price .unit-price {
    font-size: 0.8rem;
    color: var(--text-light);
}

.item-remove {
    width: 36px;
    height: 36px;
    border: none;
    background: #ffebee;
    color: #d32f2f;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-remove:hover {
    background: #d32f2f;
    color: white;
    transform: scale(1.1);
}

.order-summary {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--radius-sm);
    margin: 25px 0;
}

.order-summary h4 {
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-summary h4 i {
    color: var(--primary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-medium);
}

.summary-row.grand-total {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--primary);
    padding-top: 15px;
    margin-top: 15px;
}

#place-order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Orders List ===== */
.orders-list {
    display: grid;
    gap: 20px;
}

.order-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 25px;
    align-items: center;
    transition: var(--transition);
}

.order-card:hover {
    box-shadow: var(--shadow-hover);
}

.order-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.order-icon.green {
    background: #d4edda;
    color: #155724;
}

.order-icon.orange {
    background: #fff3cd;
    color: #856404;
}

.order-icon.red {
    background: #f8d7da;
    color: #721c24;
}

.order-details h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.order-meta {
    display: flex;
    gap: 20px;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.order-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.order-status {
    text-align: right;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.delivered {
    background: #d4edda;
    color: #155724;
}

.status-badge.replacement {
    background: #f8d7da;
    color: #721c24;
}

.order-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.order-status .btn {
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ===== Feedback Section ===== */
.feedback-section {
    max-width: 900px;
}

.feedback-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.feedback-order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.feedback-order-info h4 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.star-rating {
    display: flex;
    gap: 10px;
    font-size: 2rem;
    color: #ddd;
}

.star-rating i {
    cursor: pointer;
    transition: var(--transition);
}

.star-rating i:hover,
.star-rating i.active {
    color: var(--secondary);
}

.star-rating i.fas {
    color: var(--secondary);
}

/* ===== Admin Layouts ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: var(--bg-white);
    padding: 20px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header-content h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.header-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Clearer separation for admin views */
.admin-view {
    display: none;
}

.admin-view.active {
    display: block;
}

/* Adjustments for data table responsiveness */
.table-container {
    overflow-x: auto;
}

/* ===== Admin Tables ===== */
.clients-table-container,
.orders-table-container {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-filters {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.table-filters select {
    padding: 12px 40px 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    background: white;
    min-width: 180px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(45, 90, 39, 0.03);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-edit {
    background: #fff3e0;
    color: #f57c00;
}

.btn-delete {
    background: #ffebee;
    color: #d32f2f;
}

.table-actions button:hover {
    transform: scale(1.1);
}

/* ===== Replacements ===== */
.replacements-list {
    display: grid;
    gap: 20px;
}

.replacement-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--accent-red);
}

.replacement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.replacement-header h4 {
    color: var(--accent-red);
    display: flex;
    align-items: center;
    gap: 10px;
}

.replacement-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.replacement-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.replacement-details p {
    font-size: 0.9rem;
}

.replacement-details strong {
    color: var(--text-medium);
    display: block;
    font-size: 0.8rem;
    margin-bottom: 3px;
}

.replacement-reason {
    padding: 15px;
    background: #fff5f5;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.replacement-reason strong {
    color: var(--accent-red);
    display: block;
    margin-bottom: 5px;
}

.replacement-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--accent-red);
}

.modal form {
    padding: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.toast.active {
    transform: translateX(0);
}

.toast i {
    font-size: 1.3rem;
}

/* ===== Invoice ===== */
.invoice-modal .modal-content {
    max-width: 900px;
    background: #f5f5f5;
    padding: 0;
}

.invoice-actions-top {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--border);
    justify-content: flex-end;
    position: sticky;
    top: 0;
    z-index: 10;
}

.invoice-container {
    background: white;
    margin: 20px;
    padding: 50px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 800px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--primary);
}

.invoice-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.invoice-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.invoice-company h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.invoice-company p {
    color: var(--text-medium);
    font-size: 0.95rem;
}

.invoice-title {
    text-align: right;
}

.invoice-logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.invoice-logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.invoice-title h1 {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.invoice-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.invoice-from h4,
.invoice-to h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.invoice-from p,
.invoice-to p {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin-bottom: 5px;
}

.invoice-from strong,
.invoice-to strong {
    color: var(--text-dark);
    font-size: 1.1rem;
}

.invoice-meta {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-sm);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.meta-item span {
    color: var(--text-medium);
}

.meta-item strong {
    color: var(--text-dark);
}

.meta-item.status strong {
    color: var(--accent-green);
    font-size: 1.1rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-table thead {
    background: var(--primary);
    color: white;
}

.invoice-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-table th:last-child,
.invoice-table td:last-child {
    text-align: right;
}

.invoice-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.invoice-table tbody tr:hover {
    background: var(--bg-light);
}

.invoice-summary {
    width: 350px;
    margin-left: auto;
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--radius-sm);
    margin-bottom: 40px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-medium);
}

.summary-row.discount {
    color: var(--accent-red);
}

.summary-row.grand-total {
    border-top: 2px solid var(--primary);
    padding-top: 15px;
    margin-top: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.invoice-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.payment-info,
.invoice-notes {
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.payment-info h4,
.invoice-notes h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-info p,
.invoice-notes p {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 5px;
}

.invoice-stamp {
    position: absolute;
    top: 50%;
    right: 80px;
    transform: translateY(-50%) rotate(-15deg);
    opacity: 0.7;
}

.stamp {
    width: 140px;
    height: 140px;
    border: 4px solid var(--accent-green);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
    font-weight: 700;
    font-size: 1.2rem;
}

.stamp i {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.invoice-terms {
    margin-top: 30px;
    padding: 15px;
    background: #fff9e6;
    border-left: 4px solid var(--secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.invoice-terms p {
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* Print styles for invoice */
@media print {
    .invoice-modal {
        position: static;
        display: block;
        background: white;
    }

    .invoice-actions-top {
        display: none;
    }

    .invoice-container {
        margin: 0;
        box-shadow: none;
        padding: 30px;
    }

    .invoice-stamp {
        opacity: 1;
    }
}

/* Invoice Responsive */
@media (max-width: 768px) {
    .invoice-container {
        padding: 25px;
        margin: 10px;
    }

    .invoice-header {
        flex-direction: column;
        gap: 20px;
    }

    .invoice-title {
        text-align: left;
    }

    .invoice-details {
        grid-template-columns: 1fr;
    }

    .invoice-table {
        font-size: 0.85rem;
    }

    .invoice-table th,
    .invoice-table td {
        padding: 10px;
    }

    .invoice-summary {
        width: 100%;
    }

    .invoice-footer {
        grid-template-columns: 1fr;
    }

    .invoice-stamp {
        display: none !important;
    }

    .invoice-actions-top {
        flex-wrap: wrap;
        justify-content: center;
    }

    .invoice-actions-top .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* ===== Reports & Analytics Dashboard ===== */
.reports-main-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 25px;
}

.chart-card {
    padding: 24px;
    height: 100%;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.table-card {
    padding: 24px;
}

.small-table th,
.small-table td {
    padding: 12px 15px;
    font-size: 0.9rem;
}

.report-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-medium);
}

.master-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-hint {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-light);
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Revenue Stat Card Colors */
.stat-icon.revenue {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.stat-icon.orders {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.stat-icon.replacements {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
}

.stat-icon.pending {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

@media (max-width: 1100px) {
    .reports-main-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Executive Geographic Sales Dashboard ===== */
.geo-dashboard-card {
    padding: 0;
    overflow: hidden;
}

.geo-dashboard-card > .card-header {
    padding: 20px 24px;
    margin-bottom: 0;
}

.geo-dashboard {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    min-height: 480px;
}

.geo-map-panel {
    padding: 20px;
    background: linear-gradient(135deg, #f8faf8 0%, #eef3ee 100%);
    border-right: 1px solid var(--border);
}

.geo-map {
    width: 100%;
    height: auto;
    max-height: 420px;
}

.geo-province {
    fill: #c8e6c9;
    stroke: #fff;
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.3s, transform 0.2s, filter 0.3s;
}

.geo-province:hover {
    filter: brightness(1.15) drop-shadow(0 2px 6px rgba(0,0,0,0.2));
    stroke: #2d5a27;
    stroke-width: 3;
}

.geo-label {
    font-size: 13px;
    font-weight: 600;
    fill: #1a3a15;
    text-anchor: middle;
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
}

.geo-label-sm {
    font-size: 11px;
}

/* Legend */
.geo-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    font-size: 0.8rem;
}

.geo-legend-title {
    font-weight: 600;
    color: var(--text-medium);
    white-space: nowrap;
}

.geo-legend-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-light);
}

.geo-gradient-bar {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #e8f5e9, #81c784, #388e3c, #1b5e20);
}

/* Breadcrumbs */
.geo-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.geo-crumb {
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.geo-crumb:hover {
    color: var(--primary);
    background: var(--bg-light);
}

.geo-crumb.active {
    color: var(--primary);
    font-weight: 600;
}

.geo-crumb + .geo-crumb::before {
    content: '›';
    margin-right: 6px;
    color: var(--text-light);
    font-weight: 300;
}

/* KPI Side Panel */
.geo-kpi-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.geo-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.geo-kpi-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.geo-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.geo-kpi-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.geo-kpi-card h4 {
    margin: 2px 0 0;
    font-size: 1.2rem;
    color: var(--text-dark);
}

/* Province Rankings */
.geo-ranking {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.geo-ranking h5 {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.geo-ranking h5 i {
    color: var(--primary);
}

.geo-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.geo-rank-pos {
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.geo-rank-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

.geo-rank-bar-wrap {
    flex: 1.5;
    height: 8px;
    background: #e8f5e9;
    border-radius: 4px;
    overflow: hidden;
}

.geo-rank-bar {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #2e7d32);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.geo-rank-value {
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
    text-align: right;
}

/* Province Detail (Level 2) */
.geo-province-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.geo-province-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.geo-routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.geo-route-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.geo-route-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 4px 0 0 4px;
}

.geo-route-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.geo-route-card h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.geo-route-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-medium);
    margin-bottom: 4px;
}

.geo-route-stat strong {
    color: var(--primary);
}

/* Date Range Filter Pills */
.geo-date-filters {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    padding: 3px;
}

.geo-date-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.geo-date-btn:hover {
    background: rgba(39,174,96,0.1);
    color: #27ae60;
}

.geo-date-btn.active {
    background: #27ae60;
    color: #fff;
    box-shadow: 0 2px 6px rgba(39,174,96,0.3);
}

/* Toggle Switch */
.geo-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.geo-toggle input {
    display: none;
}

.geo-toggle-slider {
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    transition: background 0.3s;
}

.geo-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.geo-toggle input:checked + .geo-toggle-slider {
    background: var(--primary, #27ae60);
}

.geo-toggle input:checked + .geo-toggle-slider::after {
    transform: translateX(18px);
}

.geo-toggle-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    white-space: nowrap;
}

/* Fullscreen Mode */
.geo-dashboard-card.geo-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow-y: auto;
    animation: geoFadeIn 0.3s ease;
}

.geo-dashboard-card.geo-fullscreen .geo-map-panel #geo-map-l1,
.geo-dashboard-card.geo-fullscreen .geo-map-panel #geo-map-l2 {
    height: calc(100vh - 220px) !important;
}

.geo-dashboard-card.geo-fullscreen .geo-dashboard {
    height: calc(100vh - 80px);
}

@keyframes geoFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Leaflet Tooltip Customization */
.geo-tooltip {
    font-family: 'Poppins', sans-serif !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    border: 1px solid #e0e0e0 !important;
}

.geo-tooltip .leaflet-tooltip-content { 
    margin: 0; 
}

/* Fix Leaflet z-index conflicts */
.geo-map-panel .leaflet-container {
    z-index: 1 !important;
}

/* Level 3: Route Detail */
.geo-route-detail {
    padding: 5px;
}

/* Responsive */
@media (max-width: 900px) {
    .geo-dashboard {
        grid-template-columns: 1fr;
    }
    .geo-map-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* ===== Report Tab System ===== */
.report-tabs-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.report-tab-btn {
    border: none;
    background: transparent;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-medium);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
}

.report-tab-btn:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.report-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(45, 90, 39, 0.05);
}

.report-tab-content {
    display: none;
}

.report-tab-content.active {
    display: block !important;
}


/* ===== Settings Module Styles ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.settings-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    align-items: flex-start;
}

.settings-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.settings-icon.integration {
    background: #e3f2fd;
    color: #1976d2;
}

.settings-info {
    flex-grow: 1;
}

.settings-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.settings-info p {
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.card.warning {
    border-left: 4px solid var(--accent-orange);
}

.full-width-card {
    grid-column: 1 / -1;
}

.printable-table {
    overflow-x: auto;
}

.printable-table table {
    min-width: 1000px;
    /* Force scroll for operational detail */
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.overlay-content {
    text-align: center;
    max-width: 400px;
}

.overlay-content i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-light);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border);
}

/* Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    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;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.stock-item-card {
    background: var(--bg-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
}

.stock-item-card h4 {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.stock-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
    color: var(--text-dark);
}

.stock-value.low {
    color: var(--accent-orange);
}

.stock-value.out {
    color: var(--accent-red);
}

@media (max-width: 768px) {
    .module-overlay {
        top: 150px;
    }
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .login-left {
        display: none;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 15px;
    }

    .nav-links {
        order: 3;
        width: 100%;
        margin-top: 15px;
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .order-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .order-icon {
        margin: 0 auto;
    }

    .order-meta {
        justify-content: center;
    }

    .order-status {
        text-align: center;
    }

    .table-filters {
        flex-direction: column;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .dashboard-page {
        padding: 15px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .form-card {
        padding: 20px;
    }

    .modal-content {
        margin: 10px;
    }
}

/* ===== Account Card (Linking Features) ===== */
.account-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: var(--shadow);
    animation: fadeInDown 0.6s ease-out;
}

.account-card i {
    font-size: 2.2rem;
    color: var(--primary);
    background: white;
    padding: 18px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-details label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-light);
    font-weight: 700;
}

.account-details strong {
    font-size: 1.4rem;
    color: var(--primary-dark);
}

.account-details p {
    margin: 0;
    color: var(--text-medium);
    font-size: 1rem;
}

.account-details small {
    color: var(--text-light);
    font-size: 0.9rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Dashboard Enhanced Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-icon.orders {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.stat-icon.replacements {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.stat-icon.pending {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.stat-info .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up {
    color: var(--accent-green);
}

.stat-trend.down {
    color: var(--accent-orange);
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-light);
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary);
}

.view-all {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.trend-list,
.sync-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trend-item,
.sync-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.trend-item:hover,
.sync-item:hover {
    background: #f0f4f8;
}

.trend-info,
.sync-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trend-name h4,
.sync-name h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.trend-name p,
.sync-name p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.trend-value {
    font-weight: 700;
    color: var(--text-dark);
}

.sync-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.sync-status.ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.sync-status.warning {
    background: #fff3e0;
    color: #ef6c00;
}

.sync-status.error {
    background: #ffebee;
    color: #c62828;
}
/* ===== WS5: Smart Product Search Bar ===== */
.product-search-bar {
    position: relative;
    margin-bottom: 1.25rem;
}
.product-search-bar__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.95rem;
    pointer-events: none;
}
.product-search-bar__input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.product-search-bar__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.12);
}
.product-search-bar__input::placeholder {
    color: var(--text-light);
}

/* ===== WS5: Quick Reorder Button ===== */
.btn-reorder {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-reorder:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(45, 90, 39, 0.3);
}
.btn-reorder i {
    font-size: 0.75rem;
}

/* ===== WS5: Order Status Timeline ===== */
.order-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-top: 0.75rem;
    padding: 0.5rem 0;
}
.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    text-align: center;
}
.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}
.timeline-step--done:not(:last-child)::after {
    background: var(--accent-green);
}
.timeline-step--active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--primary) 50%, #e0e0e0 50%);
}
.timeline-step__dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    z-index: 1;
    background: #e0e0e0;
    color: #999;
    transition: all 0.3s;
}
.timeline-step--done .timeline-step__dot {
    background: var(--accent-green);
    color: white;
}
.timeline-step--active .timeline-step__dot {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.2);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(45, 90, 39, 0.08); }
}
.timeline-step__label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #999;
    margin-top: 4px;
    white-space: nowrap;
}
.timeline-step--done .timeline-step__label {
    color: var(--accent-green);
}
.timeline-step--active .timeline-step__label {
    color: var(--primary);
    font-weight: 700;
}

/* ==================== PayFast Settings Card ==================== */
.payfast-settings-card {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid rgba(39,174,96,0.15);
}

.payfast-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: #fff;
}

.payfast-card-header p { color: rgba(255,255,255,0.85); }

.payfast-icon {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

.payfast-card-body {
    padding: 24px 28px;
}

.payfast-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.payfast-field-full { grid-column: 1 / -1; }

.payfast-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.payfast-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid rgba(39,174,96,0.2);
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--bg, #f9fafb);
    color: var(--text-primary, #333);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.payfast-field input:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39,174,96,0.12);
    background: #fff;
}

.payfast-field input::placeholder {
    color: #bbb;
    font-style: italic;
}

.payfast-env-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

@media (max-width: 600px) {
    .payfast-form-grid { grid-template-columns: 1fr; }
    .payfast-env-row { flex-direction: column; gap: 12px; align-items: flex-start; }
    .payfast-card-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ==================== Payment Modal ==================== */
.payment-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.payment-modal {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.payment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #2d5a27 0%, #27ae60 100%);
    color: #fff;
}

.payment-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.payment-modal-close:hover { opacity: 1; }

.payment-modal-body {
    padding: 24px;
}

.payment-order-summary {
    background: rgba(39,174,96,0.06);
    border: 1px solid rgba(39,174,96,0.15);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.88rem;
}

.payment-order-summary .summary-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: #27ae60;
    margin-top: 6px;
}

.payment-option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    text-align: left;
}

.payment-option-btn:hover {
    border-color: #27ae60;
    box-shadow: 0 4px 12px rgba(39,174,96,0.15);
    transform: translateY(-1px);
}

.payment-option-btn.pay-now .payment-option-icon {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
}

.payment-option-btn.pay-account .payment-option-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

.payment-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.payment-option-info {
    flex: 1;
}

.payment-option-info strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.payment-option-info small {
    color: var(--text-secondary, #888);
    font-size: 0.8rem;
}

.payment-option-btn > .fa-chevron-right {
    color: #ccc;
    font-size: 0.9rem;
}

.arrears-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.arrears-alert > i {
    color: #e65100;
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.arrears-alert strong {
    color: #e65100;
    font-size: 0.95rem;
}

.arrears-alert p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #6d4c41;
}

/* ===== Native App Mode (Capacitor) ===== */
.native-app #admin-dashboard,
.native-app .admin-header,
.native-app .admin-nav-link,
.native-app .admin-only {
    display: none !important;
}

.native-app {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.native-app .header {
    padding-top: calc(env(safe-area-inset-top) + 8px);
}

/* ===== Delivery Day Restriction Popup ===== */
.dd-day-badge {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    min-width: 80px;
}

/* ===== WhatsApp Order Entry ===== */
.wa-entry-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.wa-entry-card, .wa-recent-card {
    padding: 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.wa-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    font-size: 1rem;
}

.wa-card-header i {
    font-size: 1.4rem;
}

.wa-card-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.wa-entry-card form {
    padding: 24px;
}

.wa-customer-meta {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
    min-height: 18px;
}

/* WhatsApp Product Quick-Pick Grid */
.wa-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.wa-product-btn {
    padding: 10px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

.wa-product-btn:hover {
    border-color: #25D366;
    background: #e8f8f0;
    transform: translateY(-1px);
}

.wa-product-btn .wa-prod-type {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.wa-product-btn .wa-prod-price {
    display: block;
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 700;
}

/* WhatsApp Items List */
.wa-items-list {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.wa-empty-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.wa-empty-cart i {
    font-size: 1.2rem;
}

.wa-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.wa-item-row:last-child {
    border-bottom: none;
}

.wa-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.wa-item-info .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wa-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wa-item-qty button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.wa-item-qty button:hover {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

.wa-item-total {
    font-weight: 700;
    color: var(--primary);
    min-width: 65px;
    text-align: right;
}

.wa-item-remove {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    margin-left: 6px;
    transition: var(--transition);
}

.wa-item-remove:hover {
    transform: scale(1.2);
}

/* WhatsApp Order Summary */
.wa-order-summary {
    background: #f0f7f0;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #c8e6c9;
}

.wa-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.wa-summary-row.wa-total {
    border-top: 2px solid var(--primary);
    margin-top: 8px;
    padding-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* WhatsApp Submit Button */
.wa-submit-btn {
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
    font-size: 1.05rem !important;
    padding: 14px 24px !important;
}

.wa-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
}

.wa-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* WhatsApp Stats Bar */
.wa-stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
}

.wa-stat {
    text-align: center;
}

.wa-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #25D366;
}

.wa-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* WhatsApp Recent Orders */
.wa-recent-card .table-container {
    max-height: 400px;
    overflow-y: auto;
}

/* Source Badge (Master Order Log) */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.source-badge.source-whatsapp {
    background: #dcf8c6;
    color: #075e54;
}

.source-badge.source-web {
    background: #e3f2fd;
    color: #1565c0;
}

.source-badge.source-app {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* ===== Telephonic Orders Source Badge ===== */
.source-badge.source-telephonic {
    background: #ede7f6;
    color: #4527a0;
}

/* ===== Telephonic Settings Card ===== */
.telephonic-card-header {
    background: linear-gradient(135deg, #663399, #4B0082) !important;
}

.telephonic-activation-gate {
    text-align: center;
    padding: 30px 20px;
    border: 2px dashed rgba(102, 51, 153, 0.25);
    border-radius: 12px;
    background: rgba(102, 51, 153, 0.03);
}

.telephonic-lock-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #663399, #4B0082);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 14px;
    animation: telephonic-pulse 2s ease-in-out infinite;
}

@keyframes telephonic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 51, 153, 0.3); }
    50% { box-shadow: 0 0 0 12px rgba(102, 51, 153, 0); }
}

/* Responsive */
@media (max-width: 900px) {
    .wa-entry-layout {
        grid-template-columns: 1fr;
    }
}

/* ===== Login Hero Video ===== */
.hero-video-elem {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: var(--radius);
    transition: var(--transition);
}

.hero-image:hover .hero-video-elem {
    transform: scale(1.03);
}

/* ===== Client Onboarding Process Flow Modal ===== */
#onboardingWizardModal.modal.onboarding-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

#onboardingWizardModal.modal.onboarding-modal.active {
    display: flex !important;
}

.onboarding-modal-content {
    background: #ffffff !important;
    width: 94% !important;
    max-width: 780px !important;
    max-height: 90vh !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    margin: 0 auto !important;
}

/* Onboarding Header */
.onboarding-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.onboarding-header-title {
    flex: 1;
}

.onboarding-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.onboarding-badge i {
    font-size: 0.8rem;
}

.onboarding-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.onboarding-header p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* Onboarding Stepper Progress Bar */
.onboarding-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    gap: 0;
    flex-shrink: 0;
    overflow-x: auto;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: #e2e8f0;
    color: #64748b;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.step-item.completed .step-circle {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: #10b981;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    white-space: nowrap;
}

.step-item.active .step-label {
    color: #6366f1;
    font-weight: 700;
}

.step-item.completed .step-label {
    color: #10b981;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    min-width: 20px;
    margin: 0 4px;
    margin-bottom: 20px;
}

.step-item.completed + .step-line,
.step-line:has(+ .step-item.active) {
    background: #6366f1;
}

/* Onboarding Body */
.onboarding-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    min-height: 300px;
}

.onboarding-step-pane {
    display: none;
}

.onboarding-step-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-pane-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.step-pane-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-pane-header h3 i {
    color: #6366f1;
}

.step-pane-header p {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin: 0;
}

/* Onboarding Form Grid */
.onboarding-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.onboarding-form-grid .span-2 {
    grid-column: span 2;
}

/* Color Picker Row */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-row input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.color-picker-row input[type="text"] {
    flex: 1;
}

/* Category Manager */
.category-manager-box {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.add-cat-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 12px;
}

.cat-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    color: #4338ca;
    font-size: 0.82rem;
    font-weight: 600;
}

.cat-del {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.75rem;
}

.cat-del:hover {
    opacity: 1;
    color: #dc2626;
}

/* CSV Upload Zone */
.csv-upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.csv-upload-dropzone:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.drop-icon {
    font-size: 2rem;
    color: #6366f1;
    margin-bottom: 10px;
}

.csv-actions-bar {
    display: flex;
    gap: 10px;
    margin: 14px 0;
    flex-wrap: wrap;
}

.csv-status-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}

.csv-status-box.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.csv-status-box.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.csv-table-preview {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 12px;
}

/* Pricing Setup Grid */
.pricing-setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Dual Input */
.dual-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Routes & Activation Grid */
.routes-activation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Activation Summary Card */
.activation-summary-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.activation-btn-box {
    text-align: center;
    margin-top: 20px;
}

/* Onboarding Checklist */
.ob-checklist {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.ob-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-weight: 500;
    font-size: 0.95rem;
}

.ob-checklist li i.check-on {
    color: var(--accent-green);
    font-size: 1.1rem;
}

/* Info Guide Button System */
.info-guide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.15));
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-guide-btn:hover {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.info-guide-btn i {
    font-size: 0.85rem;
}

/* Widget Info Icon Button */
.widget-info-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    margin-left: 8px !important;
    transition: all 0.2s ease !important;
    vertical-align: middle !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4) !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.widget-info-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9) !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.6) !important;
    transform: scale(1.2) !important;
}

/* Info Guide Modal */
#info-guide-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

#info-guide-modal.active {
    display: flex !important;
}

.info-guide-content {
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: guideModalIn 0.25s ease-out;
}

@keyframes guideModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.info-guide-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-guide-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-guide-header-title i {
    font-size: 1.4rem;
    color: #38bdf8;
}

.info-guide-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.info-guide-header p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

.info-guide-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.info-guide-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.info-guide-body {
    padding: 24px;
    overflow-y: auto;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-step-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    display: flex;
    gap: 14px;
}

.info-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-step-details h5 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.info-step-details p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
}

.info-guide-footer {
    padding: 16px 24px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

/* Onboarding Footer Controls */
.onboarding-footer {
    background: #f8fafc;
    padding: 16px 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ob-footer-right {
    display: flex;
    gap: 12px;
}

/* Geo Toggle */
.geo-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.geo-toggle input { display: none; }

.geo-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}

.geo-toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.geo-toggle input:checked + .geo-toggle-slider {
    background: #10b981;
}

.geo-toggle input:checked + .geo-toggle-slider:before {
    transform: translateX(20px);
}

.geo-toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-medium);
}

/* Standalone Registration Page Styles */
#registration-page .form-input,
#registration-page .form-select,
#registration-page input,
#registration-page select,
#registration-page textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
    box-shadow: none !important;
}

#registration-page .form-input:focus,
#registration-page .form-select:focus,
#registration-page input:focus,
#registration-page select:focus,
#registration-page textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12) !important;
    outline: none !important;
}

#registration-page .form-label {
    color: #334155 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    margin-bottom: 6px !important;
    display: block !important;
}

/* SaaS Marketing Landing Page Responsive Nav */
@media (max-width: 992px) {
    .saas-navbar {
        padding: 12px 20px !important;
    }

    .saas-mobile-menu-btn {
        display: block !important;
    }

    .saas-nav-links {
        display: none !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 16px 0 8px 0 !important;
        gap: 12px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-top: 10px !important;
    }

    .saas-nav-links.active {
        display: flex !important;
    }

    .saas-nav-links a,
    .saas-nav-links button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
}

/* Onboarding Responsive */
@media (max-width: 768px) {
    .onboarding-form-grid,
    .pricing-setup-grid,
    .routes-activation-grid {
        grid-template-columns: 1fr;
    }
    .onboarding-form-grid .span-2 {
        grid-column: span 1;
    }
    .add-cat-row {
        grid-template-columns: 1fr;
    }
    .onboarding-stepper {
        padding: 12px 16px;
        gap: 0;
    }
    .step-item {
        min-width: 50px;
    }
    .step-label {
        font-size: 0.6rem;
    }
    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

/* Utility Classes */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.p-3 { padding: 16px; }
.text-muted { color: var(--text-light); }
