:root {
    --ink: #1f2d3d;
    --teal: #0da7ac;
    --teal-deep: #0a8fa4;
    --teal-darker: #074447;
    --foam: #eafcfb;
    --line: #e9ecef;
    --muted: #6c757d;
}

/* =========================
   Customer Page
   ========================= */

.ac {
    color: var(--ink);
}

html.dark-mode .ac {
    color: #e5e5e5;
}

/* =========================
   Page Header
   ========================= */

.ac > h2 {
    margin-bottom: 22px !important;
    color: var(--ink);
    font-size: 24px;
    font-weight: 700;
}

.ac > h2 i {
    color: var(--teal);
    margin-right: 6px;
}

html.dark-mode .ac > h2 {
    color: #ffffff;
}

/* =========================
   Search Card
   ========================= */

.ac > .card {
    margin-bottom: 20px !important;
    background: #fff;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 14px rgba(10, 110, 116, 0.06);
    overflow: hidden;
}

.ac > .card .card-body {
    padding: 18px 20px;
}

html.dark-mode .ac > .card {
    background: #111111;
    border-color: #1f1f1f !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* =========================
   Search Input
   ========================= */

.ac .form-control {
    padding: 11px 14px;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid #dde3e2;
    border-radius: 9px;
    font-size: 14px;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.ac .form-control:focus {
    color: var(--ink);
    background: #fff;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 167, 172, 0.12);
}

.ac .form-control::placeholder {
    color: #9aa3aa;
}

html.dark-mode .ac .form-control {
    background: #1a1a1a;
    color: #e5e5e5;
    border-color: #2a2a2a;
}

html.dark-mode .ac .form-control:focus {
    background: #1a1a1a;
    color: #e5e5e5;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 167, 172, 0.15);
}

html.dark-mode .ac .form-control::placeholder {
    color: #4b5563;
}

/* =========================
   Search Button
   ========================= */

.ac .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.ac .btn-primary:hover,
.ac .btn-primary:focus {
    background: linear-gradient(135deg, var(--teal-deep), var(--teal-darker));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(10, 143, 164, 0.28);
}

/* =========================
   Clear Button
   ========================= */

.ac .btn-outline-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 17px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    transition: 0.15s ease;
}

.ac .btn-outline-secondary:hover {
    background: #f8fbfc;
    color: var(--ink);
    border-color: #cfd8d8;
}

html.dark-mode .ac .btn-outline-secondary {
    background: #1a1a1a;
    color: #9ca3af;
    border-color: #2a2a2a;
}

html.dark-mode .ac .btn-outline-secondary:hover {
    background: #252525;
    color: #ffffff;
    border-color: #3a3a3a;
}

/* =========================
   Result Count
   ========================= */

.ac > p {
    color: var(--muted);
    font-size: 13px;
}

.ac > p strong {
    color: var(--ink);
    font-size: 14px;
}

html.dark-mode .ac > p {
    color: #6b7280;
}

html.dark-mode .ac > p strong {
    color: #e5e5e5;
}

/* =========================
   Table Container
   ========================= */

.ac .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(10, 110, 116, 0.06);
    -webkit-overflow-scrolling: touch;
}

html.dark-mode .ac .table-responsive {
    background: #111111;
    border-color: #1f1f1f;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* =========================
   Customer Table
   ========================= */

.ac table {
    width: 100%;
    margin-bottom: 0 !important;
    font-size: 14px;
}

/* =========================
   Table Header
   ========================= */

.ac table thead th {
    padding: 14px 16px;
    background: var(--foam) !important;
    color: var(--teal-darker) !important;
    border: none !important;
    border-bottom: 1px solid #d8efee !important;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

html.dark-mode .ac table thead th {
    background: #1a1a1a !important;
    color: #2dd4bf !important;
    border-bottom-color: #2a2a2a !important;
}

/* =========================
   Table Body
   ========================= */

.ac table tbody td {
    padding: 14px 16px;
    color: var(--ink);
    border: none !important;
    border-bottom: 1px solid #f1f3f5 !important;
    vertical-align: middle;
}

.ac table tbody tr {
    transition: background 0.15s ease;
}

.ac table tbody tr:hover {
    background: #f8fbfc !important;
}

.ac table tbody tr:last-child td {
    border-bottom: none !important;
}

html.dark-mode .ac table tbody td {
    color: #e5e5e5;
    border-bottom-color: #1f1f1f !important;
}

html.dark-mode .ac table tbody tr:hover {
    background: #1a1a1a !important;
}

/* =========================
   Customer Name
   ========================= */

.ac table tbody td:first-child {
    font-weight: 700;
}

/* =========================
   View Button
   ========================= */

.ac table .btn-primary {
    padding: 7px 13px;
    background: #fff;
    color: var(--teal-darker);
    border: 1px solid #c9ecea;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: none;
    transform: none;
}

.ac table .btn-primary:hover {
    background: var(--foam);
    color: var(--teal-darker);
    border-color: var(--teal);
    box-shadow: none;
    transform: translateY(-1px);
}

html.dark-mode .ac table .btn-primary {
    background: rgba(13, 148, 136, 0.1);
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.25);
}

html.dark-mode .ac table .btn-primary:hover {
    background: rgba(13, 148, 136, 0.2);
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.4);
}

/* =========================
   Empty Alert
   ========================= */

.ac .alert-info {
    padding: 14px 16px;
    margin-bottom: 18px;
    background: var(--foam);
    color: var(--teal-darker);
    border: 1px solid #d8efee;
    border-radius: 10px;
    font-size: 14px;
}

html.dark-mode .ac .alert-info {
    background: rgba(13, 148, 136, 0.08);
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.2);
}

/* =========================
   Pagination
   ========================= */

.ac .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
    margin-bottom: 0;
}

.ac .pagination .page-item {
    margin: 0;
}

.ac .pagination .page-link {
    min-width: 38px;
    padding: 8px 11px;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px !important;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    transition: 0.15s ease;
}

.ac .pagination .page-link:hover {
    background: var(--foam);
    color: var(--teal-darker);
    border-color: #c9ecea;
}

.ac .pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(10, 143, 164, 0.2);
}

html.dark-mode .ac .pagination .page-link {
    background: #1a1a1a;
    color: #e5e5e5;
    border-color: #2a2a2a;
}

html.dark-mode .ac .pagination .page-link:hover {
    background: rgba(13, 148, 136, 0.1);
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.25);
}

html.dark-mode .ac .pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    color: #fff;
    border-color: transparent;
}

/* =========================
   Back to Dashboard
   ========================= */

.ac > .mt-4 .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    transition: 0.15s ease;
}

.ac > .mt-4 .btn-secondary:hover {
    background: #f8fbfc;
    color: var(--teal-darker);
    border-color: #c9ecea;
}

html.dark-mode .ac > .mt-4 .btn-secondary {
    background: #1a1a1a;
    color: #e5e5e5;
    border-color: #2a2a2a;
}

html.dark-mode .ac > .mt-4 .btn-secondary:hover {
    background: #252525;
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.3);
}

/* =========================
   Mobile Table - Stacked
   ========================= */

@media (max-width: 768px) {

    .ac > h2 {
        font-size: 21px;
    }

    .ac .card-body {
        padding: 16px;
    }

    .ac form.row {
        display: flex;
        flex-direction: column;
    }

    .ac form.row > .col-md-8,
    .ac form.row > .col-auto {
        width: 100%;
        max-width: 100%;
    }

    .ac form.row .btn-primary,
    .ac form.row .btn-outline-secondary {
        width: 100%;
    }

    .ac .table-responsive {
        overflow: visible;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .ac table,
    .ac table tbody {
        display: block;
        width: 100%;
    }

    .ac table thead {
        display: none;
    }

    .ac table tbody tr {
        display: block;
        margin-bottom: 14px;
        padding: 15px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 12px;
        box-shadow: 0 3px 10px rgba(10, 110, 116, 0.05);
    }

    .ac table tbody tr:last-child {
        margin-bottom: 0;
    }

    .ac table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid #f1f3f5 !important;
        text-align: right;
        white-space: normal;
    }

    .ac table tbody td:last-child {
        border-bottom: none !important;
        padding-bottom: 0;
        justify-content: flex-start;
    }

    .ac table tbody td::before {
        content: attr(data-label);
        flex: 0 0 35%;
        margin-right: 15px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .ac table tbody td:last-child::before {
        display: none;
    }

    .ac table tbody td:last-child .btn {
        width: auto;
    }

    html.dark-mode .ac table tbody tr {
        background: transparent;
        border-color: #2a2a2a;
        box-shadow: none;
    }

    html.dark-mode .ac table tbody td {
        color: #e5e5e5;
        border-bottom-color: #2a2a2a !important;
    }

    html.dark-mode .ac table tbody td::before {
        color: #6b7280;
    }
}

/* =========================
   Small Phones
   ========================= */

@media (max-width: 480px) {

    .ac > h2 {
        font-size: 20px;
    }

    .ac table tbody tr {
        padding: 13px;
    }

    .ac table tbody td {
        font-size: 13px;
    }

    .ac table tbody td::before {
        flex-basis: 38%;
        font-size: 10px;
    }

    .ac .pagination .page-link {
        min-width: 35px;
        padding: 7px 9px;
    }

    html.dark-mode .ac table tbody tr {
        background: transparent;
        border-color: #2a2a2a;
    }

    html.dark-mode .ac table tbody td {
        border-bottom-color: #2a2a2a !important;
    }
}