
/* ============ Wrapper ============ */
.superdt-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ============ Header (title + toolbar) ============ */
.superdt-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.superdt-title {
    font-size: 18px;
    font-weight: 600;
    color: #263238;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .superdt-title i {
        color: var(--main-color);
        font-size: 18px;
    }

.superdt-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.superdt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #ffffff;
    color: #455a64;
    border: 1px solid #dde3e8;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .superdt-btn:hover {
        background-color: #f1f5f8;
        border-color: var(--main-color);
        color: var(--main-color);
    }

    .superdt-btn.superdt-btn-primary {
        background-color: var(--main-color);
        border-color: var(--main-color);
        color: #ffffff;
    }

        .superdt-btn.superdt-btn-primary:hover {
            background-color: #52707c;
        }

    .superdt-btn i {
        font-size: 13px;
    }

/* ============ Controls row (length + date range + search) ============ */
.superdt-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.superdt-controls-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.superdt-length {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #607d8b;
    font-size: 13px;
}

    .superdt-length select {
        padding: 6px 28px 6px 10px;
        border: 1px solid #dde3e8;
        border-radius: 6px;
        background-color: #ffffff;
        color: #333;
        font-size: 13px;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23607d8b' d='M0 0l5 6 5-6z'/></svg>");
        background-repeat: no-repeat;
        background-position: right 10px center;
        cursor: pointer;
    }

        .superdt-length select:focus {
            outline: none;
            border-color: var(--main-color);
        }

/* ============ Date range picker (pure HTML, modern UI) ============ */
.superdt-daterange {
    display: flex;
    align-items: stretch;
    background-color: #ffffff;
    border: 1px solid #dde3e8;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .superdt-daterange:hover {
        border-color: #c6d0d6;
    }

    .superdt-daterange:focus-within {
        border-color: var(--main-color);
        box-shadow: 0 0 0 3px rgba(96, 125, 139, 0.15);
    }

.superdt-daterange-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    background-color: #f5f8fa;
    color: var(--main-color);
    font-size: 14px;
    border-right: 1px solid #edf1f4;
    flex-shrink: 0;
}

/* Each date field gets a floating-label style group */
.superdt-daterange-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 12px;
    position: relative;
    min-width: 118px;
}

    .superdt-daterange-field + .superdt-daterange-field {
        border-left: 1px solid #edf1f4;
    }

    .superdt-daterange-field label {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--second-color);
        margin-bottom: 2px;
        pointer-events: none;
    }

    .superdt-daterange-field:focus-within label {
        color: var(--main-color);
    }

    .superdt-daterange-field input[type="date"] {
        border: none;
        outline: none;
        font-size: 13px;
        font-weight: 500;
        color: #263238;
        background: transparent;
        font-family: inherit;
        padding: 0;
        width: 100%;
        cursor: pointer;
    }

        .superdt-daterange-field input[type="date"]::-webkit-calendar-picker-indicator {
            cursor: pointer;
            opacity: 0.55;
            filter: invert(46%) sepia(11%) saturate(769%) hue-rotate(153deg) brightness(90%) contrast(85%);
            margin-left: 6px;
        }

            .superdt-daterange-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
                opacity: 1;
            }

.superdt-daterange-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: var(--second-color);
    font-size: 11px;
    background-color: #fafbfc;
    border-left: 1px solid #edf1f4;
    border-right: 1px solid #edf1f4;
}

.superdt-daterange-clear,
.superdt-daterange-search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    border: none;
    border-left: 1px solid #edf1f4;
    background-color: #ffffff;
    color: var(--second-color);
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .superdt-daterange-clear:hover {
        background-color: #fdeaea;
        color: #c62828;
    }

    .superdt-daterange-search:hover {
        background-color: #f5f8fa;
        color: var(--main-color);
    }


/* Quick preset chips (button group, replaces plain dropdown) */
.superdt-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.superdt-preset-chip {
    display: inline-flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #dde3e8;
    color: #607d8b;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .superdt-preset-chip:hover {
        border-color: var(--main-color);
        color: var(--main-color);
        background-color: #f5f8fa;
    }

    .superdt-preset-chip.superdt-preset-active {
        background-color: var(--main-color);
        border-color: var(--main-color);
        color: #ffffff;
    }

.superdt-search {
    position: relative;
    display: flex;
    align-items: center;
}

    .superdt-search i {
        position: absolute;
        left: 12px;
        color: var(--second-color);
        font-size: 13px;
        pointer-events: none;
    }

    .superdt-search input[type="search"] {
        padding: 8px 12px 8px 32px;
        border: 1px solid #dde3e8;
        border-radius: 6px;
        font-size: 13px;
        color: #333;
        width: 220px;
        box-sizing: border-box;
    }

        .superdt-search input[type="search"]:focus {
            outline: none;
            border-color: var(--main-color);
            box-shadow: 0 0 0 3px rgba(96, 125, 139, 0.15);
        }

/* ============ Active filters (shows selected range as a chip) ============ */
.superdt-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.superdt-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #eef4f7;
    color: var(--main-color);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 20px;
}

    .superdt-filter-chip i.fa-calendar-days {
        font-size: 15px;
    }

.superdt-filter-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(96, 125, 139, 0.15);
    cursor: pointer;
    font-size: 9px;
}

    .superdt-filter-chip-remove:hover {
        background-color: rgba(96, 125, 139, 0.3);
    }

/* ============ Table container (scroll on small screens) ============ */
.superdt-table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #edf1f4;
    border-radius: 8px;
}

table.superdt {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

    table.superdt thead th {
        background-color: #f5f8fa;
        color: #37474f;
        font-weight: 600;
        text-align: left;
        padding: 12px 16px;
        font-size: 13px;
        border-bottom: 2px solid #e3e9ed;
        white-space: nowrap;
        user-select: none;
    }

        table.superdt thead th.superdt-sortable {
            cursor: pointer;
            position: relative;
            padding-right: 26px;
        }

            table.superdt thead th.superdt-sortable i {
                position: absolute;
                right: 10px;
                top: 50%;
                transform: translateY(-50%);
                font-size: 11px;
                color: var(--second-color);
            }

        table.superdt thead th.superdt-sort-asc i,
        table.superdt thead th.superdt-sort-desc i {
            color: var(--main-color);
        }

    table.superdt tbody td {
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 500;
        color: #444;
        border-bottom: 1px solid #eef2f5;
        vertical-align: middle;
    }

        table.superdt tbody td span.price-tag {
            font-weight: 600;
            font-size: 14px;
        }

        table.superdt tbody td span.invoice-tag {
            font-weight: 600;
            font-size: 14px;
            color: var(--main-color);
        }

    table.superdt tbody tr:hover {
        background-color: #f5f9fb;
    }

    table.superdt tbody tr:last-child td {
        border-bottom: none;
    }


/* Status badges */
.superdt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

    .superdt-badge i {
        font-size: 10px;
    }

.superdt-badge-success {
    background-color: #e5f6ea;
    color: #2e7d32;
}

.superdt-badge-warning {
    background-color: #fff6e0;
    color: #b98b00;
}

.superdt-badge-danger {
    background-color: #fdeaea;
    color: #c62828;
}

.superdt-badge-neutral {
    background-color: #eceff1;
    color: var(--second-color);
}

/* Row actions */
.superdt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.superdt-action-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #e3e9ed;
    background-color: #ffffff;
    color: #607d8b;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .superdt-action-btn:hover {
        background-color: var(--main-color);
        border-color: var(--main-color);
        color: #ffffff;
    }

    .superdt-action-btn.superdt-action-danger:hover {
        background-color: #e53935;
        border-color: #e53935;
    }

/* Checkbox column */
.superdt-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--main-color);
    cursor: pointer;
}

/* Avatar + name cell */
.superdt-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .superdt-user i {
        font-size: 18px;
        color: var(--main-color);
    }

.superdt-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.superdt-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.superdt-user-name {
    font-weight: 500;
    color: #263238;
    font-size: 13px;
    text-transform: capitalize;
}

.superdt-user-email {
    color: #6c757d;
    font-size: 12px;
}

/* Empty state */
.superdt-empty {
    text-align: center;
    padding: 40px 16px;
    justify-content: center;
    display: flex;
    color: var(--second-color);
    flex-direction: column;
}

    .superdt-empty i {
        font-size: 32px;
        margin: auto;
        margin-bottom: 10px;
        display: block;
        color: #cfd8dc;
    }

    .superdt-empty p {
        font-size: 18px;
        margin: 0;
    }
/* ============ Footer (info + pagination) ============ */
.superdt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.superdt-info {
    color: var(--second-color);
    font-size: 13px;
}

.superdt-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .superdt-pagination li a,
    .superdt-pagination li span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        border-radius: 6px;
        border: 1px solid #dde3e8;
        color: #455a64;
        font-size: 13px;
        text-decoration: none;
        background-color: #ffffff;
        cursor: pointer;
        box-sizing: border-box;
    }

        .superdt-pagination li a:hover {
            border-color: var(--main-color);
            color: var(--main-color);
        }

    .superdt-pagination li.superdt-active span {
        background-color: var(--main-color);
        border-color: var(--main-color);
        color: #ffffff;
        font-weight: 500;
    }

    .superdt-pagination li.superdt-disabled a {
        color: #cfd8dc;
        border-color: #eceff1;
        cursor: not-allowed;
        pointer-events: none;
    }

    .superdt-pagination li.superdt-ellipsis span {
        border: none;
        background: transparent;
        cursor: default;
    }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .superdt-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .superdt-controls-left {
        flex-direction: column;
        align-items: stretch;
    }

    .superdt-daterange {
        flex-wrap: wrap;
    }

    .superdt-daterange-field {
        flex: 1 1 45%;
        min-width: 0;
    }

    .superdt-presets {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .superdt-search input[type="search"] {
        width: 100%;
    }

    .superdt-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .superdt-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
