/* ==========================================================================
   CloudTek — Blesta 6.0 Client Theme (Light SaaS)
   File: /app/views/client/bootstrap/css/custom.css
   Loaded after application.min.css + theme_css to override defaults.
   Style: light / clean SaaS flat / soft glass + subtle elevation
   --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Brand palette */
    --ct-primary: #2F6BFF;          /* main brand blue (deeper for contrast on white) */
    --ct-primary-hover: #1F5AEE;
    --ct-primary-soft: rgba(47, 107, 255, .10);
    --ct-accent: #7C5CFF;           /* secondary accent purple */
    --ct-accent-soft: rgba(124, 92, 255, .12);
    --ct-success: #16B981;
    --ct-danger: #EF4444;
    --ct-warning: #F59E0B;
    --ct-info: #0EA5E9;

    /* Surfaces (light) */
    --ct-bg: #F3F6FC;               /* page background */
    --ct-bg-grad-1: rgba(47, 107, 255, .07);
    --ct-bg-grad-2: rgba(124, 92, 255, .06);
    --ct-surface: #FFFFFF;          /* card / panel surface */
    --ct-surface-2: #F5F8FE;        /* raised surface / hover / form bg */
    --ct-glass: rgba(255, 255, 255, .78); /* soft glass card bg */
    --ct-border: rgba(15, 23, 42, .08);
    --ct-border-strong: rgba(15, 23, 42, .16);

    /* Text (dark) */
    --ct-text: #0F1B33;             /* primary text */
    --ct-muted: #5B6B85;            /* secondary text */
    --ct-faint: #8A97AD;            /* tertiary text */

    /* Effects & geometry */
    --ct-radius: 12px;
    --ct-radius-lg: 16px;
    --ct-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
    --ct-shadow-lg: 0 14px 44px rgba(15, 23, 42, .14);
    --ct-glow: 0 0 0 1px rgba(47, 107, 255, .22), 0 14px 34px rgba(47, 107, 255, .16);

    /* Layout metrics */
    --ct-appbar-h: 64px;
    --ct-sidebar-w: 248px;
    --ct-sidebar-w-collapsed: 0px;
    --ct-transition: .22s cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   Base / reset (scoped to client area)
   ========================================================================== */
body.ct-theme {
    background:
        radial-gradient(1200px 500px at 85% -10%, var(--ct-bg-grad-1), transparent 60%),
        radial-gradient(900px 420px at -10% 30%, var(--ct-bg-grad-2), transparent 55%),
        var(--ct-bg);
    color: var(--ct-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: .925rem;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Hide the stock Blesta header/navbar — replaced by the custom app bar + sidebar */
body.ct-theme .header,
body.ct-theme .nav-content {
    display: none !important;
}

/* Blesta layout container: we manage our own grid */
body.ct-theme .container-md {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* ==========================================================================
   App Bar (top navigation)
   ========================================================================== */
.ct-appbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ct-appbar-h);
    z-index: 1050;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: var(--ct-glass);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ct-border);
}

.ct-appbar-inner {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hamburger (mobile only) */
.ct-sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--ct-border);
    border-radius: 10px;
    background: var(--ct-surface);
    color: var(--ct-text);
    font-size: 1.05rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--ct-transition);
}
.ct-sidebar-toggle:hover {
    background: var(--ct-primary-soft);
    border-color: var(--ct-primary);
    color: var(--ct-primary);
}

/* Brand */
.ct-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--ct-text) !important;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -.4px;
    text-decoration: none !important;
    white-space: nowrap;
}
.ct-brand-mark {
    color: var(--ct-primary);
    font-size: 1.3rem;
}
.ct-brand span {
    color: var(--ct-primary);
}

/* App bar right actions */
.ct-appbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* User dropdown (stock Blesta dropdown is styled below) */
.ct-user-menu .dropdown-menu {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow-lg);
    padding: .4rem;
    min-width: 210px;
}
.ct-user-menu .dropdown-item {
    color: var(--ct-text);
    border-radius: 8px;
    padding: .55rem .8rem;
    font-size: .88rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.ct-user-menu .dropdown-item:hover {
    background: var(--ct-primary-soft);
    color: var(--ct-primary);
}
.ct-user-menu .dropdown-divider {
    border-top-color: var(--ct-border);
}

/* ==========================================================================
   Sidebar (left navigation)
   ========================================================================== */
.ct-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--ct-appbar-h);
}

.ct-sidebar {
    position: fixed;
    top: var(--ct-appbar-h);
    bottom: 0;
    left: 0;
    width: var(--ct-sidebar-w);
    z-index: 1040;
    overflow-y: auto;
    padding: 1.1rem .9rem;
    background: var(--ct-glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--ct-border);
    transition: transform var(--ct-transition);
    scrollbar-width: thin;
    scrollbar-color: var(--ct-border-strong) transparent;
}

.ct-sidebar::-webkit-scrollbar {
    width: 5px;
}
.ct-sidebar::-webkit-scrollbar-thumb {
    background: var(--ct-border-strong);
    border-radius: 4px;
}

/* Sidebar nav group label */
.ct-nav-label {
    color: var(--ct-faint);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: .9rem .75rem .35rem;
}

/* Nav item */
.ct-nav-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .8rem;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--ct-muted) !important;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: var(--ct-transition);
    position: relative;
}
.ct-nav-item i {
    width: 20px;
    text-align: center;
    font-size: .95rem;
    color: var(--ct-faint);
    transition: var(--ct-transition);
}
.ct-nav-item:hover {
    background: var(--ct-primary-soft);
    color: var(--ct-text) !important;
}
.ct-nav-item:hover i {
    color: var(--ct-primary);
}

/* Active item: soft pill + left indicator + brand-colored text */
.ct-nav-item.active {
    background: linear-gradient(90deg, var(--ct-primary-soft), transparent 85%);
    color: var(--ct-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .18);
}
.ct-nav-item.active::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--ct-primary), var(--ct-accent));
}
.ct-nav-item.active i {
    color: var(--ct-primary);
}

/* Nav item with children: caret */
.ct-nav-caret {
    margin-left: auto;
    font-size: .7rem;
    color: var(--ct-faint);
    transition: transform var(--ct-transition);
}
.ct-nav-group.open > .ct-nav-item .ct-nav-caret {
    transform: rotate(180deg);
}

/* Child nav (submenu) */
.ct-nav-sub {
    display: none;
    padding: .2rem 0 .3rem .9rem;
    margin-left: 1.15rem;
    border-left: 1px solid var(--ct-border);
}
.ct-nav-group.open .ct-nav-sub {
    display: block;
}
.ct-nav-sub-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .7rem;
    border-radius: 8px;
    color: var(--ct-muted) !important;
    font-size: .84rem;
    text-decoration: none !important;
    transition: var(--ct-transition);
}
.ct-nav-sub-item i {
    width: 16px;
    text-align: center;
    font-size: .8rem;
    color: var(--ct-faint);
}
.ct-nav-sub-item:hover {
    color: var(--ct-text) !important;
    background: var(--ct-primary-soft);
}
.ct-nav-sub-item.active {
    color: var(--ct-primary) !important;
    background: var(--ct-primary-soft);
}

/* Sidebar footer */
.ct-sidebar-footer {
    margin-top: 1.5rem;
    padding: .9rem .75rem 0;
    border-top: 1px solid var(--ct-border);
    color: var(--ct-faint);
    font-size: .75rem;
    line-height: 1.6;
}
.ct-llc { color: var(--ct-muted); font-weight: 600; }

/* Mobile overlay (drawer backdrop) */
.ct-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 23, 42, .42);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* ==========================================================================
   Main content area
   ========================================================================== */
.ct-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--ct-sidebar-w);
    padding: 1.6rem 2rem 3rem;
    max-width: 100%;
}

/* Page title */
.ct-title {
    margin-bottom: 1.4rem;
}
.ct-title h3 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--ct-text);
    margin: 0;
}
.ct-title .ct-title-sub {
    color: var(--ct-muted);
    font-size: .86rem;
    margin-top: .2rem;
}

/* Content wrapper */
.ct-content {
    width: 100%;
}

/* ==========================================================================
   Overview cards (Dashboard) — soft white card with icon
   ========================================================================== */
.ct-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
    margin-bottom: 1.6rem;
}

/* The stock Blesta card partial renders .card inside a col; we restyle both
   the stock .card and our custom markup for maximum compatibility. */
.ct-cards-row .col-md-3,
.ct-cards-row .col-md-4,
.ct-cards-row .col-md-6 {
    max-width: 100%;
    padding: 0;
}

.card.ct-overview-card,
.ct-overview-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.3rem;
    border-radius: var(--ct-radius);
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    box-shadow: var(--ct-shadow);
    overflow: hidden;
    text-decoration: none !important;
    transition: var(--ct-transition);
    margin-bottom: 0;
}
.card.ct-overview-card:hover,
.ct-overview-card:hover {
    transform: translateY(-4px);
    border-color: rgba(47, 107, 255, .35);
    box-shadow: var(--ct-glow);
    background: #FFFFFF;
}

/* Decorative top glow */
.ct-overview-card::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 107, 255, .10), transparent 70%);
    pointer-events: none;
}

/* Card icon bubble */
.ct-card-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--ct-primary-soft);
    color: var(--ct-primary);
    box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .18);
    transition: var(--ct-transition);
}
.ct-overview-card:hover .ct-card-icon {
    transform: scale(1.08) rotate(-4deg);
    color: #fff;
    background: linear-gradient(135deg, var(--ct-primary), var(--ct-accent));
    box-shadow: 0 6px 18px rgba(47, 107, 255, .30);
}

/* Card value + label */
.ct-card-content {
    min-width: 0;
}
.ct-card-value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.1;
    color: var(--ct-text);
}
.ct-card-label {
    color: var(--ct-muted);
    font-size: .8rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Variants (icon tints) */
.ct-card-v-primary .ct-card-icon { background: rgba(47, 107, 255, .12); color: var(--ct-primary); box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .22); }
.ct-card-v-accent  .ct-card-icon { background: rgba(124, 92, 255, .12); color: var(--ct-accent); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .22); }
.ct-card-v-success .ct-card-icon { background: rgba(22, 185, 129, .12); color: var(--ct-success); box-shadow: inset 0 0 0 1px rgba(22, 185, 129, .22); }
.ct-card-v-warning .ct-card-icon { background: rgba(245, 158, 11, .14); color: var(--ct-warning); box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .24); }
.ct-card-v-danger  .ct-card-icon { background: rgba(239, 68, 68, .12); color: var(--ct-danger); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .22); }
.ct-card-v-info    .ct-card-icon { background: rgba(14, 165, 233, .12); color: var(--ct-info); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .22); }

/* ==========================================================================
   Panels / cards / tables / forms — light override
   ========================================================================== */
.panel,
.card,
.list-group-item {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    color: var(--ct-text);
}
.panel .panel-heading,
.card .card-header,
.list-group-item {
    background: var(--ct-surface-2);
    border-color: var(--ct-border);
    color: var(--ct-text);
}
.panel .panel-body,
.card .card-body {
    color: var(--ct-text);
}
.card-blesta,
.panel-blesta {
    background: var(--ct-glass);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* Tables */
.table {
    color: var(--ct-text);
}
.table thead th {
    border-bottom: 1px solid var(--ct-border);
    color: var(--ct-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--ct-surface-2);
}
.table td,
.table th {
    border-top: 1px solid var(--ct-border);
    padding: .8rem .75rem;
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background: var(--ct-primary-soft);
    color: var(--ct-text);
}
.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(15, 23, 42, .025);
}

/* Forms */
.form-control {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: 10px;
    color: var(--ct-text);
    padding: .6rem .85rem;
    transition: var(--ct-transition);
    height: auto;
    min-height: calc(1.5em + 1.2rem + 2px);
    line-height: 1.5;
}
.form-control:focus {
    background: var(--ct-surface);
    border-color: var(--ct-primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .14);
    color: var(--ct-text);
}
.form-control::placeholder {
    color: var(--ct-faint);
}
.form-group label,
label {
    color: var(--ct-muted);
    font-size: .84rem;
    font-weight: 600;
}
select.form-control {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235B6B85'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
}
select.form-control option {
    background: var(--ct-surface);
    color: var(--ct-text);
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: var(--ct-transition);
}
.btn-primary {
    background: linear-gradient(135deg, var(--ct-primary), var(--ct-accent));
    border: none;
    box-shadow: 0 4px 14px rgba(47, 107, 255, .24);
    color: #fff;
}
.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(47, 107, 255, .34);
}
.btn-secondary,
.btn-default {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    color: var(--ct-text);
}
.btn-secondary:hover,
.btn-default:hover {
    background: var(--ct-surface-2);
    border-color: var(--ct-primary);
    color: var(--ct-primary);
}
.btn-link {
    color: var(--ct-primary);
}

/* Badges / labels */
.badge {
    border-radius: 999px;
    font-weight: 600;
    padding: .35em .7em;
}
.badge-primary { background: var(--ct-primary-soft); color: var(--ct-primary); }
.badge-success { background: rgba(22, 185, 129, .14); color: var(--ct-success); }
.badge-danger  { background: rgba(239, 68, 68, .14); color: var(--ct-danger); }
.badge-warning { background: rgba(245, 158, 11, .16); color: #B45309; }
.badge-info    { background: rgba(14, 165, 233, .14); color: var(--ct-info); }
.badge-secondary { background: var(--ct-surface-2); color: var(--ct-muted); }

/* Alerts */
.alert {
    border-radius: var(--ct-radius);
    border: 1px solid var(--ct-border);
    background: var(--ct-surface);
    color: var(--ct-text);
}
.alert-success { border-color: rgba(22, 185, 129, .30); }
.alert-danger  { border-color: rgba(239, 68, 68, .30); }
.alert-warning { border-color: rgba(245, 158, 11, .30); }
.alert-info    { border-color: rgba(14, 165, 233, .30); }

/* Links */
a {
    color: var(--ct-primary);
}
a:hover {
    color: var(--ct-primary-hover);
}
.text-muted {
    color: var(--ct-muted) !important;
}

/* Dropdown menus (stock Bootstrap, used across Blesta pages) */
.dropdown-menu {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow-lg);
    padding: .35rem;
}
.dropdown-menu .dropdown-item {
    color: var(--ct-text);
    border-radius: 8px;
    padding: .5rem .8rem;
    font-size: .87rem;
}
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item.active {
    background: var(--ct-primary-soft);
    color: var(--ct-primary);
}
.dropdown-menu .dropdown-item i {
    color: var(--ct-muted);
}

/* List groups (secondary nav in content area) */
.list-group-item {
    color: var(--ct-muted);
}
.list-group-item.active {
    background: linear-gradient(90deg, var(--ct-primary-soft), transparent);
    border-color: var(--ct-border);
    color: var(--ct-primary);
}
.list-group-item:hover {
    color: var(--ct-text);
}

/* Modal */
.modal-content {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-lg);
    box-shadow: var(--ct-shadow-lg);
    color: var(--ct-text);
}
.modal-header,
.modal-footer {
    border-color: var(--ct-border);
}
.modal-header .close {
    color: var(--ct-muted);
    text-shadow: none;
}

/* Progress bars */
.progress {
    background: var(--ct-surface-2);
    border-radius: 999px;
}

/* Footer (enriched, multi-column branded) */
.ct-footer {
    margin-top: 2.5rem;
    padding-top: 0;
    border-top: 1px solid var(--ct-border);
    color: var(--ct-faint);
    font-size: .85rem;
}
.ct-footer-grid {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2.5rem 0 1.8rem;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
    gap: 1.5rem;
}
.ct-footer-brand {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
}
.ct-footer-logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--ct-primary), var(--ct-accent));
    box-shadow: 0 6px 18px rgba(47, 107, 255, .28);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ct-footer-logo span {
    color: #fff;
    font-size: 1.25rem;
}
.ct-footer-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--ct-text);
}
.ct-footer-name span {
    color: var(--ct-primary);
}
.ct-footer-tag {
    color: var(--ct-faint);
    font-size: .85rem;
    margin: .4rem 0 0;
    line-height: 1.5;
}
.ct-footer-col h5 {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--ct-faint);
    margin: 0 0 .85rem;
    font-weight: 700;
}
.ct-footer-col a {
    display: block;
    color: var(--ct-muted);
    font-size: .9rem;
    padding: .3rem 0;
    text-decoration: none;
    transition: var(--ct-transition);
}
.ct-footer-col a:hover {
    color: var(--ct-primary);
}
.ct-footer-bottom {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.2rem 0;
    border-top: 1px solid var(--ct-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    color: var(--ct-faint);
    font-size: .82rem;
}
.ct-footer-legal { color: var(--ct-muted); font-weight: 600; }
.ct-footer-powered a {
    color: var(--ct-muted);
}
.ct-footer-powered a:hover {
    color: var(--ct-primary);
}

/* Social icons (WhatsApp) in footer brand column */
.ct-footer-social { display: flex; gap: .5rem; margin-top: .85rem; }
.ct-social-link {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ct-surface-2);
    border: 1px solid var(--ct-border);
    color: var(--ct-muted);
    transition: var(--ct-transition);
}
.ct-social-link svg { width: 18px; height: 18px; display: block; }
.ct-social-link.wa {
    color: #25D366;
    background: rgba(37, 211, 102, .12);
    border-color: rgba(37, 211, 102, .25);
}
.ct-social-link.wa:hover {
    color: #fff;
    background: #25D366;
    border-color: #25D366;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, .35);
}

/* Footer responsive */
@media (max-width: 991.98px) {
    .ct-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ct-footer-brand {
        grid-column: 1 / -1;
    }
}
@media (max-width: 575.98px) {
    .ct-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Responsive (mobile-first: tablet & phone)
   ========================================================================== */
@media (max-width: 991.98px) {
    /* Sidebar becomes a drawer */
    .ct-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--ct-shadow-lg);
    }
    body.ct-sidebar-open .ct-sidebar {
        transform: translateX(0);
    }
    body.ct-sidebar-open .ct-sidebar-overlay {
        display: block;
    }
    .ct-sidebar-toggle {
        display: inline-flex;
    }
    .ct-main {
        margin-left: 0;
        padding: 1.2rem 1rem 2.5rem;
    }
    .right_content .cards,
    .ct-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .ct-title h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .ct-appbar {
        padding: 0 .85rem;
    }
    .ct-brand {
        font-size: 1.05rem;
    }
    .right_content .cards,
    .ct-cards-row {
        grid-template-columns: 1fr;
    }
    .ct-overview-card {
        padding: 1.05rem 1.1rem;
    }
    .ct-main {
        padding: 1rem .85rem 2rem;
    }
    /* Hide user name text on very small screens, keep icon */
    .ct-user-name {
        display: none;
    }
}

/* ==========================================================================
   Utility helpers
   ========================================================================== */
.ct-hidden {
    display: none !important;
}

/* ==========================================================================
   Auth pages (show_header=false, e.g. login) — centered card
   ========================================================================== */
.ct-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(900px 420px at 50% -10%, var(--ct-bg-grad-1), transparent 60%),
        var(--ct-bg);
}
.ct-auth_card,
.ct-auth-card {
    width: 100%;
    max-width: 520px;
}
.ct-auth-card .panel,
.ct-auth-card .card {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-lg);
    box-shadow: var(--ct-shadow-lg);
}

/* ==========================================================================
   Auth / login page extras
   ========================================================================== */
.ct-login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}
.ct-login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--ct-primary), var(--ct-accent));
    box-shadow: 0 8px 24px rgba(47, 107, 255, .28);
    margin-bottom: 1.1rem;
}
.ct-login-mark {
    color: #fff;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}
.ct-login-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -.4px;
    margin: 0 0 .35rem;
    color: var(--ct-text);
}
.ct-login-subtitle {
    color: var(--ct-muted);
    font-size: .92rem;
    margin: 0;
}

.ct-login-card {
    margin-bottom: 1.25rem;
}
.ct-login-card .panel-body {
    padding: 1.6rem 1.6rem 1.4rem;
}
.ct-login-form .form-group {
    margin-bottom: 1.05rem;
}
.ct-login-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ct-muted);
    margin-bottom: .35rem;
}
.ct-login-input {
    height: 46px;
    padding: .6rem 1rem;
    font-size: .92rem;
}
.ct-login-input:focus {
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}

.ct-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .2rem 0 1.1rem;
}
.ct-login-remember {
    margin: 0;
}
.ct-login-remember label {
    font-size: .85rem;
    color: var(--ct-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
}
.ct-login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ct-primary);
    cursor: pointer;
}

.ct-login-submit {
    height: 46px;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .2px;
    border-radius: 10px;
}
.ct-login-submit i {
    margin-right: .4rem;
}

.ct-login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1rem 1.6rem;
    background: transparent;
    border-top: 1px solid var(--ct-border);
}
.ct-login-link {
    color: var(--ct-muted);
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--ct-transition);
}
.ct-login-link:hover {
    color: var(--ct-primary);
    text-decoration: none;
}
.ct-login-link i {
    margin-right: .3rem;
}

.ct-login-back {
    text-align: center;
}
.ct-login-back .ct-login-link {
    color: var(--ct-faint);
}
.ct-login-back .ct-login-link:hover {
    color: var(--ct-primary);
}

/* Compact message/alert inside login card */
.ct-login-card .alert {
    margin-bottom: 1rem;
    padding: .8rem 1rem;
    font-size: .86rem;
}

@media (max-width: 575.98px) {
    .ct-auth {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    .ct-login-card .panel-body {
        padding: 1.25rem;
    }
    .ct-login-footer {
        padding: .85rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Dashboard: card container (filled via Blesta AJAX .blestaLoadCards)
   ========================================================================== */
.right_content .cards,
.ct-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
    margin-bottom: 1.4rem;
}
.right_content .cards > div,
.right_content .cards .col-md-3,
.right_content .cards .col-md-4,
.right_content .cards .col-md-6 {
    max-width: 100%;
    flex: none;
    padding: 0;
}

/* ==========================================================================
   Order form: package cards (grouped by datacenter, grid layout)
   ========================================================================== */
.ct-loc-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 1.6rem 0 .9rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--ct-border);
}
.ct-loc-head:first-of-type { margin-top: .25rem; }
.ct-loc-flag { font-size: 1.9rem; line-height: 1; }
.ct-loc-city { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--ct-text); }

.ct-pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.ct-pkg-card {
    display: flex;
    flex-direction: column;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: 16px;
    padding: 1.15rem 1.15rem 1rem;
    box-shadow: var(--ct-shadow);
    transition: transform var(--ct-transition), box-shadow var(--ct-transition), border-color var(--ct-transition);
}
.ct-pkg-card:hover {
    transform: translateY(-3px);
    border-color: var(--ct-primary);
    box-shadow: var(--ct-shadow-lg);
}

.ct-pkg-top { margin-bottom: .55rem; }
.ct-pkg-name { margin: 0; font-size: 1.08rem; font-weight: 700; color: var(--ct-text); }
.ct-pkg-sub { display: block; margin-top: .15rem; font-size: .72rem; letter-spacing: .3px; color: var(--ct-faint); }

.ct-pkg-desc { flex: 1 1 auto; margin-bottom: .9rem; color: var(--ct-muted); font-size: .82rem; line-height: 1.5; }
.ct-pkg-desc ul { list-style: none; margin: 0; padding: 0; }
.ct-pkg-desc li { padding: .22rem 0; border-bottom: 1px dashed var(--ct-border); }
.ct-pkg-desc li:last-child { border-bottom: 0; }
.ct-pkg-desc li strong { color: var(--ct-text); }

.ct-pkg-foot { margin-top: auto; display: flex; align-items: center; }
.ct-pkg-foot .btn.disabled,
.ct-pkg-foot .btn[disabled] { opacity: .65; }
.ct-pkg-price { display: flex; align-items: center; gap: .5rem; width: 100%; }
.ct-pkg-price .form-control { flex: 1 1 auto; min-width: 0; }
.ct-pkg-price .btn { white-space: nowrap; flex: 0 0 auto; }

/* ==========================================================================
   Service Manage page — modern redesign (2026-08-28)
   --------------------------------------------------------------------------
   Replaces the stock Blesta Bootstrap panels for /client/services/manage/N
   with a hero + stats-grid + action layout that matches the CloudTek theme.
   ========================================================================== */

/* ===== Page layout: side tabs + main content ===== */
.ct-svc-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 991.98px) {
    .ct-svc-layout {
        grid-template-columns: 1fr;
    }
}
.ct-svc-layout-side {
    position: sticky;
    top: calc(var(--ct-appbar-h) + 1rem);
}
@media (max-width: 991.98px) {
    .ct-svc-layout-side {
        position: static;
    }
}
.ct-svc-layout-main {
    min-width: 0;
}

/* Hide widget's own title on the manage page — the page header already shows
   the service name, so the card-header becomes redundant. */
#client_services_manage .card-header {
    display: none;
}
#client_services_manage .card-body {
    padding: 0;
}

/* ===== Tabs (vertical pill nav) ===== */
.ct-svc-tabs {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .5rem;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-lg);
    box-shadow: var(--ct-shadow);
}
.ct-svc-tab {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .85rem;
    border-radius: 8px;
    color: var(--ct-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
    transition: background .18s ease, color .18s ease;
}
.ct-svc-tab i {
    width: 1.1rem;
    text-align: center;
    color: var(--ct-faint);
    transition: color .18s ease;
}
.ct-svc-tab:hover {
    background: var(--ct-surface-2);
    color: var(--ct-text);
    text-decoration: none;
}
.ct-svc-tab:hover i {
    color: var(--ct-primary);
}
.ct-svc-tab.active {
    background: var(--ct-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 107, 255, .25);
}
.ct-svc-tab.active i {
    color: #fff;
}

/* ===== Service card ===== */
.ct-svc {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-lg);
    box-shadow: var(--ct-shadow);
    overflow: hidden;
}

/* ---- HERO ---- */
.ct-svc-hero {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.85rem 1.85rem 1.55rem;
    background:
        radial-gradient(800px 220px at 100% 0%, var(--ct-bg-grad-1), transparent 60%),
        linear-gradient(180deg, var(--ct-surface-2), var(--ct-surface));
    border-bottom: 1px solid var(--ct-border);
}
@media (max-width: 575.98px) {
    .ct-svc-hero {
        flex-direction: column;
        padding: 1.25rem;
    }
}
.ct-svc-hero-main {
    flex: 1;
    min-width: 0;
}
.ct-svc-package {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .28rem .7rem;
    background: var(--ct-primary-soft);
    color: var(--ct-primary);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .7rem;
}
.ct-svc-package i { font-size: .7rem; }
.ct-svc-name {
    margin: 0 0 .75rem;
    font-size: 1.6rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--ct-text);
    word-break: break-word;
}
@media (max-width: 575.98px) {
    .ct-svc-name { font-size: 1.35rem; }
}
.ct-svc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: var(--ct-muted);
    font-size: .85rem;
}
.ct-svc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.ct-svc-meta-item i { color: var(--ct-faint); }
.ct-svc-meta-item strong {
    color: var(--ct-text);
    font-weight: 600;
    margin-left: .25rem;
}
.ct-svc-hero-side {
    flex-shrink: 0;
}

/* ---- Status pill ---- */
.ct-svc-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1;
    text-transform: capitalize;
    background: var(--ct-surface-2);
    color: var(--ct-muted);
    border: 1px solid var(--ct-border);
}
.ct-svc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .04);
    animation: ct-svc-pulse 2s ease-in-out infinite;
}
@keyframes ct-svc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}
.ct-svc-status-success {
    color: var(--ct-success);
    background: rgba(22, 185, 129, .10);
    border-color: rgba(22, 185, 129, .25);
}
.ct-svc-status-warning {
    color: var(--ct-warning);
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .28);
}
.ct-svc-status-danger {
    color: var(--ct-danger);
    background: rgba(239, 68, 68, .10);
    border-color: rgba(239, 68, 68, .25);
}
.ct-svc-status-info {
    color: var(--ct-info);
    background: rgba(14, 165, 233, .10);
    border-color: rgba(14, 165, 233, .25);
}

/* ---- Stats grid ---- */
.ct-svc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--ct-border);
}
@media (max-width: 767.98px) {
    .ct-svc-stats {
        grid-template-columns: 1fr;
    }
}
.ct-svc-stat {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.35rem 1.5rem;
    border-right: 1px solid var(--ct-border);
}
.ct-svc-stat:last-child { border-right: none; }
@media (max-width: 767.98px) {
    .ct-svc-stat {
        border-right: none;
        border-bottom: 1px solid var(--ct-border);
    }
    .ct-svc-stat:last-child { border-bottom: none; }
}
.ct-svc-stat-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1rem;
}
.ct-svc-stat-icon-primary {
    background: var(--ct-primary-soft);
    color: var(--ct-primary);
}
.ct-svc-stat-icon-accent {
    background: var(--ct-accent-soft);
    color: var(--ct-accent);
}
.ct-svc-stat-icon-success {
    background: rgba(22, 185, 129, .12);
    color: var(--ct-success);
}
.ct-svc-stat-body {
    flex: 1;
    min-width: 0;
}
.ct-svc-stat-label {
    color: var(--ct-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .3rem;
}
.ct-svc-stat-value {
    color: var(--ct-text);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}
.ct-svc-stat-extra {
    margin-top: .35rem;
    color: var(--ct-success);
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

/* ---- Sections ---- */
.ct-svc-section {
    padding: 1.5rem 1.85rem;
    border-top: 1px solid var(--ct-border);
}
.ct-svc-section:first-of-type { border-top: none; }
.ct-svc-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--ct-text);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 1rem;
}
.ct-svc-section-title i { color: var(--ct-primary); }

/* ---- Configurable options ---- */
.ct-svc-options {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.ct-svc-option {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 2fr auto;
    gap: 1rem;
    align-items: center;
    padding: .8rem 1rem;
    background: var(--ct-surface-2);
    border-radius: 10px;
    border: 1px solid var(--ct-border);
}
@media (max-width: 575.98px) {
    .ct-svc-option {
        grid-template-columns: 1fr;
        gap: .35rem;
    }
}
.ct-svc-option-label {
    color: var(--ct-muted);
    font-size: .85rem;
    font-weight: 600;
}
.ct-svc-option-value {
    color: var(--ct-text);
    font-size: .9rem;
    word-break: break-word;
}
.ct-svc-option-price {
    color: var(--ct-text);
    font-size: .9rem;
    font-weight: 600;
    text-align: right;
}

/* ---- Actions ---- */
.ct-svc-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .65rem;
}
.ct-svc-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: var(--ct-surface-2);
    border: 1px solid var(--ct-border);
    border-radius: 10px;
    color: var(--ct-text);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease, color .18s ease;
}
.ct-svc-action:hover {
    background: var(--ct-surface);
    border-color: var(--ct-primary);
    color: var(--ct-primary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 107, 255, .12);
}
.ct-svc-action i {
    color: var(--ct-primary);
    font-size: .9rem;
}
.ct-svc-action.btn-danger,
.ct-svc-action.cancel_service {
    background: rgba(239, 68, 68, .08);
    border-color: rgba(239, 68, 68, .25);
    color: var(--ct-danger);
}
.ct-svc-action.btn-danger i,
.ct-svc-action.cancel_service i { color: var(--ct-danger); }
.ct-svc-action.btn-danger:hover,
.ct-svc-action.cancel_service:hover {
    background: var(--ct-danger);
    border-color: var(--ct-danger);
    color: #fff;
}
.ct-svc-action.btn-danger:hover i,
.ct-svc-action.cancel_service:hover i { color: #fff; }
