/* ========================================
   PLANTIX - Manufacturing Admin Template
   Color Scheme: Steel Blue #1F4E79
   ======================================== */

:root {
    --primary: #1F4E79;
    --primary-dark: #163659;
    --primary-light: #2C6BA8;
    --primary-soft: #E8F0F8;
    --secondary: #37474F;
    --secondary-light: #546E7A;
    --accent: #FF7043;
    --success: #2E7D32;
    --success-light: #E8F5E9;
    --warning: #F57C00;
    --warning-light: #FFF3E0;
    --danger: #C62828;
    --danger-light: #FFEBEE;
    --info: #0288D1;
    --info-light: #E1F5FE;
    --dark: #1A2530;
    --gray-900: #212529;
    --gray-800: #343A40;
    --gray-700: #495057;
    --gray-600: #6C757D;
    --gray-500: #ADB5BD;
    --gray-400: #CED4DA;
    --gray-300: #DEE2E6;
    --gray-200: #E9ECEF;
    --gray-100: #F4F6F8;
    --gray-50: #F8F9FA;
    --white: #FFFFFF;
    --body-bg: #F2F5F9;
    --card-bg: #FFFFFF;
    --border-color: #E3E7ED;
    --text-primary: #1A2530;
    --text-secondary: #5A6878;
    --text-muted: #8A95A5;
    --header-height: 64px;
    --topbar-height: 38px;
    --menu-height: 52px;
    --footer-height: 50px;
    --sidebar-width: 260px;
    --shadow-sm: 0 1px 2px rgba(31, 78, 121, 0.05);
    --shadow-md: 0 2px 8px rgba(31, 78, 121, 0.08);
    --shadow-lg: 0 8px 24px rgba(31, 78, 121, 0.12);
    --shadow-xl: 0 16px 40px rgba(31, 78, 121, 0.15);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== BASE ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--body-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-bottom: 0; }

img { max-width: 100%; height: auto; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ====== LAYOUT ====== */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 24px;
    max-width: 100%;
}

.app-footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-footer .footer-links a {
    color: var(--text-secondary);
    margin-left: 16px;
    transition: var(--transition);
}

.app-footer .footer-links a:hover { color: var(--primary); }

/* ====== TOPBAR ====== */
.topbar {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.85);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 12.5px;
}

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

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

.topbar-left i { color: rgba(255, 255, 255, 0.7); font-size: 13px; }

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-right .topbar-link {
    color: rgba(255, 255, 255, 0.85);
    transition: var(--transition);
}

.topbar-right .topbar-link:hover { color: var(--white); }

.topbar-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ====== HEADER ====== */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    text-decoration: none;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(31, 78, 121, 0.25);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.brand-tagline {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.header-search {
    flex: 1;
    max-width: 420px;
    margin: 0 32px;
    position: relative;
}

.header-search input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border-color);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 0 16px 0 40px;
    font-size: 13px;
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.08);
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header-action-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.header-action-btn .badge-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger);
    color: var(--white);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover { background: var(--gray-100); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ====== HORIZONTAL MENU ====== */
.main-menu {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    height: var(--menu-height);
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: var(--header-height);
    z-index: 1010;
}

.menu-list {
    list-style: none;
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.menu-item {
    position: relative;
    height: 100%;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 100%;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.menu-link i { font-size: 15px; }

.menu-link .chevron {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.6;
}

.menu-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.menu-item.active > .menu-link {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: var(--transition);
    z-index: 1000;
}

.menu-item:hover > .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.menu-dropdown-link i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.menu-dropdown-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-left-color: var(--primary);
}

.menu-dropdown-link:hover i { color: var(--primary); }

.menu-dropdown-link.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-left-color: var(--primary);
    font-weight: 500;
}

.menu-mega {
    min-width: 580px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    left: 0;
}

.menu-mega.cols-3 { min-width: 720px; grid-template-columns: repeat(3, 1fr); left: auto; right: 0; }

/* ====== PAGE HEADER ====== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header-left h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.page-header-left .page-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.breadcrumb-modern {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 12.5px;
}

.breadcrumb-modern li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.breadcrumb-modern li:not(:last-child)::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    color: var(--gray-400);
}

.breadcrumb-modern a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.breadcrumb-modern a:hover { color: var(--primary); }

.breadcrumb-modern li.active { color: var(--primary); font-weight: 500; }

.page-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ====== BUTTONS ====== */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 16px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.4;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(31, 78, 121, 0.25);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--gray-800);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-light {
    background: var(--gray-100);
    color: var(--text-primary);
    border-color: var(--gray-200);
}

.btn-light:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

.btn-success { background: var(--success); color: var(--white); border-color: var(--success); }
.btn-success:hover { background: #1B5E20; color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); border-color: var(--warning); }
.btn-warning:hover { background: #E65100; color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { background: #B71C1C; color: var(--white); }
.btn-info { background: var(--info); color: var(--white); border-color: var(--info); }
.btn-info:hover { background: #0277BD; color: var(--white); }

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ====== CARDS ====== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
    font-size: 14px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-body { padding: 20px; }
.card-footer {
    padding: 14px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* ====== KPI / STAT CARDS ====== */
.stat-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 18px;
}

.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.stat-change.up { background: var(--success-light); color: var(--success); }
.stat-change.down { background: var(--danger-light); color: var(--danger); }
.stat-change.neutral { background: var(--gray-100); color: var(--text-secondary); }

/* ====== BADGES ====== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.4;
}

.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-secondary { background: var(--gray-100); color: var(--secondary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-dark { background: var(--gray-100); color: var(--dark); }

.badge-solid-primary { background: var(--primary); color: var(--white); }
.badge-solid-success { background: var(--success); color: var(--white); }
.badge-solid-warning { background: var(--warning); color: var(--white); }
.badge-solid-danger { background: var(--danger); color: var(--white); }

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ====== TABLES ====== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text-primary);
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--gray-50);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

.table-hover-primary tbody tr:hover { background: var(--primary-soft); }

.table-compact tbody td { padding: 10px 14px; }

.table-striped tbody tr:nth-child(even) { background: var(--gray-50); }

.table-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
    font-size: 12px;
}

.icon-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.icon-btn.danger:hover { background: var(--danger); border-color: var(--danger); }
.icon-btn.success:hover { background: var(--success); border-color: var(--success); }

/* ====== AVATAR ====== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }

.avatar.bg-primary { background: var(--primary); color: var(--white); }
.avatar.bg-secondary { background: var(--secondary); color: var(--white); }
.avatar.bg-success { background: var(--success); color: var(--white); }
.avatar.bg-warning { background: var(--warning); color: var(--white); }
.avatar.bg-danger { background: var(--danger); color: var(--white); }
.avatar.bg-info { background: var(--info); color: var(--white); }

.avatar-group {
    display: inline-flex;
    align-items: center;
}

.avatar-group .avatar {
    border: 2px solid var(--white);
    margin-left: -8px;
}

.avatar-group .avatar:first-child { margin-left: 0; }

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell-info {
    line-height: 1.3;
}

.user-cell-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.user-cell-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ====== FORMS ====== */
.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: block;
}

.form-label .required { color: var(--danger); }

.form-control,
.form-select {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}

textarea.form-control {
    height: auto;
    min-height: 90px;
    padding: 10px 12px;
    resize: vertical;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.08);
}

.form-text {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control { border-radius: 0; flex: 1; }
.input-group > :first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.input-group > :last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

.input-group-text {
    padding: 0 14px;
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
}

.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.form-switch .form-check-input {
    width: 36px;
    height: 18px;
    border-radius: 12px;
    appearance: none;
    background: var(--gray-300);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.form-switch .form-check-input::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.form-switch .form-check-input:checked {
    background: var(--primary);
}

.form-switch .form-check-input:checked::before {
    transform: translateX(18px);
}

/* ====== TABS ====== */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-tabs .nav-link {
    padding: 10px 18px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.nav-tabs .nav-link .badge {
    margin-left: 4px;
}

.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; animation: fadeIn 0.3s; }

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

.pills-tabs {
    list-style: none;
    padding: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: inline-flex;
    gap: 2px;
    margin-bottom: 16px;
}

.pills-tabs .nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.pills-tabs .nav-link:hover { color: var(--primary); }

.pills-tabs .nav-link.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ====== PROGRESS ====== */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.progress-sm { height: 5px; }
.progress-lg { height: 12px; }

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
}

.progress-bar.bg-success { background: var(--success); }
.progress-bar.bg-warning { background: var(--warning); }
.progress-bar.bg-danger { background: var(--danger); }
.progress-bar.bg-info { background: var(--info); }

.progress-striped .progress-bar {
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%);
    background-size: 1rem 1rem;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

/* ====== DROPDOWN (Hover-friendly) ====== */
.dropdown { position: relative; display: inline-block; }

/* Invisible hover bridge â€” keeps hover active during gap between toggle and menu */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 1049;
}

.dropdown-menu {
    display: block !important;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(31, 78, 121, 0.16), 0 2px 6px rgba(31, 78, 121, 0.06);
    padding: 8px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.22s;
    z-index: 1050;
    pointer-events: none;
}

.dropdown.show .dropdown-menu,
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    pointer-events: auto;
}

.dropdown.show .dropdown-menu,
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

/* Highlight header action button while its dropdown is open */
.dropdown:hover > .header-action-btn,
.dropdown:focus-within > .header-action-btn {
    background: var(--primary-soft);
    color: var(--primary);
}

.dropdown:hover > .user-profile,
.dropdown:focus-within > .user-profile {
    background: var(--gray-100);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.dropdown-item i {
    width: 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
    padding-left: 20px;
}

.dropdown-item:hover i { color: var(--primary); transform: scale(1.1); }

.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger); }

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

.dropdown-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ====== NOTIFICATION DROPDOWN (Premium) ====== */
.notif-dropdown {
    min-width: 380px;
    max-height: 480px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notif-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    flex-shrink: 0;
}

.notif-header h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-header h6 .badge {
    background: rgba(255, 255, 255, 0.22);
    color: var(--white);
    backdrop-filter: blur(8px);
}

.notif-header a,
.notif-header .fs-xs {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 11.5px;
    font-weight: 500;
    transition: var(--transition);
}

.notif-header a:hover { color: var(--white) !important; text-decoration: underline; }

.notif-dropdown .notif-body {
    overflow-y: auto;
    flex: 1;
    max-height: 360px;
}

/* When notif-dropdown lacks notif-body wrapper, allow scroll on items area */
.notif-dropdown {
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.notif-item:hover {
    background: var(--gray-50);
    padding-left: 22px;
}

.notif-item.unread {
    background: var(--primary-soft);
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.15);
}

.notif-item:last-child { border-bottom: none; }

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
    transition: var(--transition);
}

.notif-item:hover .notif-icon {
    transform: scale(1.08) rotate(-4deg);
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-text { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.4; }
.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.notif-time::before {
    content: '\f017';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 9px;
    opacity: 0.7;
}

/* Sticky footer link inside notification dropdown */
.notif-footer {
    padding: 12px 18px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
}

.notif-footer:hover { background: var(--primary-soft); }

/* Avatar inside notif-item (for messages) - apply rounded corners + scale animation */
.notif-item .avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    transition: var(--transition);
}

.notif-item:hover .avatar { transform: scale(1.08) rotate(-4deg); }

/* ====== USER PROFILE DROPDOWN (Premium) ====== */
.user-profile {
    position: relative;
}

.dropdown:hover .user-profile,
.dropdown:focus-within .user-profile {
    background: var(--gray-100);
}

/* Profile card header inside user profile dropdown */
.profile-dd-header {
    padding: 18px 18px 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
    margin: -8px 0 8px;
    border-top-left-radius: calc(var(--radius-lg) - 1px);
    border-top-right-radius: calc(var(--radius-lg) - 1px);
}

.profile-dd-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.profile-dd-header::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.profile-dd-avatar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-dd-avatar .avatar {
    width: 50px;
    height: 50px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-dd-info { line-height: 1.3; }
.profile-dd-name { font-size: 14px; font-weight: 700; color: var(--white); }
.profile-dd-email { font-size: 11.5px; color: rgba(255, 255, 255, 0.85); }

/* Active indicator dot for user avatar */
.user-avatar.has-status {
    position: relative;
}

.user-avatar.has-status::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border: 2px solid var(--white);
    border-radius: 50%;
}

/* ====== APPS DROPDOWN (Premium grid) ====== */
.apps-dropdown {
    min-width: 360px;
    padding: 0;
    overflow: hidden;
}

.apps-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apps-header h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.apps-header h6 i { font-size: 12px; }

.apps-header a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11.5px;
    font-weight: 500;
    transition: var(--transition);
}

.apps-header a:hover { color: var(--white); }

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 12px;
}

.apps-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
    border: 1px solid transparent;
}

.apps-tile:hover {
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.apps-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.apps-tile:hover .apps-tile-icon {
    transform: scale(1.1) rotate(-4deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.apps-tile-label {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
}

.apps-tile-sub {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.1;
}

/* App tile color variants */
.app-blue   { background: linear-gradient(135deg, #1F4E79, #2C6BA8); }
.app-green  { background: linear-gradient(135deg, #2E7D32, #4CAF50); }
.app-orange { background: linear-gradient(135deg, #F57C00, #FFA726); }
.app-red    { background: linear-gradient(135deg, #C62828, #EF5350); }
.app-info   { background: linear-gradient(135deg, #0288D1, #29B6F6); }
.app-slate  { background: linear-gradient(135deg, #37474F, #607D8B); }
.app-purple { background: linear-gradient(135deg, #6A1B9A, #9C27B0); }
.app-teal   { background: linear-gradient(135deg, #00695C, #26A69A); }
.app-amber  { background: linear-gradient(135deg, #FF6F00, #FFB300); }

.apps-footer {
    padding: 10px 18px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    display: block;
}

.apps-footer:hover { background: var(--primary-soft); }

/* Apps trigger button with label */
.apps-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px 0 10px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.apps-trigger:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.dropdown:hover > .apps-trigger,
.dropdown:focus-within > .apps-trigger,
.dropdown.show > .apps-trigger {
    background: var(--primary-soft);
    color: var(--primary);
}

.apps-trigger .apps-icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-template-rows: repeat(3, 4px);
    gap: 2px;
    width: 16px;
    height: 16px;
}

.apps-trigger .apps-icon-grid span {
    background: currentColor;
    border-radius: 1px;
}

@media (max-width: 767px) {
    .apps-trigger .apps-trigger-label { display: none; }
    .apps-dropdown { min-width: 280px; }
    .apps-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Quick Launch tile - hover animation (legacy) */
.quick-tile {
    transition: var(--transition);
    border: 1px solid transparent;
}

.quick-tile:hover {
    background: var(--primary-soft) !important;
    border-color: var(--primary);
    transform: translateY(-2px);
    color: var(--primary) !important;
}

.quick-tile:hover .text-primary { color: var(--primary-dark) !important; }

/* Header action btn - ensure rounded glow when dropdown open */
.header-action-btn { position: relative; }

/* Pulsing notification badge */
.header-action-btn .badge-count {
    animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(198, 40, 40, 0); }
}

/* ====== ALERTS ====== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert i { font-size: 18px; margin-top: 2px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; font-size: 13.5px; }
.alert p { font-size: 12.5px; margin: 0; }

.alert-primary { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning); }
.alert-danger { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.alert-info { background: var(--info-light); border-color: var(--info); color: var(--info); }

/* ====== MODAL ====== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 37, 48, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1060;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.modal-backdrop.show { display: flex; }

.modal-dialog {
    width: 100%;
    max-width: 500px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s;
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1140px; }
.modal-sm { max-width: 380px; }

@keyframes modalIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h5 { margin: 0; font-size: 16px; font-weight: 600; }

.btn-close {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover { background: var(--gray-100); color: var(--danger); }

.modal-body { padding: 22px; }

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ====== TIMELINE ====== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 22px;
}

.timeline-marker {
    position: absolute;
    left: -30px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary);
    z-index: 1;
}

.timeline-marker.success { border-color: var(--success); }
.timeline-marker.warning { border-color: var(--warning); }
.timeline-marker.danger { border-color: var(--danger); }
.timeline-marker.info { border-color: var(--info); }

.timeline-content {
    background: var(--gray-50);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13.5px;
    margin-bottom: 4px;
}

.timeline-time {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.timeline-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ====== CHART ====== */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    max-width: 100%;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* SVG Chart helpers */
.svg-chart { width: 100%; height: auto; display: block; }

/* ====== UTILITIES ====== */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: var(--white) !important; }
.text-dark { color: var(--dark) !important; }

.bg-primary { background: var(--primary) !important; }
.bg-soft { background: var(--primary-soft) !important; }
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-info { background: var(--info) !important; }
.bg-light { background: var(--gray-100) !important; }
.bg-white { background: var(--white) !important; }
.bg-dark { background: var(--dark) !important; }

.fw-bold { font-weight: 700; }
.fw-semi { font-weight: 600; }
.fw-medium { font-weight: 500; }
.fw-normal { font-weight: 400; }

.fs-xs { font-size: 11px; }
.fs-sm { font-size: 12px; }
.fs-md { font-size: 13px; }
.fs-lg { font-size: 15px; }
.fs-xl { font-size: 18px; }
.fs-2xl { font-size: 22px; }
.fs-3xl { font-size: 28px; }

.lh-1 { line-height: 1; }
.lh-sm { line-height: 1.25; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }
.mw-100 { max-width: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-circle { border-radius: 50%; }
.rounded-pill { border-radius: 50px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-end { border-right: 1px solid var(--border-color); }
.border-start { border-left: 1px solid var(--border-color); }
.border-0 { border: 0 !important; }

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 24px; }
.ms-1 { margin-left: 4px; } .ms-2 { margin-left: 8px; } .ms-3 { margin-left: 12px; } .ms-auto { margin-left: auto; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; } .me-3 { margin-right: 12px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; } .my-3 { margin-top: 12px; margin-bottom: 12px; } .my-4 { margin-top: 16px; margin-bottom: 16px; }

.p-0 { padding: 0; } .p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-5 { padding: 24px; }
.pt-2 { padding-top: 8px; } .pt-3 { padding-top: 12px; } .pt-4 { padding-top: 16px; }
.pb-2 { padding-bottom: 8px; } .pb-3 { padding-bottom: 12px; } .pb-4 { padding-bottom: 16px; }
.px-2 { padding-left: 8px; padding-right: 8px; } .px-3 { padding-left: 12px; padding-right: 12px; } .px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; } .py-3 { padding-top: 12px; padding-bottom: 12px; } .py-4 { padding-top: 16px; padding-bottom: 16px; }

/* ====== GRID OVERRIDE (Compact) ====== */
.row { --bs-gutter-x: 24px; }

/* ====== PAGINATION ====== */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item .page-link {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.page-item .page-link:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.page-item.active .page-link { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-item.disabled .page-link { opacity: 0.5; cursor: not-allowed; }

.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* ====== LIVE STATUS ====== */
.live-pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.live-pulse .live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.live-pulse.danger { background: var(--danger-light); color: var(--danger); }
.live-pulse.danger .live-dot { background: var(--danger); }
.live-pulse.warning { background: var(--warning-light); color: var(--warning); }
.live-pulse.warning .live-dot { background: var(--warning); }

/* ====== AUTH PAGES ====== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.auth-left {
    flex: 1;
    padding: 60px;
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06) 0%, transparent 40%);
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: 50%;
}

.auth-left::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    border: 2px solid rgba(255,255,255,0.05);
    border-radius: 50%;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.auth-brand-logo {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 22px;
}

.auth-brand h2 {
    color: var(--white);
    font-size: 26px;
    letter-spacing: -0.02em;
    margin: 0;
}

.auth-brand span {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-hero {
    position: relative;
    z-index: 1;
}

.auth-hero h1 {
    color: var(--white);
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.auth-hero p {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 480px;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.auth-features li i {
    color: var(--success);
    font-size: 14px;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-footer-text {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    position: relative;
    z-index: 1;
}

.auth-right {
    width: 480px;
    background: var(--white);
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.auth-right h3 {
    font-size: 24px;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-right .auth-subtitle {
    color: var(--text-secondary);
    font-size: 13.5px;
    margin-bottom: 28px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 11.5px;
    margin: 18px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span { padding: 0 12px; }

.social-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.social-btn {
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.social-btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.social-btn .google { color: #DB4437; }
.social-btn .github { color: #24292E; }

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 18px 0 24px;
}

.otp-input {
    width: 48px;
    height: 56px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.08);
}

/* ====== MACHINE STATUS CARD ====== */
.machine-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.machine-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.machine-card.running { border-left: 4px solid var(--success); }
.machine-card.idle { border-left: 4px solid var(--warning); }
.machine-card.down { border-left: 4px solid var(--danger); }
.machine-card.maintenance { border-left: 4px solid var(--info); }

.machine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.machine-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.machine-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.oee-circle {
    display: inline-block;
    width: 80px;
    height: 80px;
    position: relative;
}

/* ====== EMPTY STATES ====== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 70px;
    height: 70px;
    background: var(--gray-100);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 28px;
    margin-bottom: 16px;
}

.empty-state h5 { color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ====== KANBAN ====== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 16px;
    overflow-x: auto;
}

.kanban-col {
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 12px;
    min-height: 400px;
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.kanban-col-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-col-count {
    background: var(--white);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.kanban-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: var(--transition);
}

.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.kanban-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--text-muted); }

/* ====== CHAT ====== */
.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 75vh;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--white);
}

.chat-sidebar {
    border-right: 1px solid var(--border-color);
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}

.chat-list { flex: 1; overflow-y: auto; }

.chat-list-item {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.chat-list-item:hover { background: var(--white); }
.chat-list-item.active { background: var(--white); border-left: 3px solid var(--primary); }

.chat-list-name { font-weight: 600; font-size: 13px; }
.chat-list-msg { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }

.chat-main { display: flex; flex-direction: column; }
.chat-header { padding: 14px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; }
.chat-body { flex: 1; padding: 20px; overflow-y: auto; background: var(--gray-50); }
.chat-footer { padding: 14px 20px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; align-items: center; }

.chat-msg { display: flex; gap: 10px; margin-bottom: 16px; max-width: 70%; }
.chat-msg.sent { margin-left: auto; flex-direction: row-reverse; }
.chat-msg-bubble { background: var(--white); padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; color: var(--text-primary); border: 1px solid var(--border-color); }
.chat-msg.sent .chat-msg-bubble { background: var(--primary); color: var(--white); border-color: var(--primary); }
.chat-msg-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ====== HORIZONTAL SCROLL TABLE ====== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 14px;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ====== PRICING ====== */
.pricing-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    height: 100%;
}

.pricing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); }

.pricing-card.featured {
    border: 2px solid var(--primary);
    background: linear-gradient(180deg, var(--primary-soft) 0%, var(--white) 100%);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.pricing-desc { color: var(--text-muted); font-size: 12.5px; margin-bottom: 20px; }
.pricing-price { font-size: 44px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.03em; line-height: 1; }
.pricing-price small { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.pricing-features { list-style: none; padding: 0; margin: 22px 0; text-align: left; }
.pricing-features li { padding: 7px 0; font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.pricing-features li i { color: var(--success); }
.pricing-features li.disabled { color: var(--text-muted); }
.pricing-features li.disabled i { color: var(--gray-400); }

/* ====== FAQ ====== */
.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-question {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
    background: var(--white);
}

.faq-question:hover { background: var(--gray-50); }
.faq-question i { transition: var(--transition); color: var(--text-muted); }
.faq-item.active .faq-question i { transform: rotate(180deg); color: var(--primary); }
.faq-item.active .faq-question { color: var(--primary); background: var(--primary-soft); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    background: var(--white);
}

.faq-item.active .faq-answer { max-height: 300px; padding: 0 18px 16px; }

.faq-answer p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; padding-top: 8px; border-top: 1px solid var(--border-color); }

/* ====== MOBILE MENU TOGGLE (hamburger) ====== */
.mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    flex-shrink: 0;
    transition: var(--transition);
    font-size: 16px;
}

.mobile-menu-toggle:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Mobile menu header (hidden on desktop, shown inside sidebar on mobile) */
.mobile-menu-header { display: none; }

/* Mobile menu backdrop */
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 37, 48, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.mobile-menu-open .mobile-menu-backdrop {
    opacity: 1;
    visibility: visible;
}

/* Body scroll lock */
body.mobile-menu-open {
    overflow: hidden;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1199px) {
    .menu-list { gap: 0; }
    .menu-link { padding: 0 10px; font-size: 12px; }
}

@media (max-width: 991px) {
    .app-content { padding: 16px; }
    .brand { min-width: auto; }
    .brand-tagline { display: none; }

    /* Show hamburger to the right of the logo */
    .mobile-menu-toggle { display: inline-flex; }

    /* Hide search & action icons on mobile (apps, notif, msg) */
    .header-search,
    .header-actions .dropdown:not(:last-child) {
        display: none !important;
    }
    /* Keep only user profile dropdown */
    .header-actions { margin-left: auto; }
    .user-info { display: none; }

    /* Convert horizontal menu to vertical mobile sidebar slide-in from left */
    .main-menu {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        background: var(--white);
        z-index: 1100;
        padding: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.mobile-menu-open .main-menu {
        transform: translateX(0);
    }

    /* Mobile menu header inside sidebar */
    .main-menu::before {
        content: '';
        display: block;
        height: 56px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .mobile-menu-header {
        display: flex;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 18px;
        align-items: center;
        justify-content: space-between;
        color: var(--white);
        z-index: 3;
    }

    .mobile-menu-header .brand-name { color: var(--white); font-size: 17px; }
    .mobile-menu-header-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--white);
        text-decoration: none;
    }
    .mobile-menu-header-logo i { font-size: 18px; }

    .mobile-menu-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
        border: none;
        color: var(--white);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
    }

    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.28);
    }

    /* Vertical menu items */
    .menu-list {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        gap: 0;
        padding: 8px 0;
    }

    .menu-item {
        height: auto;
        width: 100%;
    }

    .menu-link {
        padding: 14px 20px;
        height: auto;
        font-size: 14px;
        font-weight: 500;
        border-bottom: 1px solid var(--border-color) !important;
        border-left: 3px solid transparent !important;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
    }

    .menu-link i:first-child {
        font-size: 16px;
        width: 20px;
        text-align: center;
    }

    .menu-link .chevron {
        margin-left: auto;
        transition: transform 0.2s;
    }

    .menu-item.mobile-open > .menu-link .chevron {
        transform: rotate(180deg);
    }

    .menu-item.active > .menu-link {
        background: var(--primary-soft);
        border-left-color: var(--primary) !important;
        color: var(--primary);
    }

    .menu-item:hover > .menu-link {
        background: var(--primary-soft);
    }

    /* Mobile dropdown (sub-menu) - accordion behavior */
    .menu-dropdown,
    .menu-dropdown.menu-mega,
    .menu-dropdown.menu-mega.cols-3 {
        position: static;
        min-width: 100%;
        max-height: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        display: block;
        background: var(--gray-50);
        overflow: hidden;
        transition: max-height 0.3s ease;
        grid-template-columns: none;
        gap: 0;
    }

    /* Hover trigger does not apply on mobile - tap instead */
    .menu-item:hover > .menu-dropdown {
        max-height: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .menu-item.mobile-open > .menu-dropdown {
        max-height: 800px;
    }

    .menu-dropdown-link {
        padding: 11px 24px 11px 52px;
        font-size: 13px;
        border-left: 3px solid transparent;
    }

    .menu-dropdown-link.active {
        background: var(--white);
    }

    .menu-mega .dropdown-header {
        padding: 12px 24px 6px;
        font-size: 11px;
    }
}

@media (max-width: 767px) {
    .auth-wrap { flex-direction: column; }
    .auth-left { padding: 30px; min-height: 240px; }
    .auth-right { width: 100%; padding: 30px; }
    .topbar { padding: 0 12px; font-size: 11px; }
    .topbar-status { display: none; }
    .page-header { flex-direction: column; }
    .kanban-board { grid-template-columns: 1fr; }
    .chat-container { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
}

@media (max-width: 575px) {
    .topbar-left .topbar-item:not(:first-child) { display: none; }
    .stat-value { font-size: 22px; }
    .modal-dialog { margin: 12px; }
    .topbar-right .topbar-link:not(:last-child) { display: none; }
}

/* ========================================
   UTILITY CLASSES (Generated)
   - replaces inline style attributes
   ======================================== */

/* Width (px) */
.w-40px{width:40px}.w-46px{width:46px}.w-50px{width:50px}.w-60px{width:60px}.w-64px{width:64px}.w-70px{width:70px}.w-80px{width:80px}
.w-100px{width:100px}.w-120px{width:120px}.w-140px{width:140px}.w-150px{width:150px}.w-160px{width:160px}.w-170px{width:170px}
.w-180px{width:180px}.w-200px{width:200px}.w-220px{width:220px}.w-240px{width:240px}.w-280px{width:280px}.w-300px{width:300px}
.w-380px{width:380px}.w-420px{width:420px}.w-480px{width:480px}.w-580px{width:580px}.w-720px{width:720px}.w-1140px{width:1140px}.w-1200px{width:1200px}

/* Min-width */
.minw-46{min-width:46px}.minw-80{min-width:80px}.minw-100{min-width:100px}.minw-120{min-width:120px}
.minw-140{min-width:140px}.minw-200{min-width:200px}.minw-280{min-width:280px}.minw-1200{min-width:1200px}

/* Height */
.h-36px{height:36px}.h-40px{height:40px}.h-60px{height:60px}.h-76px{height:76px}.h-80px{height:80px}
.h-100px{height:100px}.h-160px{height:160px}.h-180px{height:180px}.h-200px{height:200px}.h-240px{height:240px}
.h-280px{height:280px}.h-300px{height:300px}.h-400px{height:400px}.h-75vh{height:75vh}

/* Font sizes */
.fz-10{font-size:10px}.fz-11{font-size:11px}.fz-14{font-size:14px}.fz-18{font-size:18px}.fz-22{font-size:22px}
.fz-24{font-size:24px}.fz-28{font-size:28px}.fz-40{font-size:40px}.fz-42{font-size:42px}.fz-60{font-size:60px}.fz-120{font-size:120px}

/* Misc */
.cursor-p{cursor:pointer}
.text-italic{font-style:italic}
.no-bullet{list-style:none;padding:0;margin:0}

/* Theme background utilities */
.bg-gradient-primary{background:linear-gradient(135deg,var(--primary) 0%, var(--primary-light) 100%)}
.bg-gradient-dark{background:linear-gradient(135deg,var(--primary) 0%, var(--secondary) 100%)}
.bg-gradient-warm{background:linear-gradient(135deg,var(--primary) 0%, var(--accent) 100%)}
.bg-gradient-success{background:linear-gradient(135deg,var(--primary) 0%, var(--success) 100%)}
.bg-gradient-info{background:linear-gradient(135deg,var(--primary) 0%, var(--info) 100%)}
.bg-gradient-warning{background:linear-gradient(135deg,var(--secondary) 0%, var(--warning) 100%)}
.bg-gradient-danger{background:linear-gradient(135deg,var(--primary) 0%, var(--danger) 100%)}
.bg-gradient-slate{background:linear-gradient(135deg,var(--secondary) 0%, var(--secondary-light) 100%)}
.bg-gradient-soft{background:linear-gradient(180deg, var(--primary-soft) 0%, var(--white) 100%)}
.bg-page-bg{background:linear-gradient(135deg,var(--primary-soft) 0%, white 100%)}

.bg-soft-success{background:var(--success-light);color:var(--success)}
.bg-soft-warning{background:var(--warning-light);color:var(--warning)}
.bg-soft-danger{background:var(--danger-light);color:var(--danger)}
.bg-soft-info{background:var(--info-light);color:var(--info)}
.bg-soft-primary{background:var(--primary-soft);color:var(--primary)}
.bg-soft-secondary{background:var(--gray-100);color:var(--text-primary)}

/* Schedule colored blocks */
.sched-block{padding:8px;border-radius:6px;color:white;cursor:pointer}
.sched-primary{background:var(--primary)}
.sched-success{background:var(--success)}
.sched-warning{background:var(--warning)}
.sched-danger{background:var(--danger)}

/* Page utilities */
.page-error-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:40px 20px}
.page-error-content{max-width:600px;text-align:center}
.error-code{font-size:120px;font-weight:700;background:linear-gradient(135deg,var(--primary),var(--secondary));-webkit-background-clip:text;-webkit-text-fill-color:transparent;line-height:1;margin-bottom:16px}
.error-code-danger{background:linear-gradient(135deg,var(--danger),var(--warning));-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.error-link-card{display:block;padding:8px;border-radius:6px;color:var(--text-primary);background:var(--gray-50)}

/* Quick launch tiles in topbar/header dropdowns */
.quick-tile{text-align:center;padding:8px;border-radius:6px;width:80px;background:var(--gray-50);color:var(--text-primary)}

/* Avatar sizes - additional */
.avatar-xxl{width:120px;height:120px;font-size:42px}
.avatar-2xl{width:100px;height:100px;font-size:36px}

/* Dropdown menu sizing */
.dd-menu-md{min-width:240px}
.dd-menu-lg{min-width:280px;padding:14px}
.dd-header-flush{padding:0 0 10px}

/* Nav-tabs flush in card-header */
.nav-tabs-flush{border:0;margin:0}

/* Search input sizes for filters */
.search-input-sm{width:200px}
.search-input-md{width:220px}
.search-input-lg{width:280px}
.filter-select{width:160px}
.filter-select-lg{width:180px}

/* Plant floor machine tile */
.floor-tile{width:60px;text-align:center}
.floor-tile-inner{border-radius:6px;padding:8px;display:flex;align-items:center;justify-content:center;font-size:28px}

/* Plant operations stat tiles */
.stat-mini-bg{padding:8px;border-radius:6px}

/* Pricing card payment card */
.payment-card{padding:16px;border-radius:8px;background:linear-gradient(135deg,var(--primary),var(--secondary));color:white;margin-bottom:12px}

/* Footer dot indicator */
.bd-dot-success{background:var(--success)}
.bd-dot-warning{background:var(--warning)}
.bd-dot-danger{background:var(--danger)}
.bd-dot-info{background:var(--info)}
.bd-dot-primary{background:var(--primary)}

/* Inline dot for live status */
.live-dot-inline{display:inline-block;width:6px;height:6px;background:var(--success);border-radius:50%;margin-right:4px}

/* Card body compact */
.card-body-compact{padding:14px 20px}

/* Padding helpers used */
.pad-0-0-10{padding:0 0 10px}

/* Quick action button - vertical */
.qa-btn{height:80px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:left}

/* Sidebar settings menu items */
.set-menu-item{display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid var(--border-color);color:var(--text-primary)}
.set-menu-item.active{background:var(--primary-soft);color:var(--primary)}
.set-menu-item:last-child{border-bottom:0}

/* Schedule block (compact) */
.sched-cell-block{padding:8px;border-radius:6px;cursor:pointer;color:white;font-size:11px}

/* Plant floor cards */
.line-card{border:1px solid var(--border-color);border-radius:10px;padding:16px}

/* Tooltip pop */
.tooltip-pop{position:absolute;background:#1A2530;color:#fff;font-size:11px;padding:5px 10px;border-radius:4px;z-index:9999;pointer-events:none;white-space:nowrap}

/* Timeline custom padding */
.timeline-px-30{padding-left:30px}
.timeline-card-pad{padding:20px 20px 0 50px}
.timeline-card-pad::before{left:28px;top:24px;bottom:4px}

/* Avatar override - large user header */
.avatar-md-user{width:50px;height:50px;font-size:18px}
.avatar-lg-user{width:60px;height:60px;font-size:20px}
.avatar-3xl{width:80px;height:80px;font-size:24px}

/* OTP small badge */
.badge-mini{font-size:10px;padding:1px 6px}

/* Brand logo extra sizes */
.brand-logo-lg{width:100px;height:100px;font-size:40px}

/* Notification scroll dropdown - extends notif-dropdown */
.dd-notif-scroll{max-height:420px;overflow-y:auto}

/* Account settings sidebar */
.set-side-link{display:flex;align-items:center;gap:12px;padding:12px}

/* Block (display:block) for nav-link siblings */
.d-block-link{display:block;padding:12px;border-bottom:1px solid var(--border-color);color:var(--text-primary)}

/* Width % for progress bars (1-100) */
.pw-0{width:0%}.pw-1{width:1%}.pw-2{width:2%}.pw-3{width:3%}.pw-4{width:4%}.pw-5{width:5%}.pw-6{width:6%}.pw-7{width:7%}.pw-8{width:8%}.pw-9{width:9%}.pw-10{width:10%}.pw-11{width:11%}.pw-12{width:12%}.pw-13{width:13%}.pw-14{width:14%}.pw-15{width:15%}.pw-16{width:16%}.pw-17{width:17%}.pw-18{width:18%}.pw-19{width:19%}.pw-20{width:20%}.pw-21{width:21%}.pw-22{width:22%}.pw-23{width:23%}.pw-24{width:24%}.pw-25{width:25%}.pw-26{width:26%}.pw-27{width:27%}.pw-28{width:28%}.pw-29{width:29%}.pw-30{width:30%}.pw-31{width:31%}.pw-32{width:32%}.pw-33{width:33%}.pw-34{width:34%}.pw-35{width:35%}.pw-36{width:36%}.pw-37{width:37%}.pw-38{width:38%}.pw-39{width:39%}.pw-40{width:40%}.pw-41{width:41%}.pw-42{width:42%}.pw-43{width:43%}.pw-44{width:44%}.pw-45{width:45%}.pw-46{width:46%}.pw-47{width:47%}.pw-48{width:48%}.pw-49{width:49%}.pw-50{width:50%}.pw-51{width:51%}.pw-52{width:52%}.pw-53{width:53%}.pw-54{width:54%}.pw-55{width:55%}.pw-56{width:56%}.pw-57{width:57%}.pw-58{width:58%}.pw-59{width:59%}.pw-60{width:60%}.pw-61{width:61%}.pw-62{width:62%}.pw-63{width:63%}.pw-64{width:64%}.pw-65{width:65%}.pw-66{width:66%}.pw-67{width:67%}.pw-68{width:68%}.pw-69{width:69%}.pw-70{width:70%}.pw-71{width:71%}.pw-72{width:72%}.pw-73{width:73%}.pw-74{width:74%}.pw-75{width:75%}.pw-76{width:76%}.pw-77{width:77%}.pw-78{width:78%}.pw-79{width:79%}.pw-80{width:80%}.pw-81{width:81%}.pw-82{width:82%}.pw-83{width:83%}.pw-84{width:84%}.pw-85{width:85%}.pw-86{width:86%}.pw-87{width:87%}.pw-88{width:88%}.pw-89{width:89%}.pw-90{width:90%}.pw-91{width:91%}.pw-92{width:92%}.pw-93{width:93%}.pw-94{width:94%}.pw-95{width:95%}.pw-96{width:96%}.pw-97{width:97%}.pw-98{width:98%}.pw-99{width:99%}.pw-100{width:100%}.pw-101{width:101%}.pw-102{width:102%}.pw-103{width:103%}.pw-104{width:104%}.pw-105{width:105%}.pw-106{width:106%}.pw-107{width:107%}.pw-108{width:108%}.pw-109{width:109%}.pw-110{width:110%}.pw-111{width:111%}.pw-112{width:112%}.pw-113{width:113%}.pw-114{width:114%}.pw-115{width:115%}.pw-116{width:116%}.pw-117{width:117%}.pw-118{width:118%}.pw-119{width:119%}.pw-120{width:120%}

/* Product hero blocks */
.product-hero{height:160px;display:flex;align-items:center;justify-content:center;border-radius:10px 10px 0 0;color:rgba(255,255,255,0.3);font-size:60px}
.product-hero-lg{height:300px;display:flex;align-items:center;justify-content:center;border-radius:8px;color:rgba(255,255,255,0.3);font-size:120px}
.product-hero i{font-size:60px;color:rgba(255,255,255,0.3)}
.product-hero-lg i{font-size:120px;color:rgba(255,255,255,0.3)}

.card-grad-primary{background:linear-gradient(135deg,#1F4E79,#2C6BA8)}
.card-grad-slate{background:linear-gradient(135deg,#37474F,#546E7A)}
.card-grad-info{background:linear-gradient(135deg,#1F4E79,#0288D1)}
.card-grad-success{background:linear-gradient(135deg,#37474F,#2E7D32)}
.card-grad-warning{background:linear-gradient(135deg,#1F4E79,#F57C00)}
.card-grad-danger{background:linear-gradient(135deg,#37474F,#C62828)}

.product-thumb{width:70px;height:70px;background:var(--gray-100);border-radius:6px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.product-thumb-active{width:70px;height:70px;background:linear-gradient(135deg,#1F4E79,#2C6BA8);border-radius:6px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:white}
.product-thumb-active i{color:white}

.maxw-170{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.text-inherit{color:inherit}
.text-dark-color{color:var(--text-primary)}

/* Add notif dropdown additional sizes */
.dd-notif-scroll{max-height:420px;overflow-y:auto}

/* Notif icon backgrounds - reuse via bg-soft-* and color-* combo */
.notif-icon-success{background:var(--success-light);color:var(--success)}
.notif-icon-info{background:var(--info-light);color:var(--info)}
.notif-icon-warning{background:var(--warning-light);color:var(--warning)}
.notif-icon-danger{background:var(--danger-light);color:var(--danger)}
.notif-icon-primary{background:var(--primary-soft);color:var(--primary)}

/* Solid colored dot indicators */
.dot-primary{background:#1F4E79}
.dot-success{background:#2E7D32}
.dot-warning{background:#F57C00}
.dot-danger{background:#C62828}
.dot-info{background:#0288D1}
.dot-orange{background:#FF7043}
.dot-slate{background:#37474F}
.dot-gray{background:#8A95A5}

/* Integration tile icon backgrounds (solid colors with white text) */
.tile-icon-primary{background:#1F4E79;color:white;width:60px;height:60px;display:flex;align-items:center;justify-content:center}
.tile-icon-success{background:#2E7D32;color:white;width:60px;height:60px;display:flex;align-items:center;justify-content:center}
.tile-icon-warning{background:#F57C00;color:white;width:60px;height:60px;display:flex;align-items:center;justify-content:center}
.tile-icon-danger{background:#C62828;color:white;width:60px;height:60px;display:flex;align-items:center;justify-content:center}
.tile-icon-info{background:#0288D1;color:white;width:60px;height:60px;display:flex;align-items:center;justify-content:center}
.tile-icon-slate{background:#37474F;color:white;width:60px;height:60px;display:flex;align-items:center;justify-content:center}

/* Misc */
.minw-46px{min-width:46px}
.fz-60-white{font-size:60px;color:rgba(255,255,255,0.3)}
.fz-120-white{font-size:120px;color:rgba(255,255,255,0.3)}
.brand-color-ms{color:#0078D4}
.bg-soft-primary-hover{background:var(--primary-soft);cursor:pointer}

/* ====== BIDI OVERRIDES (added for Plantix ar/en toggle — logical props so this works in both directions) ====== */
.topbar-right { margin-left: 0; margin-inline-start: auto; }
.header-actions { margin-left: 0; margin-inline-start: auto; }
.header-search .search-icon { left: auto; inset-inline-start: 14px; }
.header-search input { padding: 0; padding-inline-start: 40px; padding-inline-end: 16px; }
.header-action-btn .badge-count { right: auto; inset-inline-end: 4px; }
.menu-dropdown { left: auto; inset-inline-start: 0; }
.menu-mega.cols-3 { left: auto; right: auto; inset-inline-start: auto; inset-inline-end: 0; }
.menu-dropdown-link { border-left: none; border-inline-start: 3px solid transparent; }
.menu-dropdown-link:hover, .menu-dropdown-link.active { border-left-color: transparent; border-inline-start-color: var(--primary); }
.app-footer .footer-links a { margin-left: 0; margin-inline-start: 16px; }
.stat-card::before { left: auto; inset-inline-start: 0; }
.table thead th { text-align: left; text-align: start; }
.table-actions { justify-content: flex-end; }
html[dir="rtl"] .fa-chevron-right:not(.no-flip) { transform: scaleX(-1); display: inline-block; }
