/* ============================================
   PLANNING PAGE — ERP Layout Layer
   Sits on top of style.css (Bootstrap-based)
   ============================================ */

:root {
    --bg-sidebar: #0f172a;
    --text-sidebar: #94a3b8;
    --border-color: #e2e8f0;
    --primary-blue: #3b82f6;
    --primary: #3b82f6;
    /* Alias for compatibility */
    --input-border: #cbd5e1;
    /* For consistency */

    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-md: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0 !important;
    padding-top: 0 !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    overflow: hidden;
}

/* ─── App Layout ─── */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ─── Sidebar (Standardized) ─── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 50;
    border-right: 1px solid #1e293b;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    border-bottom: 1px solid #1e293b;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.logo-text {
    font-weight: 700;
    color: #f8fafc;
    font-size: 16px;
    letter-spacing: -0.5px;
}

.nav-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #475569;
    margin-bottom: 8px;
    margin-top: 24px;
    padding-left: 12px;
}

.nav-label:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-weight: 500;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #1e293b;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: #334155;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.details {
    display: flex;
    flex-direction: column;
}

.details .name {
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 500;
}

.details .role {
    font-size: 11px;
    color: #64748b;
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    /* Push content */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ─── Topbar ─── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    min-height: 52px;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
}

.topbar-title i {
    color: var(--primary-blue);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #64748b;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Filter pills */
.filter-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 3px 8px;
}

.filter-pill i {
    color: #94a3b8;
    font-size: 11px;
}

.filter-pill select {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    outline: none;
    padding: 2px 4px;
    cursor: pointer;
}

/* Search pill */
.search-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 3px 10px;
    max-width: 160px;
}

.search-pill i {
    color: #94a3b8;
    font-size: 11px;
}

.search-pill input {
    border: none;
    background: transparent;
    font-size: 12px;
    outline: none;
    width: 100%;
    color: #334155;
}

/* Topbar buttons */
.topbar-btn {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.topbar-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.topbar-btn.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.topbar-btn.success:hover {
    background: #059669;
}

.topbar-btn.danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.topbar-btn.danger:hover {
    background: #dc2626;
}

.btn-label {
    display: inline;
}

.update-time {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ─── Content Scroll ─── */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-body {
    padding: 16px 20px 40px;
}

/* ─── Override old navbar style ─── */
.navbar {
    display: none !important;
}

/* ─── Loader inside ERP layout ─── */
#loader {
    z-index: 10000;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
    }

    .app-layout.sidebar-hidden .sidebar {
        margin-left: -220px;
    }

    .btn-label {
        display: none;
    }

    .topbar-title {
        font-size: 14px;
    }

    .filter-pill,
    .search-pill {
        display: none;
    }
}