﻿:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 350px;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-container {
    padding: 20px;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border-color);
}

#searchInput {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-filters {
    margin-top: 12px;
}

#brandFilter {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.color-item {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-item:hover {
    background: var(--surface);
    transform: translateX(4px);
}

.color-item.selected {
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.color-swatch {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-info {
    flex: 1;
}

.color-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.color-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.app-header-brand h1 {
    color: #F77C26;
}

.logo-qr {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff8f0 0%, #fffaf5 100%);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

.logo-qr:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
}

.qr-pattern {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    height: 100%;
}

.qr-row {
    display: flex;
    gap: 2px;
    flex: 1;
}

.qr-block {
    flex: 1;
    border-radius: 2px;
    transition: all 0.3s;
}

.qr-block.filled-orange {
    background: linear-gradient(135deg, #ff9800, #ff6b00);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.qr-block.filled-yellow {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.qr-block.empty {
    background: white;
    border: 1px solid #ffe0b2;
}

header h1 {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 18px;
}

.color-display {
    background: var(--surface);
    border-radius: 24px;
    padding: 40px;
    min-width: 500px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.no-selection {
    text-align: center;
    color: var(--text-secondary);
}

.no-selection svg {
    stroke-width: 1.5;
    margin-bottom: 20px;
    opacity: 0.5;
}

.selected-color {
    width: 100%;
    text-align: center;
}

.large-swatch {
    width: 250px;
    height: 250px;
    border-radius: 20px;
    margin: 0 auto 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.color-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.detail-item {
    text-align: left;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface-light);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.btn svg {
    stroke-width: 2;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--surface-light);
}

.btn-secondary:hover {
    background: var(--surface);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 80%;
    max-width: 500px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-primary);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.color-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid var(--border-color);
}

/* Login / Auth styles */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.login-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 16px;
    padding: 32px;
    width: 420px;
    box-shadow: 0 20px 40px rgba(2,6,23,0.6);
    border: 1px solid rgba(255,255,255,0.03);
}

.login-card .form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.login-card .mb-3 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-card .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 44px;
}

.login-card .form-control::placeholder {
    color: rgba(241,245,249,0.35);
}

/* Remember-me alignment */
.login-card .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start; /* force left alignment */
    margin: 0; /* remove default spacing */
    padding: 0; /* align with other form controls */
    width: 100%;
}

.login-card .form-check-label {
    margin: 0; /* ensure label sits next to checkbox */
    color: var(--text-secondary);
    font-weight: 500;
}

/* Make sure the checkbox sits exactly where inputs start */
.login-card {
    --card-inner-padding-left: 0px; /* fallback, used below if needed */
}

/* If inputs have inner padding, ensure checkbox aligns with their left edge */
.login-card .form-control,
.login-card .form-check {
    box-sizing: border-box;
}

/* External login buttons consistent height */
.external-login .btn {
    min-width: 140px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Small responsive tweak */
@media (max-width: 480px) {
    .login-card {
        width: 100%;
        padding: 20px;
    }
}

/* Register page small tweaks */
.login-card .login-header h2 {
    font-size: 20px;
}

.login-card .btn-primary {
    margin-top: 6px;
}

/* Top Header Bar Styles - White Banner */
.top-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #ffffff;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    height: 70px;
    width: auto;
}

.header-brand-name {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 8px;
}

/* Update btn-icon for white background */
.top-header-bar .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.top-header-bar .btn-icon:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
    transform: scale(1.05);
}

.top-header-bar .btn-icon svg {
    stroke: currentColor;
}

/* Adjust container to account for fixed header */
.container {
    margin-top: 70px;
    height: calc(100vh - 70px);
}

/* Profile Dropdown */
.profile-dropdown {
    position: fixed;
    top: 75px;
    right: 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 260px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-dropdown-content {
    padding: 16px;
}

.profile-info {
    margin-bottom: 12px;
}

.profile-name {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-email {
    color: #6b7280;
    font-size: 13px;
}

.profile-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 12px 0;
}

.profile-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.profile-menu-item:hover {
    background: #f3f4f6;
    color: #ef4444;
}

.profile-menu-item svg {
    flex-shrink: 0;
    stroke: currentColor;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-header-bar {
        padding: 0 16px;
    }

    .header-brand-name {
        display: none;
    }

    .user-name {
        display: none;
    }

    .profile-dropdown {
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* Search Button Icon Only */
.btn-icon-only {
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    color: white;
    min-width: 48px;
    min-height: 48px;
}

.btn-icon-only:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-icon-only svg {
    stroke-width: 2;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.search-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

    .search-tab:hover {
        color: var(--text-primary);
    }

    .search-tab.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

.search-tab-content {
    display: none;
    margin-bottom: 20px;
}

    .search-tab-content.active {
        display: block;
    }

/* Print Records Results */
.print-records-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.print-record-item {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

    .print-record-item:hover {
        background: var(--surface);
        transform: translateX(4px);
        border-color: var(--primary-color);
    }

.print-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.print-record-color {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.print-record-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.print-record-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 13px;
}

.print-record-detail {
    display: flex;
    flex-direction: column;
}

.print-record-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.print-record-value {
    color: var(--text-primary);
    font-weight: 500;
}

.no-results-found {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: 14px;
}

.search-loading {
    text-align: center;
    color: var(--primary-color);
    padding: 40px 20px;
    font-size: 14px;
}

.loading {
    color: var(--primary-color);
}

.error {
    color: #dc3545;
}

.load-more-btn {
    width: calc(100% - 24px);
    margin: 12px;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

    .load-more-btn:hover {
        background: var(--primary-hover);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

.colors-count {
    text-align: center;
    color: var(--text-secondary);
    padding: 12px;
    font-size: 13px;
    font-style: italic;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.print-customer-info {
    margin: 16px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

    .print-customer-info h4 {
        margin: 0 0 8px 0;
        font-size: 14px;
        color: var(--primary-color);
        font-weight: 600;
    }

    .print-customer-info p {
        margin: 4px 0;
        font-size: 12px;
        line-height: 1.4;
    }

#qrcode {
    display: none;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

    #qrcode canvas {
        display: block;
        margin: 0 auto;
    }

    #qrcode img {
        display: block;
        margin: 0 auto;
    }

.form-error {
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #c00;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.form-error::before {
    content: '⚠ ';
    font-weight: bold;
}

/* Input with button wrapper for search */
.input-with-button {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-with-button input {
        flex: 1;
        padding-right: 45px; /* Make room for the button */
    }

/* Search icon button positioned at the end of input */
.btn-search-icon {
    position: absolute;
    right: 5px;
    background: #2F397B;
    border: none;
    border-radius: 4px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
}

    .btn-search-icon:hover {
        background: #FF7F27;
    }

    .btn-search-icon:active {
        transform: scale(0.95);
    }

    .btn-search-icon svg {
        stroke: white;
    }

/* Standalone search button for date search */
.btn-search-icon-standalone {
    background: #2F397B;
    border: none;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
    margin-top: 10px;
}

.btn-search-icon-standalone:hover {
    background: #FF7F27;
}

.btn-search-icon-standalone:active {
    transform: scale(0.95);
}

.btn-search-icon-standalone svg {
    stroke: white;
}

/* Quantity Input Wrapper */
.quantity-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 180px;
}

    .quantity-input-wrapper input[type="number"] {
        flex: 1;
        text-align: center;
        font-size: 16px;
        font-weight: 600;
        padding: 10px 8px;
        -moz-appearance: textfield; /* Firefox */
    }

        .quantity-input-wrapper input[type="number"]::-webkit-outer-spin-button,
        .quantity-input-wrapper input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

    .qty-btn:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
        transform: scale(1.05);
    }

    .qty-btn:active {
        transform: scale(0.95);
    }

    .qty-btn svg {
        stroke: currentColor;
    }

    .qty-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
    }