/* ==========================================================================
   ZENODIX CLIENT HUB - STRICT CLEAN CORPORATE UI
   ========================================================================== */

:root {
    --primary: #125191;
    --primary-hover: #0d4076;
    --success: #00a94f;
    --success-bg: rgba(0, 169, 79, 0.1);
    --bg-color: #F4F7FE;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   TYPOGRAPHY & UTILS
   ========================================================================== */
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-main); }
p { color: var(--text-muted); line-height: 1.5; }
.mt-auto { margin-top: auto; }
.p-0 { padding: 0 !important; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-secondary:hover {
    background-color: rgba(18, 81, 145, 0.05);
}
.btn-full { width: 100%; }

.icon-btn, .icon-btn-small {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.icon-btn { padding: 8px; }
.icon-btn-small { padding: 4px; color: var(--primary); }
.icon-btn:hover { background: var(--bg-color); color: var(--primary); }
.icon-btn-small:hover { background: rgba(18, 81, 145, 0.1); }

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

.sidebar.show {
    transform: translateX(0);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}
.logo-box {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}
.logo-icon { font-size: 28px; font-weight: 700; }
.logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.5px; }

.mobile-close-btn { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; display: block; }

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-item:hover {
    background-color: var(--bg-color);
    color: var(--primary);
}
.nav-item.active {
    background-color: var(--primary);
    color: white;
}
.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ==========================================================================
   MAIN CONTENT & HEADER
   ========================================================================== */
.main-content {
    flex: 1;
    width: 100%;
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.top-header {
    height: var(--header-height);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 90;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.menu-btn { background: none; border: none; color: var(--text-main); font-size: 24px; cursor: pointer; }
.greeting h2 { font-size: 1.2rem; margin-bottom: 2px; }
.greeting p { font-size: 0.8rem; }

.header-right { display: flex; align-items: center; gap: 16px; }
.date-selector {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}
.date-selector select { border: none; background: transparent; outline: none; color: var(--text-main); font-weight: 500;}

.action-btn { position: relative; }
.badge {
    position: absolute;
    top: 0; right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.user-profile { display: flex; align-items: center; gap: 10px; cursor: pointer;}
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem;
}
.user-info { display: none; flex-direction: column; }
.user-info .user-name { font-weight: 600; font-size: 0.9rem; }
.user-info .user-role { font-size: 0.75rem; color: var(--text-muted); }

/* ==========================================================================
   VIEWS WRAPPER
   ========================================================================== */
.views-wrapper {
    padding: 24px;
    flex: 1;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
}
.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcfcfc;
}
.card-title { font-size: 1.05rem; }
.card-body { padding: 20px; }

/* ==========================================================================
   VISTA 1: DASHBOARD
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.metric-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.metric-icon-box {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.metric-icon-box span { font-size: 26px; }
.metric-label { font-size: 0.85rem; margin-bottom: 4px; }
.metric-value { font-size: 1.4rem; color: var(--text-main); }

.chart-container { width: 100%; }

/* ==========================================================================
   VISTA 2: OMNICHANNEL
   ========================================================================== */
.omni-container {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px dashed #cbd5e1;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}
.placeholder-icon {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 16px;
}
.placeholder-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 500;
}
.placeholder-subtext { max-width: 400px; margin-top: 8px; font-size: 0.9rem;}

/* ==========================================================================
   VISTA 3: SOCIAL AI GENERATOR
   ========================================================================== */
.split-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: stretch;
}

.drag-drop-zone {
    border: 2px dashed var(--primary);
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 20px;
    transition: 0.2s;
}
.drag-drop-zone:hover { background: #e0e7ff; }
.dz-icon { font-size: 40px; color: var(--primary); margin-bottom: 10px; }
.dz-text { font-size: 0.9rem; font-weight: 500; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    resize: vertical;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
}
.form-group textarea:focus { border-color: var(--primary); }

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.tab {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.preview-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
}
.mockup-img {
    height: 180px;
    background: #e2e8f0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.9rem;
}
.mockup-text { padding: 16px; font-size: 0.85rem; }
.mockup-text p { margin-bottom: 8px; }
.mockup-text p:last-child { color: var(--primary); font-weight: 500; }

/* ==========================================================================
   VISTA 4: LOGISTICS
   ========================================================================== */
.logistics-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.btn-action {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: left;
    cursor: pointer;
    gap: 16px;
    transition: 0.2s;
    box-shadow: var(--shadow-sm);
}
.btn-action:hover {
    background: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-action .btn-icon {
    width: 48px; height: 48px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.btn-action.secondary .btn-icon {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-text strong { display: block; font-size: 1rem; color: var(--primary); margin-bottom: 4px;}
.btn-text span { font-size: 0.8rem; color: var(--text-muted); }

.table-responsive { width: 100%; overflow-x: auto; }
.data-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}
.data-grid th, .data-grid td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.data-grid th {
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.data-grid tr:hover { background: #f8fafc; }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.primary { background: rgba(18, 81, 145, 0.1); color: var(--primary); }
.badge.warning { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.badge.info { background: rgba(56, 189, 248, 0.1); color: #0284c7; }

/* ==========================================================================
   MEDIA QUERIES (DESKTOP)
   ========================================================================== */
@media (min-width: 768px) {
    .sidebar { transform: translateX(0); }
    .mobile-close-btn, .menu-btn { display: none; }
    
    .main-content { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); }
    
    .date-selector { display: flex; }
    .user-info { display: flex; }
    
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    
    .split-layout { grid-template-columns: 1fr 1fr; }
    .split-col { height: 100%; }
    
    .logistics-actions { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .metrics-grid { grid-template-columns: repeat(4, 1fr); }
}
