/* Kliyente Suite Branding - Purple Gradient Theme */

/* Primary Colors */
:root {
    --kliyente-primary: #7B4FFF;
    --kliyente-secondary: #A88BFF;
    --kliyente-gradient: linear-gradient(135deg, #7B4FFF 0%, #A88BFF 100%);
}

/* Header/Navbar Branding */
.navbar-default {
    background: var(--kliyente-gradient) !important;
    border-color: var(--kliyente-primary);
}

.navbar-default .navbar-brand,
.navbar-default .navbar-nav > li > a {
    color: #ffffff !important;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
    color: #f0f0f0 !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.navbar-default .navbar-toggle {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-default .navbar-toggle .icon-bar {
    background-color: #ffffff;
}

.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Menu */
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
    color: #333;
}

.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover {
    background-color: var(--kliyente-primary);
    color: #ffffff;
}

/* Buttons */
.btn-primary {
    background: var(--kliyente-gradient);
    border-color: var(--kliyente-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--kliyente-primary);
    border-color: var(--kliyente-primary);
}

/* Links */
a {
    color: var(--kliyente-primary);
}

a:hover,
a:focus {
    color: var(--kliyente-secondary);
}

/* Progress Bars */
.progress-bar-primary {
    background-color: var(--kliyente-primary);
}

/* Panel Headings */
.panel-primary > .panel-heading {
    background: var(--kliyente-gradient);
    border-color: var(--kliyente-primary);
}

/* Badges */
.badge-primary {
    background-color: var(--kliyente-primary);
}

/* Charts - Primary Color */
.text-primary-600 {
    color: var(--kliyente-primary) !important;
}

/* Custom Purple Gradient Background */
.bg-kliyente-gradient {
    background: var(--kliyente-gradient);
}

/* Footer */
.footer {
    border-top: 2px solid var(--kliyente-primary);
}

.footer a {
    color: var(--kliyente-primary);
}

/* Active States */
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
    background-color: var(--kliyente-primary);
}

/* Form Focus States */
.form-control:focus {
    border-color: var(--kliyente-primary);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(123, 79, 255, 0.3);
}

/* Service Request Cards */
.panel-default:hover {
    border-color: var(--kliyente-primary);
    box-shadow: 0 2px 8px rgba(123, 79, 255, 0.2);
}

/* Onboarding Steps */
.nav-pills > li.active > a {
    background: var(--kliyente-gradient);
}

/* ============================================
   SIDEBAR LAYOUT - Alibaba Style
   ============================================ */

/* Layout Structure */
.kliyente-layout {
    display: flex;
    min-height: calc(100vh - 60px);
    margin-top: 60px;
}

.kliyente-main-content {
    flex: 1;
    margin-left: 240px;
    background: #f8fafc;
    min-height: calc(100vh - 60px);
}

/* Only apply sidebar layout when navigation is enabled */
body:not(.no-sidebar) .kliyente-layout {
    display: flex;
}

body.no-sidebar .kliyente-layout {
    display: block;
    margin-left: 0;
    margin-top: 0;
}

.content-wrapper {
    padding: 20px 30px;
}

/* Header */
.kliyente-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    max-width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 32px;
    width: auto;
}

/* Fix client portal oversized logo in header - Match admin panel size */
body.customers .header-logo,
body.customers .header-left img,
body.customers .header-left .logo img,
body.customers .header-left .logo,
body.customers .header-left img.header-logo,
body.customers .header-left .logo img.img-responsive,
body.customers #logo img,
body.customers .navbar-brand img {
    max-height: 42px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
}

.header-brand {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    background: var(--kliyente-gradient);
}

/* Notifications Icon */
.header-notifications-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 10px;
}

.notifications-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}

.notifications-icon:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ef4444;
    color: #ffffff;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 0 5px;
    border: 2px solid #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    transition: background 0.2s;
}

.user-profile-link:hover {
    background: #f3f4f6;
    text-decoration: none;
    color: #374151;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

/* Sidebar */
.kliyente-sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 240px;
    height: calc(100vh - 60px);
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #f9fafb;
    color: #1f2937;
    text-decoration: none;
    border-left-color: var(--kliyente-primary);
}

.nav-item.active > .nav-link {
    background: #f3f4f6;
    color: var(--kliyente-primary);
    font-weight: 500;
    border-left-color: var(--kliyente-primary);
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
    color: #6b7280;
}

.nav-item.active > .nav-link i,
.nav-link:hover i {
    color: var(--kliyente-primary);
}

.nav-text {
    flex: 1;
}

.nav-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
    color: #9ca3af;
}

.nav-link.expanded .nav-arrow {
    transform: rotate(90deg);
}

/* Submenu */
.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f9fafb;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-submenu.show {
    max-height: 500px;
}

.nav-submenu li {
    margin: 0;
}

.nav-submenu a {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 52px;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-submenu a:hover {
    background: #f3f4f6;
    color: var(--kliyente-primary);
    text-decoration: none;
    border-left-color: var(--kliyente-primary);
}

.nav-submenu a.active {
    background: #f3f4f6;
    color: var(--kliyente-primary);
    font-weight: 500;
    border-left-color: var(--kliyente-primary);
}

.nav-submenu a i {
    width: 18px;
    margin-right: 10px;
    font-size: 14px;
}

.nav-submenu .divider {
    height: 1px;
    margin: 8px 20px;
    background: #e5e7eb;
    list-style: none;
}

/* Responsive */
@media (max-width: 768px) {
    .kliyente-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .kliyente-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .kliyente-main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 15px;
    }
}

/* Hide old navbar */
.navbar-default.header {
    display: none;
}

/* Adjust body padding for sidebar */
body.customers {
    padding-top: 0;
}

/* Hide sidebar and header on pages without navigation - handled by PHP conditional */
/* When sidebar is not present, layout should be normal */
.kliyente-header:only-child,
.kliyente-sidebar:only-child {
    display: none;
}

/* ============================================
   CLIENT DASHBOARD HOME PAGE STYLING
   ============================================ */

/* Logo Styling - Small Hero Header - Centered, Max 120px */
.kliyente-logo {
    max-height: 120px;
    max-width: 120px;
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto 20px;
    object-fit: contain;
}

/* Dashboard Container - Match Original Structure */
.section-client-dashboard {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Small Hero Header - Centered, Clean Spacing */
.kliyente-hero {
    padding: 30px 0 25px;
    text-align: center;
    margin-bottom: 40px;
    border-bottom: none;
}

.hero-greeting-text {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
    text-align: center;
}

.hero-greeting-text b {
    font-weight: 600;
}

/* Projects Summary Heading - Match Original */
.projects-summary-heading {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin-top: 28px;
    margin-bottom: 16px;
}

/* Invoices Quick Info Heading - Match Original */
.invoices-quick-info-heading {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin-top: 28px;
    margin-bottom: 0;
}

.invoices-quick-info-heading + .view-statement-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--kliyente-primary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.invoices-quick-info-heading + .view-statement-link:hover {
    color: var(--kliyente-secondary);
    text-decoration: underline;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header .section-heading {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.view-statement-link {
    color: var(--kliyente-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--kliyente-primary);
    background: transparent;
}

.view-statement-link:hover {
    color: #ffffff;
    background: var(--kliyente-primary);
    text-decoration: none;
    border-color: var(--kliyente-primary);
}

/* Projects Summary Cards - Modern Design */
.section-client-dashboard .tw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.section-client-dashboard .tw-grid a {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
    height: 100%;
}

.section-client-dashboard .tw-grid a:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--kliyente-primary);
    text-decoration: none;
}

.section-client-dashboard .tw-grid dt {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #6b7280;
}

.section-client-dashboard .tw-grid dd {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
}

/* Invoices Stats - Clean Card Design */
.invoices-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.invoices-stats > div {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.invoices-stats .stats-status {
    margin-bottom: 12px;
}

.invoices-stats .stats-status a {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
}

.invoices-stats .stats-status a:hover {
    color: var(--kliyente-primary);
}

.invoices-stats .stats-numbers {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.invoices-stats .progress {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.invoices-stats .progress-bar {
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Chart Container - Proper Padding */
.section-client-dashboard .panel_s {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 16px;
}

.section-client-dashboard .panel-body {
    padding: 30px;
}

.section-client-dashboard .panel-body hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.section-client-dashboard .relative,
.section-client-dashboard .chart-container-wrapper {
    padding: 24px;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-client-dashboard canvas {
    max-height: 400px;
    width: 100% !important;
    height: auto !important;
}

/* Footer Styling */
.footer {
    margin-top: 60px;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    font-size: 14px;
}

/* Responsive Hero */
@media (max-width: 768px) {
    .kliyente-hero {
        padding: 25px 0 20px;
    }
    
    .kliyente-logo {
        max-height: 100px;
        max-width: 100px;
    }
    
    .hero-greeting-text {
        font-size: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .section-client-dashboard .tw-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .invoices-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .kliyente-hero {
        padding: 20px 0 15px;
    }
    
    .kliyente-logo {
        max-height: 80px;
        max-width: 80px;
    }
    
    .hero-greeting-text {
        font-size: 18px;
    }
    
    .section-client-dashboard .tw-grid {
        grid-template-columns: 1fr;
    }
}

/* Remove excessive white space */
.section-client-dashboard .row {
    margin-left: -15px;
    margin-right: -15px;
}

.section-client-dashboard .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* Ensure proper spacing in content wrapper */
.content-wrapper .section-client-dashboard {
    padding: 0;
}

/* ============================================
   AUTHENTICATION/LOGIN PAGE LOGO FIX
   ============================================ */

/* Fix oversized logos on login/authentication pages only */
body.authentication .authentication-logo img,
body.authentication .logo img {
    max-width: 120px !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

body.authentication .header-left img {
    max-width: 60px !important;
    height: auto !important;
    object-fit: contain !important;
}

