/* ========================================================
   DigiTech AI Marketing OS - Main Stylesheet
   Modern AI SaaS Dashboard Design
   ======================================================== */

:root {
    --dt-primary: #4f46e5;
    --dt-primary-hover: #4338ca;
    --dt-primary-light: #eef2ff;
    --dt-secondary: #0ea5e9;
    --dt-dark: #0f172a;
    --dt-sidebar-bg: #111827;
    --dt-sidebar-hover: #1f2937;
    --dt-sidebar-active: #374151;
    --dt-sidebar-text: #9ca3af;
    --dt-sidebar-text-active: #ffffff;
    --dt-body-bg: #f8fafc;
    --dt-card-bg: #ffffff;
    --dt-border: #e2e8f0;
    --dt-border-light: #f1f5f9;
    --dt-text-main: #1e293b;
    --dt-text-muted: #64748b;
    --dt-success: #10b981;
    --dt-warning: #f59e0b;
    --dt-danger: #ef4444;
    --dt-radius: 10px;
    --dt-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--dt-body-bg);
    color: var(--dt-text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* --------------------------------------------------------
   Layout Structure
   -------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 260px;
    background-color: var(--dt-sidebar-bg);
    color: var(--dt-sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: var(--dt-transition);
    z-index: 1040;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--dt-body-bg);
}

.app-topbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--dt-border);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-content {
    flex: 1;
    padding: 1.75rem 1.5rem;
}

/* --------------------------------------------------------
   Sidebar Elements
   -------------------------------------------------------- */
.sidebar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.2px;
}

.sidebar-brand-badge {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: #6b7280;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    color: var(--dt-sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--dt-transition);
}

.sidebar-link:hover {
    background-color: var(--dt-sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background-color: var(--dt-primary);
    color: #ffffff;
}

.sidebar-link svg {
    margin-right: 0.75rem;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.sidebar-badge-soon {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #6b7280;
}

/* --------------------------------------------------------
   Cards & Content Elements
   -------------------------------------------------------- */
.card-dt {
    background: var(--dt-card-bg);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
    transition: var(--dt-transition);
}

.card-dt-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--dt-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-dt-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dt-text-main);
    margin: 0;
}

.card-dt-body {
    padding: 1.25rem;
}

/* KPI Stat Cards */
.kpi-card {
    background: #ffffff;
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    transition: var(--dt-transition);
}

.kpi-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dt-text-muted);
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dt-text-main);
    line-height: 1.2;
}

.kpi-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon-primary { background: #eef2ff; color: #4f46e5; }
.kpi-icon-success { background: #ecfdf5; color: #10b981; }
.kpi-icon-info    { background: #e0f2fe; color: #0284c7; }
.kpi-icon-warning { background: #fffbeb; color: #d97706; }
.kpi-icon-purple  { background: #f5f3ff; color: #7c3aed; }

/* Empty State Component */
.empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #ffffff;
    border: 1px dashed var(--dt-border);
    border-radius: var(--dt-radius);
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem auto;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dt-text-main);
    margin-bottom: 0.35rem;
}

.empty-state-description {
    font-size: 0.875rem;
    color: var(--dt-text-muted);
    max-width: 440px;
    margin: 0 auto 1.25rem auto;
}

/* Forms & Inputs */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border-color: #cbd5e1;
    border-radius: 7px;
    font-size: 0.9rem;
    padding: 0.55rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--dt-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-text {
    font-size: 0.775rem;
    color: var(--dt-text-muted);
}

/* Buttons */
.btn-primary-dt {
    background-color: var(--dt-primary);
    border-color: var(--dt-primary);
    color: #ffffff;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 7px;
    transition: var(--dt-transition);
}

.btn-primary-dt:hover {
    background-color: var(--dt-primary-hover);
    border-color: var(--dt-primary-hover);
    color: #ffffff;
}

/* --------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -260px;
    }
    
    .app-sidebar.show {
        left: 0;
    }

    .sidebar-overlay.show {
        display: block;
    }
}
