/* Direto Client Area Shell CSS */

:root {
    --direto-bg: #080C10;
    --direto-sidebar: #0B0F14;
    --direto-surface: #11161D;
    --direto-surface-hover: #151C24;

    --direto-border: rgba(255,255,255,.08);

    --direto-text: #F5F7F6;
    --direto-text-secondary: #9CA3AF;
    --direto-text-muted: #6B7280;

    --direto-green: #22C55E;
    --direto-green-bright: #39FF88;

    --direto-danger: #EF4444;
    --direto-warning: #F59E0B;
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

/* Reset for Client Area Shell */
body.direto-clientarea {
    margin: 0;
    padding: 0;
    background-color: var(--direto-bg);
    color: var(--direto-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Shell Layout */
.direto-shell {
    display: flex;
    width: 100%;
}

/* Sidebar */
.direto-sidebar {
    width: var(--sidebar-width);
    background-color: var(--direto-sidebar);
    border-right: 1px solid var(--direto-border);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.direto-sidebar__header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--direto-border);
}

.direto-sidebar__logo img {
    height: 32px;
    width: auto;
    display: block;
}

.direto-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.direto-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--direto-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.direto-sidebar__link:hover {
    background-color: var(--direto-surface);
    color: var(--direto-text);
}

.direto-sidebar__link.is-active {
    background-color: rgba(34,197,94,.08);
    color: #FFFFFF;
    position: relative;
}

.direto-sidebar__link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 4px;
    background-color: var(--direto-green);
    border-radius: 0 4px 4px 0;
}

.direto-sidebar__link.is-active i[data-lucide] {
    color: var(--direto-green);
}

.direto-sidebar__link i[data-lucide] {
    width: 20px;
    height: 20px;
}

/* CTA */
.direto-sidebar__cta {
    margin-top: 16px;
    background-color: var(--direto-green);
    color: #080C10 !important;
}
.direto-sidebar__cta:hover {
    background-color: var(--direto-green-bright);
}

/* Main Content Area */
.direto-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100%;
}

/* Topbar */
.direto-topbar {
    height: var(--topbar-height);
    background-color: var(--direto-sidebar);
    border-bottom: 1px solid var(--direto-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.direto-topbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.direto-topbar__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--direto-text);
    margin: 0;
}

.direto-topbar__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--direto-text);
    cursor: pointer;
    padding: 8px;
}

.direto-topbar__right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.direto-topbar__notifications {
    background: none;
    border: none;
    color: var(--direto-text-secondary);
    cursor: pointer;
    position: relative;
    padding: 8px;
}
.direto-topbar__notifications:hover {
    color: var(--direto-text);
}

.direto-topbar__account {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--direto-text);
    padding: 4px;
}

.direto-topbar__avatar {
    width: 36px;
    height: 36px;
    background-color: var(--direto-surface);
    border: 1px solid var(--direto-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--direto-green);
}

.direto-topbar__user-info {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.direto-topbar__name {
    font-size: 14px;
    font-weight: 500;
}

/* Dropdown */
.direto-dropdown {
    position: relative;
}
.direto-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: var(--direto-surface);
    border: 1px solid var(--direto-border);
    border-radius: 8px;
    width: 200px;
    padding: 8px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
}
.direto-dropdown.is-open .direto-dropdown-menu {
    display: flex;
}
.direto-dropdown-item {
    padding: 10px 16px;
    color: var(--direto-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}
.direto-dropdown-item:hover {
    background-color: var(--direto-surface-hover);
    color: var(--direto-text);
}

/* WHMCS Content Wrapper */
.direto-content-wrapper {
    padding: 32px;
    flex: 1;
    overflow-x: hidden;
}

/* Emergency Responsive Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--direto-surface);
    border-radius: 8px;
    border: 1px solid var(--direto-border);
    margin-bottom: 24px;
}

/* WHMCS Legacy Resets inside Wrapper */
.direto-content-wrapper h1, .direto-content-wrapper h2, .direto-content-wrapper h3 {
    color: var(--direto-text);
}
.direto-content-wrapper p {
    color: var(--direto-text-secondary);
}
.direto-content-wrapper a:not(.btn) {
    color: var(--direto-green);
    text-decoration: none;
}
.direto-content-wrapper a:not(.btn):hover {
    text-decoration: underline;
}

/* WHMCS standard table overrides */
.direto-content-wrapper table.table {
    width: 100%;
    margin-bottom: 0;
    color: var(--direto-text-secondary);
    border-collapse: collapse;
}
.direto-content-wrapper table.table th {
    background-color: var(--direto-surface-hover);
    color: var(--direto-text);
    border-bottom: 1px solid var(--direto-border);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}
.direto-content-wrapper table.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--direto-border);
    vertical-align: middle;
}
.direto-content-wrapper table.table tr:hover td {
    background-color: rgba(255,255,255,0.02);
}

/* Mobile Responsiveness */
.direto-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    z-index: 95;
    backdrop-filter: blur(4px);
}

@media (max-width: 991px) {
    .direto-main {
        margin-left: 0;
    }
    
    .direto-sidebar {
        transform: translateX(-100%);
    }
    
    .direto-sidebar.is-open {
        transform: translateX(0);
    }
    
    .direto-sidebar.is-open ~ .direto-sidebar-overlay {
        display: block;
    }
    
    .direto-topbar__toggle {
        display: block;
    }
    
    .direto-content-wrapper {
        padding: 20px;
    }
}
