/*
 * Theme refresh — light visual polish over the existing Argon Dashboard /
 * Material Kit templates. Loaded last, after argon.css / material-kit*.css,
 * so it overrides them without needing to touch individual view markup.
 *
 * Keeps the app's existing brand blue (#5e72e4, from Argon) as the single
 * primary color everywhere — Material Kit's own blue (#005CA7) is remapped
 * to match so the two template systems the app mixes read as one product.
 */

:root {
    --brand-blue: #5e72e4;
    --brand-blue-dark: #4a5bc7;
    --brand-blue-darker: #3b49a3;
    --brand-blue-light: #eef1fd;
    --brand-blue-lighter: #f7f8fe;

    --brand-ink: #1e2333;
    --brand-body: #4a5171;
    --brand-muted: #8892b0;
    --brand-border: #e6e9f5;

    /* Same dark navy as the Material Kit card-header (.bg-dark /
       --bs-dark: #344767) used on the payment ("Bayaran") screens, so
       table headers read consistently with them. */
    --brand-dark: #344767;
    --brand-dark-light: #435684;

    --brand-shadow-sm: 0 1px 2px rgba(30, 35, 82, 0.06);
    --brand-shadow-md: 0 4px 14px rgba(30, 35, 82, 0.08);
    --brand-shadow-lg: 0 16px 40px rgba(30, 35, 82, 0.14);

    --brand-radius-sm: 8px;
    --brand-radius-md: 12px;
    --brand-radius-lg: 18px;
    --brand-radius-pill: 999px;
}

/* ---------------------------------------------------------------------- */
/* Typography                                                              */
/* ---------------------------------------------------------------------- */

body {
    color: var(--brand-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.card-title,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--brand-ink);
    letter-spacing: -0.01em;
}

.card-body p,
.card-body span,
.table td,
.table th {
    letter-spacing: 0;
}

/* ---------------------------------------------------------------------- */
/* Unify the two frameworks' primary blue                                 */
/* ---------------------------------------------------------------------- */

:root {
    --primary: var(--brand-blue);
    --bs-primary: var(--brand-blue);
    --bs-primary-rgb: 94, 114, 228;
}

.text-primary { color: var(--brand-blue) !important; }
.border-primary { border-color: var(--brand-blue) !important; }

.bg-primary,
.badge-primary {
    background-color: var(--brand-blue) !important;
}

.bg-gradient-primary {
    background: linear-gradient(87deg, var(--brand-blue) 0, var(--brand-blue-dark) 100%) !important;
}

a {
    color: var(--brand-blue);
}

a:hover {
    color: var(--brand-blue-dark);
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

.btn {
    border-radius: var(--brand-radius-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.btn-primary:not(:disabled):not(.disabled) {
    background-color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    box-shadow: var(--brand-shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-blue-dark) !important;
    border-color: var(--brand-blue-dark) !important;
    box-shadow: var(--brand-shadow-md);
}

.btn-primary:active {
    background-color: var(--brand-blue-darker) !important;
    border-color: var(--brand-blue-darker) !important;
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
}

.btn-outline-primary:hover {
    background-color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
}

/* Several auth pages (login, register, forgot/reset email, first-time
   setup) hardcode the same dark slate inline style="background: #4A4E59;"
   on various elements - the login/forgot-password submit button
   (.btn.bg-gradient-dark), the forgot-email/reset-email/first-time header
   banner (.bg-gradient-primary), and their "Sahkan" button
   (.btn.btn-secondary). Target the literal inline color directly so every
   instance is unified with the rest of the app regardless of which class
   it happens to carry. */
[style*="background: #4A4E59"] {
    background: linear-gradient(87deg, var(--brand-blue) 0, var(--brand-blue-dark) 100%) !important;
}

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */

.card {
    border: 1px solid var(--brand-border);
    border-radius: var(--brand-radius-md);
    box-shadow: var(--brand-shadow-sm);
    transition: box-shadow 0.2s ease;
}

.card.shadow,
.card.shadow-lg,
.card.shadow-xl {
    box-shadow: var(--brand-shadow-md) !important;
}

.card:hover {
    box-shadow: var(--brand-shadow-md);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--brand-border);
    border-radius: var(--brand-radius-md) var(--brand-radius-md) 0 0 !important;
}

/* ---------------------------------------------------------------------- */
/* Tables                                                                  */
/* ---------------------------------------------------------------------- */

.table thead th {
    background-color: var(--brand-dark);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: none;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.table thead th a,
.table thead th .sorting,
.table thead th .sorting_asc,
.table thead th .sorting_desc {
    color: #fff !important;
}

.table td {
    vertical-align: middle;
    color: var(--brand-body);
}

.table-hover tbody tr:hover {
    background-color: var(--brand-blue-lighter);
}

/* ---------------------------------------------------------------------- */
/* Badges / status pills                                                  */
/* ---------------------------------------------------------------------- */

.badge {
    border-radius: var(--brand-radius-pill);
    font-weight: 600;
    padding: 0.4em 0.85em;
    letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */

.form-control,
.form-select {
    border-radius: var(--brand-radius-sm);
    border-color: var(--brand-border);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px var(--brand-blue-light);
}

/* ---------------------------------------------------------------------- */
/* Sidebar / navbar                                                        */
/* ---------------------------------------------------------------------- */

#sidenav-main {
    border-right: 1px solid var(--brand-border);
    box-shadow: var(--brand-shadow-sm);
}

#sidenav-main .nav-link {
    border-radius: var(--brand-radius-sm);
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#sidenav-main .nav-link.active {
    background: linear-gradient(87deg, var(--brand-blue) 0, var(--brand-blue-dark) 100%);
    box-shadow: var(--brand-shadow-sm);
    color: #fff !important;
}

#sidenav-main .nav-link:hover:not(.active) {
    background-color: var(--brand-blue-light);
}

.navbar-top {
    box-shadow: var(--brand-shadow-sm);
}

/* ---------------------------------------------------------------------- */
/* Login / auth pages                                                     */
/* ---------------------------------------------------------------------- */

.sign-in-basic .card,
.login-container .card {
    border-radius: var(--brand-radius-lg);
    box-shadow: var(--brand-shadow-lg);
    border: none;
}

/* ---------------------------------------------------------------------- */
/* Scrollbar polish (WebKit)                                              */
/* ---------------------------------------------------------------------- */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ced3ea;
    border-radius: var(--brand-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-muted);
}
