﻿/* ================= ROOT ================= */
.settings {
    padding: 20px;
    background: #f6f7f9;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================= HEADER ================= */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

    .settings-header h2 {
        margin: 0;
        font-size: 22px;
    }

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.settings-subtitle {
    font-size: 13px;
    color: #777;
}

/* ================= PROGRESS BAR ================= */
.setup-progress-wrap {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.setup-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.setup-progress-label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.setup-progress-fraction {
    font-size: 13px;
    font-weight: 700;
    color: #111;
}

.setup-progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 99px;
    overflow: hidden;
}

.setup-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #111 0%, #444 100%);
    border-radius: 99px;
    transition: width 0.5s ease;
}

    /* Green when all done */
    .setup-progress-fill.complete {
        background: linear-gradient(90deg, #28a745 0%, #34c358 100%);
    }

/* ================= CARDS GRID ================= */
.settings-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ================= INDIVIDUAL CARD ================= */
.setting-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

    .setting-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: #eee;
        border-radius: 12px 12px 0 0;
        transition: background 0.3s ease;
    }

    /* Colored top strip per type */
    .setting-card[data-type="TABLES"]::before {
        background: #cce5ff;
    }

    .setting-card[data-type="BILLING"]::before {
        background: #d4edda;
    }

    .setting-card[data-type="TAX"]::before {
        background: #fff3cd;
    }

    .setting-card[data-type="VAT"]::before {
        background: #f3e8ff;
    }

    .setting-card.is-configured {
        border-color: #e6f7ee;
    }

    .setting-card:hover {
        box-shadow: 0 4px 18px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }

/* ================= CARD ICON ================= */
.card-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.tables-icon {
    background: #e7f4ff;
}

.billing-icon {
    background: #e6f7ee;
}

.tax-icon {
    background: #fffbeb;
}

.vat-icon {
    background: #f5eeff;
}

/* ================= CARD BODY ================= */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

/* ================= BADGES ================= */
.card-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

    .card-badge.unconfigured {
        background: #fdecea;
        color: #d32f2f;
    }

    .card-badge.configured {
        background: #d4edda;
        color: #155724;
    }

/* ================= CARD DESC ================= */
.card-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.55;
    margin: 0;
}

/* ================= CARD VALUES (configured state) ================= */
.card-values {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.card-value-pill {
    background: #f6f7f9;
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
}

.cv-label {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cv-val {
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

/* ================= CARD ACTION BUTTON ================= */
.card-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: auto;
}

    .card-btn:hover {
        background: #333;
    }

    /* Edit state — muted */
    .card-btn.is-edit {
        background: #f6f7f9;
        color: #111;
        border: 1px solid #ddd;
    }

        .card-btn.is-edit:hover {
            background: #efefef;
        }

.card-btn-arrow {
    font-size: 15px;
    transition: transform 0.2s ease;
}

.card-btn:hover .card-btn-arrow {
    transform: translateX(4px);
}

/* ================= UTIL ================= */
.hidden {
    display: none !important;
}

/* ===============================================================
   CONFIGURATION MODAL (matches BillDesk customization modal)
=============================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-sheet {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    padding: 0 0 20px 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    animation: slideUpSheet 0.22s ease-out;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 10px auto 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.modal-subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.modal-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 16px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s ease;
}

    .modal-close:hover {
        background: #eee;
    }

/* ================= MODAL BODY ================= */
.modal-body {
    padding: 18px 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .modal-form-group label {
        font-size: 13px;
        font-weight: 600;
        color: #444;
    }

    .modal-form-group input,
    .modal-form-group select {
        width: 100%;
        padding: 9px 12px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 13px;
        box-sizing: border-box;
        outline: none;
        background: #fff;
        transition: border-color 0.2s ease;
        appearance: none;
    }

        .modal-form-group input:focus,
        .modal-form-group select:focus {
            border-color: #007bff;
        }

.modal-field-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.required-star {
    color: #d32f2f;
}

/* ================= MODAL FOOTER ================= */
.modal-footer {
    padding: 14px 20px 0;
    border-top: 1px solid #f0f0f0;
}

.modal-save-btn {
    width: 100%;
    padding: 12px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .modal-save-btn:hover {
        background: #333;
    }

/* ================= RESPONSIVE ================= */
@media (max-width: 860px) {
    .settings-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .settings {
        padding: 12px;
    }

    .settings-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-sheet {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
    }

    .modal-overlay {
        align-items: flex-end;
    }
}
