/* Marmex - Styles */

/* ==================== */
/* LAYOUT SIDEBAR       */
/* ==================== */
body {
    background-color: #f5f5f5;
    min-height: 100vh;
    margin: 0;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: #1a1a2e;
    color: #c8c8d4;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
}

.sidebar-brand:hover {
    color: #e0e0ff;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #a0a0b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #e0e0ff;
}

.sidebar-link.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-weight: 600;
}

.sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #8888a0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
}

.top-bar {
    height: 56px;
    min-height: 56px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-area {
    padding: 24px;
    flex: 1;
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #333;
}

/* Responsive : sidebar collapse */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* ==================== */
/* CARDS & TABLES       */
/* ==================== */
.card.shadow {
    border: none;
    border-radius: 8px;
}

.table th {
    white-space: nowrap;
}

.btn-sm {
    margin-right: 4px;
}

/* ==================== */
/* IMAGE THUMBNAILS     */
/* ==================== */
.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.product-thumb:hover {
    opacity: 0.8;
}

.product-thumb-sm {
    width: 25px;
    height: 25px;
    object-fit: cover;
    border-radius: 3px;
    vertical-align: middle;
    cursor: pointer;
    transition: opacity 0.2s;
}

.product-thumb-sm:hover {
    opacity: 0.8;
}

.edit-image-preview {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: opacity 0.2s;
}

.edit-image-preview:hover {
    opacity: 0.8;
}

/* Overlay zoom (JS-driven) */
.img-zoom-overlay {
    position: fixed;
    z-index: 99999;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    border: 3px solid #fff;
    pointer-events: none;
    animation: zoomIn 0.2s ease;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

/* ==================== */
/* PRICE GRID (legacy)  */
/* ==================== */
.price-grid .sticky-col {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 1;
    min-width: 180px;
}

.price-grid thead .sticky-col {
    background-color: #212529;
    z-index: 2;
}

.price-input {
    width: 90px;
    min-width: 70px;
}

.price-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

.price-input::placeholder {
    color: #ccc;
    text-align: center;
}

/* ==================== */
/* DEVIS - Barre etapes */
/* ==================== */
.step-bar {
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #aaa;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.step-item.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.step-item.done {
    color: #198754;
}

.step-item.active {
    color: #fff;
    background: #0d6efd;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid currentColor;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-item.active .step-number {
    border-color: #fff;
    background: rgba(255,255,255,0.2);
}

.step-item.done .step-number {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

/* ==================== */
/* DEVIS - Materiaux    */
/* ==================== */
.material-card {
    border: 3px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.material-card:hover {
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.material-card.selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.material-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.material-img-placeholder {
    width: 100%;
    height: 120px;
    background: #e9ecef;
}

.material-name {
    padding: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ==================== */
/* DEVIS - Epaisseur    */
/* ==================== */
.thickness-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 15px 25px;
    border: 3px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.thickness-option:hover {
    border-color: #0d6efd;
    background: #f0f6ff;
}

.thickness-option.selected {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
}

.thickness-option.selected small {
    opacity: 1 !important;
    color: rgba(255,255,255,0.85) !important;
}

/* ==================== */
/* DEVIS - Etape 6 Bords */
/* ==================== */
.border-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
}

.border-top-check,
.border-bottom-check {
    text-align: center;
}

.border-middle-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.border-left-check,
.border-right-check {
    text-align: center;
}

.border-piece-visual {
    border: 3px solid #495057;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.border-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.border-check-label:hover {
    background: #e9ecef;
}

.border-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0d6efd;
}

/* ==================== */
/* OPTIONS - Sub-options */
/* ==================== */
.option-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.option-card-header {
    background: #f8f9fa;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dee2e6;
}

.option-card-body {
    padding: 16px;
}

.sub-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.sub-option-row:last-child {
    border-bottom: none;
}

/* ==================== */
/* PRODUCT OPTIONS INLINE */
/* ==================== */
.product-options-section {
    border-top: 2px solid #dee2e6;
    padding-top: 20px;
    margin-top: 20px;
}

.option-price-group {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.option-price-group h6 {
    margin-bottom: 10px;
    color: #495057;
}

/* ==================== */
/* QUOTE STEP 3 GROUPED */
/* ==================== */
.option-group-card {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.option-group-card h5 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1rem;
}

.option-group-card .form-check {
    padding: 8px 0 8px 28px;
    border-bottom: 1px solid #f0f0f0;
}

.option-group-card .form-check:last-child {
    border-bottom: none;
}

.option-group-card .form-check-label {
    cursor: pointer;
}

.option-price-tag {
    float: right;
    color: #6c757d;
    font-size: 0.85rem;
}

/* ==================== */
/* PROFILE / LOGO       */
/* ==================== */
.logo-preview {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    background: #fff;
}

/* ==================== */
/* LOGIN PAGE           */
/* ==================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 420px;
    max-width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin: 0 auto;
}

.login-card h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a1a2e;
    font-weight: 700;
}
