/* ═══════════════════════════════════════════
   zoho.css — Full Zoho CRM-Matching UI System
   VERSION: 3.0 — 100% working
═══════════════════════════════════════════ */

/* Auth logo icon flex fix */
.auth-logo-icon {
    margin: 0 auto 14px !important;
    font-size: 36px !important;
}

/* Drawer overlay full z-index fix */
.z-drawer-overlay {
    z-index: 498;
}

.z-drawer {
    z-index: 499;
}

/* Notif panel needs top:52px to clear topbar */
.z-notif-panel {
    top: 52px;
    height: calc(100vh - 52px);
    z-index: 600;
}

/* ─── Animations ─────────────────────────── */
@keyframes pulse-slow {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pulse-slow {
    animation: pulse-slow 2s infinite ease-in-out;
}

/* ─── App Shell ─────────────────────────── */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ─── LEFT SIDEBAR ───────────────────────── */
.z-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease;
    position: relative;
    z-index: 500;
    /* Sidebar must be above main content but below overlays */
}

/* ─── APP GLOBAL MOBILE FIXES ──────────────── */
html,
body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.app {
    width: 100%;
    max-width: 100vw;
}

/* Safe Area Insets for Mobile Notches */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.z-sidebar.collapsed {
    width: 56px;
    min-width: 56px;
}

.z-sidebar.collapsed .z-logo-text,
.z-sidebar.collapsed .z-nav-label,
.z-sidebar.collapsed .z-workspace-name span,
.z-sidebar.collapsed .z-workspace-name i,
.z-sidebar.collapsed .z-sidebar-search,
.z-sidebar.collapsed .z-nav-group-header,
.z-sidebar.collapsed .z-group-add,
.z-sidebar.collapsed .z-user-info,
.z-sidebar.collapsed #logout-btn {
    display: none;
}

/* Logo row */
.z-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 52px;
}

.z-logo-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #1e61f0, #9c27b0);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.z-logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: white;
    flex: 1;
}

.z-sidebar-toggle {
    margin-left: auto;
    color: var(--sidebar-muted);
    padding: 4px;
    border-radius: 4px;
    line-height: 0;
}

.z-sidebar-toggle:hover {
    color: white;
    background: var(--sidebar-hover);
}

.z-sidebar-toggle i {
    width: 16px;
    height: 16px;
}

/* Top nav (Home, Reports, etc.) */
.z-nav-top {
    padding: 6px 0;
    border-bottom: 1px solid var(--sidebar-border);
}

.z-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 0;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
}

.z-nav-item:hover {
    background: var(--sidebar-hover);
}

.z-nav-item.active {
    background: var(--sidebar-active);
    color: white;
}

.z-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.z-nav-item {
    position: relative;
}

.z-nav-icon {
    font-size: 15px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.z-nav-label {
    font-size: 13px;
    white-space: nowrap;
}

/* Workspace header */
.z-workspace-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--sidebar-border);
}

.z-workspace-name {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.z-workspace-name:hover {
    background: var(--sidebar-hover);
}

.z-workspace-name span {
    color: white;
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.z-workspace-name i {
    color: var(--sidebar-muted);
}

.z-ws-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1e61f0 0%, #9c27b0 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Sidebar search */
.z-sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 10px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
}

.z-sidebar-search i {
    color: var(--sidebar-muted);
    width: 14px;
    height: 14px;
}

.z-sidebar-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--sidebar-text);
    font-size: 13px;
    width: 100%;
}

.z-sidebar-search input::placeholder {
    color: var(--sidebar-muted);
}

/* CRM nav sections */
.z-nav-crm {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.z-nav-item-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.z-nav-item-group:hover {
    background: var(--sidebar-hover);
}

.z-nav-item-group.active {
    background: var(--sidebar-active);
    color: white;
}

.z-group-icon {
    font-size: 14px;
}

.z-nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 4px;
    margin-top: 4px;
}

.z-group-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.z-nav-group-header span {
    font-size: 11px;
    font-weight: 700;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.z-group-add {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    color: var(--sidebar-muted);
    font-size: 16px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.z-group-add:hover {
    background: var(--sidebar-hover);
    color: white;
}

.z-nav-item.sub {
    padding-left: 28px;
    font-size: 13px;
    color: var(--sidebar-muted);
}

.z-nav-item.sub:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

.z-nav-item.sub.active {
    color: white;
    background: var(--sidebar-active);
}

/* Sidebar user */
.z-sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
}

.z-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1e61f0;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.z-user-info {
    flex: 1;
    min-width: 0;
}

.z-user-info p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.z-user-info p:first-child {
    font-size: 13px;
    color: white;
    font-weight: 600;
}

.z-user-info p:last-child {
    font-size: 11px;
    color: var(--sidebar-muted);
}

#logout-btn {
    color: var(--sidebar-muted);
    padding: 4px;
    border-radius: 4px;
    line-height: 0;
}

#logout-btn:hover {
    color: white;
    background: var(--sidebar-hover);
}

#logout-btn i {
    width: 16px;
    height: 16px;
}

/* ─── RIGHT CONTENT AREA ──────────────────── */
.z-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-main);
}

/* ─── TOP BAR ────────────────────────────── */
.z-topbar {
    height: var(--topbar-h);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    flex-shrink: 0;
}

.z-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.z-module-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.z-module-view-select {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    border: 1px solid var(--border);
}

.z-module-view-select:hover {
    background: var(--border);
}

.z-module-view-select i {
    width: 13px;
    height: 13px;
}

.z-topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.z-global-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 320px;
    max-width: 100%;
    background: #f4f5f7;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px;
    transition: var(--transition);
}

.z-global-search:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 97, 240, 0.12);
}

.z-global-search i {
    color: var(--text-muted);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.z-global-search input {
    background: none;
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--text-main);
    width: 100%;
}

.z-global-search input::placeholder {
    color: var(--text-muted);
}

.z-topbar-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

.z-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: var(--transition);
}

.z-icon-btn:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.z-icon-btn i {
    width: 17px;
    height: 17px;
}

.z-user-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e61f0, #9c27b0);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 4px;
}

.z-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.z-more-btn:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.z-more-btn i {
    width: 16px;
    height: 16px;
}

/* ─── SUB-TOOLBAR ────────────────────────── */
.z-sub-toolbar {
    height: var(--subtoolbar-h);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
}

.z-sub-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.z-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
}

.z-filter-btn:hover {
    background: var(--bg-main);
    border-color: var(--border);
}

.z-filter-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.z-filter-btn i {
    width: 14px;
    height: 14px;
}

.z-view-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
    border-left: 1px solid var(--border);
    padding-left: 8px;
}

.z-view-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition);
}

.z-view-btn:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.z-view-btn.active {
    background: var(--primary-light);
    color: var(--primary);
}

.z-view-btn i {
    width: 15px;
    height: 15px;
}

.z-sub-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Create button — Zoho blue split button */
.z-create-btn {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: 0;
    height: 34px;
    transition: var(--transition);
}

.z-create-btn:hover {
    background: var(--primary-dark);
}

.z-create-btn>span:first-child {
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
}

.z-create-divider {
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    display: block;
}

.z-create-btn i {
    width: 14px;
    height: 14px;
    padding: 0 10px;
}

/* ─── MAIN LAYOUT ────────────────────────── */
.z-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ─── FILTER PANEL ───────────────────────── */
.z-filter-panel {
    width: 240px;
    min-width: 240px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    transition: var(--transition);
}

.z-fp-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.z-fp-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    margin-bottom: 16px;
}

.z-fp-search i {
    color: var(--text-muted);
    width: 14px;
    height: 14px;
}

.z-fp-search input {
    background: none;
    border: none;
    outline: none;
    font-size: 12px;
    color: var(--text-main);
    width: 100%;
}

.z-fp-section {
    margin-bottom: 16px;
}

.z-fp-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
}

.z-fp-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    color: var(--text-sub);
    cursor: pointer;
}

.z-fp-check:hover {
    color: var(--primary);
}

.z-fp-check input[type=checkbox] {
    accent-color: var(--primary);
    cursor: pointer;
}

/* ─── WORKSPACE ──────────────────────────── */
.z-workspace {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

/* ─── ZOHO TABLE VIEW ────────────────────── */
.z-table-wrap {
    min-width: 100%;
    background: var(--bg-white);
}

.z-table {
    width: 100%;
    border-collapse: collapse;
}

.z-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.z-table th {
    background: #f4f5f7;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

.z-table th:first-child {
    width: 40px;
}

.z-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-main);
    vertical-align: middle;
}

.z-table tr:hover td {
    background: #f8faff;
}

.z-table tr.selected td {
    background: #eef3ff;
}

.z-table td:first-child {
    width: 40px;
}

.z-check {
    accent-color: var(--primary);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.z-record-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.z-record-link:hover {
    text-decoration: underline;
}

/* status pills */
.z-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.z-pill.sales {
    background: #e8f0fe;
    color: #1e61f0;
}

.z-pill.design {
    background: #f3e8ff;
    color: #9c27b0;
}

.z-pill.production {
    background: #fff3e0;
    color: #e65100;
}

.z-pill.delivery {
    background: #e8f5e9;
    color: #1b5e20;
}

.z-pill.completed {
    background: #f1f5f9;
    color: #475569;
}

.z-pill.new {
    background: #e8f0fe;
    color: #1e61f0;
}

.z-pill.hot {
    background: #fef2f2;
    color: #dc2626;
}

/* Action button in table */
.z-row-btn {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

tr:hover .z-row-btn {
    opacity: 1;
}

.z-row-btn:hover {
    background: var(--primary);
    color: white;
}

/* Table footer */
.z-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    position: sticky;
    bottom: 0;
}

.z-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.z-pg-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    transition: var(--transition);
}

.z-pg-btn:hover {
    background: var(--bg-main);
}

.z-pg-btn.active {
    background: var(--primary);
    color: white;
}

/* ─── KANBAN VIEW ─────────────────────────── */
.z-kanban {
    display: flex;
    gap: 16px;
    padding: 20px 16px;
    overflow-x: auto;
    align-items: flex-start;
    min-height: 100%;
}

.z-kanban-col {
    min-width: 280px;
    max-width: 280px;
    background: #f4f5f7;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.z-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 3px solid transparent;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.z-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
}

.z-col-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.z-col-count {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.z-col-cards {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.z-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
}

.z-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.z-card-id {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.z-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.z-card-design {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.z-card-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: zoom-in;
}

.z-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.z-card-status {
    font-size: 11px;
    font-weight: 700;
}

.z-card-pending {
    background: #fff3e0;
    color: #e65100;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

/* ─── RECORD DRAWER (Full Side Panel) ────── */
.z-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--sidebar-width);
    width: auto;
    max-width: none;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    opacity: 1;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), left 0.2s ease;
}

.z-drawer.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.z-sidebar.collapsed~.z-drawer {
    left: 56px;
}

.z-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 499;
    display: none;
}

.z-drawer-overlay.active {
    display: block;
}

.z-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    flex-shrink: 0;
}

.z-drawer-id {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.z-drawer-name {
    font-size: 18px;
    font-weight: 700;
    margin-top: 2px;
    margin-bottom: 14px;
}

.z-drawer-close {
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    line-height: 0;
    flex-shrink: 0;
    margin-top: 4px;
}

.z-drawer-close:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.z-drawer-close i {
    width: 18px;
    height: 18px;
}

.z-drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
    padding: 0 24px;
}

.z-dtab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.z-dtab:hover {
    color: var(--text-main);
}

.z-dtab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.z-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ─── NOTIFICATION PANEL ─────────────────── */
.z-notif-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 600;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.z-notif-panel.open {
    right: 0;
}

.z-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.z-notif-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.z-notif-list {
    flex: 1;
    overflow-y: auto;
}

.z-notif-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.z-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 5px;
    flex-shrink: 0;
}

.z-notif-item p {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 2px;
}

.z-notif-item span {
    font-size: 11px;
    color: var(--text-muted);
}

.z-notif-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

/* ─── DASHBOARD ──────────────────────────── */
.z-dashboard {
    padding: 20px;
}

.z-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.z-stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.z-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.z-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.z-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.z-stat-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.z-stat-badge.up {
    background: #e8f5e9;
    color: #2e7d32;
}

.z-stat-badge.down {
    background: #fef2f2;
    color: #c62828;
}

.z-stat-value {
    font-size: 28px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    margin-bottom: 4px;
}

.z-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.z-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

/* ─── AUTH SCREEN ─────────────────────────── */
/* ─── AUTH SCREEN (Premium Redesign) ──────── */
.auth-screen {
    position: fixed;
    inset: 0;
    background: #090a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

/* Animated Blobs */
.auth-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary), #9c27b0);
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.15;
    z-index: 0;
    animation: blobFloat 20s infinite alternate;
}

.blob-1 {
    top: -100px;
    left: -100px;
    background: #1e61f0;
}

.blob-2 {
    bottom: -150px;
    right: -150px;
    background: #9c27b0;
    animation-delay: -5s;
}

.blob-3 {
    top: 30%;
    right: 20%;
    background: #00c853;
    width: 300px;
    height: 300px;
    opacity: 0.1;
    animation-duration: 25s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, 100px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 50px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 48px;
    width: 480px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(255, 255, 255, 0.02);
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease;
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo-icon {
    font-size: 48px;
    display: flex;
    margin: 0 auto 20px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1e61f0, #9c27b0);
    border-radius: 24px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(30, 97, 240, 0.3);
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.auth-logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-logo h1 span {
    background: linear-gradient(to right, #6b8fff, #d487ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    font-weight: 500;
}

.team-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
}

.team-card:hover::before {
    left: 100%;
}

.team-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.team-card.admin-card-special {
    grid-column: span 2;
    background: rgba(30, 97, 240, 0.08);
    justify-content: center;
}

.team-card.admin-card-special:hover {
    background: rgba(30, 97, 240, 0.15);
}

.tc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.team-card:hover .tc-icon {
    transform: rotate(10deg) scale(1.1);
}

.tc-info b {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.tc-info span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

/* Login form Enhancement */
.login-form {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.form-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: white;
    font-family: 'Outfit', sans-serif;
}

.form-header button {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.form-header button:hover {
    background: var(--primary);
    transform: translateX(-3px);
}

.form-header button i {
    width: 16px;
    height: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(30, 97, 240, 0.15);
}

.auth-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #164ec4 100%);
    color: white;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
    transition: all 0.3s ease;
    margin-top: 12px;
    box-shadow: 0 10px 20px rgba(30, 97, 240, 0.2);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(30, 97, 240, 0.4);
    filter: brightness(1.1);
}

/* ─── MISC COMPONENTS ─────────────────────── */
.z-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
    text-align: center;
}

.z-empty-state .emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.z-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-sub);
}

.z-section-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.z-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.z-section-head h3 {
    font-size: 14px;
    font-weight: 700;
}

.z-btn-primary {
    padding: 9px 18px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.z-btn-primary:hover {
    background: var(--primary-dark);
}

.z-btn-ghost {
    padding: 8px 14px;
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.z-btn-ghost:hover {
    background: var(--bg-main);
}

.z-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Relative for badge */
.z-icon-btn {
    position: relative;
}

/* ─── REPORTS PAGE ───────────────────────── */
.z-reports {
    padding: 20px;
}

.z-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.z-chart-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.z-chart-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ─── INVOICE STYLES ─────────────────────── */
.z-invoice-table {
    width: 100%;
}

/* ─── RESPONSIVE ─────────────────────────── */
@media (max-width: 1200px) {
    .z-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .z-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .z-chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .z-row-btn {
        opacity: 1 !important;
    }

    .z-sidebar {
        width: 56px;
        min-width: 56px;
    }
}

/* ─── MISSING UTILITY CLASSES ─────────────── */

/* Dropdown Menu (Zoho Style) */
.z-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    min-width: 180px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 6px 0;
    animation: fadeIn 0.15s ease;
}

.z-dropdown-menu.active {
    display: flex;
}

.z-dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.1s;
}

.z-dropdown-item:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.z-dropdown-menu hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* Sidebar search focus */
.z-sidebar-search:focus-within {
    background: rgba(255, 255, 255, 0.12);
}

/* Pending badge on kanban + table */
.z-card-pending {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Table row selected */
.z-table tr.selected td {
    background: #eef3ff !important;
}

/* Table cell truncation */
.z-table td {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.z-table td b,
.z-table td .z-record-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table row hover */
.z-table tbody tr {
    transition: background 0.1s ease;
}

/* Drawer active tab */
.z-dtab {
    cursor: pointer;
    background: none;
}

/* z-create-btn text node padding */
.z-create-btn {
    padding-left: 1px;
}

/* Smooth workspace transition */
.z-workspace>div {
    animation: fadeIn 0.25s ease;
}

/* Ensure fullscreen is always on top */
.z-fullscreen {
    z-index: 9999 !important;
}

/* Auth screen centering */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auth logo icon sizing */
.auth-logo-icon {
    width: 72px !important;
    height: 72px !important;
    font-size: 36px !important;
    border-radius: 18px !important;
}

/* ─── PREMIUM DRAWER ENHANCEMENTS ─────────── */
.drawer-overview-premium {
    padding: 8px 4px;
}

.drawer-overview-premium textarea {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

.drawer-overview-premium textarea:focus {
    box-shadow: 0 0 0 3px rgba(30, 97, 240, 0.1);
}

/* ─── UPDATED RESPONSIVE MOBILE FIXES ──────────────── */
@media screen and (max-width: 768px) {

    /* SIDEBAR OFF-CANVAS */
    .z-sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .z-sidebar.mobile-open {
        left: 0;
    }

    .z-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        z-index: 999;
    }

    .z-sidebar-overlay.active {
        display: block;
    }

    body.menu-open {
        overflow: hidden !important;
        /* Lock scroll when menu is open */
    }

    /* TOPBAR MOBILE */
    .z-topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        padding: var(--safe-top) 12px 0;
        height: auto;
        min-height: 60px;
        gap: 8px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }

    .mobile-only-btn {
        display: flex !important;
        width: 44px;
        height: 44px;
    }

    /* MODULE TITLE & SEARCH */
    .z-topbar-center {
        display: none;
        /* Hide global search on small mobile */
    }

    .z-module-title {
        font-size: 16px;
    }

    /* DASHBOARD GRID FIX */
    .z-stat-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .z-dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 12px !important;
    }

    /* TABLE TO CARD TRANSFORMATION */
    .z-table-wrap {
        border: none;
        background: transparent;
        padding: 0;
    }

    .z-table thead {
        display: none;
    }

    .z-table,
    .z-table tbody,
    .z-table tr,
    .z-table td {
        display: block;
        width: 100%;
    }

    .z-table tr {
        background: white !important;
        border: 1px solid var(--border) !important;
        border-radius: 20px !important;
        margin-bottom: 16px !important;
        padding: 20px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
        position: relative;
    }

    .z-table td {
        padding: 8px 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border: none !important;
        font-size: 14px !important;
    }

    .z-table td[data-label]::before {
        content: attr(data-label);
        font-weight: 800;
        font-size: 10px;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .z-table td:first-child {
        display: none !important;
    }

    /* Checkbox */

    .z-table td:last-child {
        margin-top: 15px;
        padding-top: 15px !important;
        border-top: 1.5px dashed #f1f5f9 !important;
        justify-content: center !important;
    }

    /* DRAWER MOBILE FULLSCREEN */
    .z-drawer {
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        height: 100vh !important;
        top: 0 !important;
        z-index: 6000 !important;
        transform: translateX(100%);
    }

    .z-drawer.open {
        transform: translateX(0) !important;
    }

    body.drawer-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .z-drawer-header {
        border-radius: 0 !important;
        padding: env(safe-area-inset-top, 12px) 16px 12px !important;
        height: auto !important;
        min-height: 60px;
    }

    .delivery-mobile-shell {
        height: 100vh;
        width: 100vw;
        overflow-x: hidden;
        background: #f8fafc;
    }

    /* TAP TARGETS */
    .z-btn-primary,
    .z-row-btn,
    .z-icon-btn,
    .auth-btn {
        min-height: 44px;
    }
}

@media screen and (max-width: 480px) {
    .z-stat-grid {
        grid-template-columns: 1fr !important;
    }
}