/* ============================================================
   INTERNOS — GLOBAL PREMIUM STYLES
   ============================================================ */

:root {
    --bg: #eef3fb;
    --sidebar: #ffffff;
    --blue: #2563eb;
    --blue-light: #60a5fa;
    --blue-dark: #16295c;
    --text: #16295c;
    --muted: #6b7f99;
    --border: #e2e9f4;
    --border-strong: #dbe4f3;
    --card: #ffffff;
    --radius: 18px;
    --shadow: 0 6px 20px rgba(37, 99, 235, 0.07);
    --sbw: 250px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
* {
    box-sizing: border-box;
    min-width: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: "Nunito", sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   SIDEBAR (Fixed)
   ============================================================ */
.sidebar {
    width: var(--sbw);
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-light) transparent;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--blue-light);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--blue);
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.brand-logo {
    width: 140px;
    height: auto;
    object-fit: contain;
    display: block;
}

.nav-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #95afc9;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 12px;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: #3e5a78;
    font-weight: 600;
    text-decoration: none;
    font-size: 14.5px;
    cursor: pointer;
    transition: all 0.15s;
}

.nav-item-link:hover {
    background: #edf3fa;
    color: var(--blue-dark);
}

.nav-item-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), transparent);
    color: var(--blue-dark);
}

.nav-item-link i {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eaf1fe;
    border-radius: 50%;
    color: var(--blue-dark);
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.15s;
}

.nav-item-link:hover i {
    background: #dbeafe;
}

.dropdown {
    position: relative;
}

.profile-dd-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 16px 36px rgba(22, 41, 92, 0.14);
    z-index: 2050;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.profile-dd-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.pdm-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}

.pdm-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.pdm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdm-info {
    min-width: 0;
}

.pdm-nm {
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdm-em {
    color: rgba(255, 255, 255, 0.78);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.pdm-body {
    padding: 8px;
}

.pdm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.pdm-item:hover {
    background: #f0f5fc;
    color: var(--blue-dark);
}

.pdm-ic {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #eaf1fe;
    color: var(--blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.pdm-foot {
    padding: 8px;
    border-top: 1px solid var(--border);
}

.pdm-logout {
    color: #dc2626;
}

.pdm-logout .pdm-ic {
    background: #fee2e2;
    color: #dc2626;
}

.pdm-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.nav-item-link.active i {
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

/* ---------- Sidebar Footer ---------- */
.sidebar-foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.sf-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sf-info .nm {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-info .rl {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-logout {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-logout:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* ---------- Avatar ---------- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 14px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
    margin-left: var(--sbw);
    min-height: 100vh;
    width: calc(100% - var(--sbw));
    max-width: 100%;
    overflow-x: hidden;
}

.main {
    padding: 24px 28px;
    padding-top: 100px;
    min-width: 0;
    max-width: 100%;
}

/* ============================================================
   TOP HEADER BAR (Fixed)
   ============================================================ */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;              /* pehle 16px tha */
    flex-wrap: nowrap;       /* pehle wrap tha — YE MAIN FIX HAI */
    background: #ffffff;
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 14px 28px;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: var(--sbw);
    right: 0;
    z-index: 1020;
}

.top-header .th-left h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.3px;
    word-break: break-word;
}

.top-header .th-left .crumb {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 2px;
    word-break: break-word;
}

.top-header .th-left .crumb i {
    color: var(--blue);
    margin: 0 4px;
    font-size: 10px;
}

.top-header .th-left .crumb span {
    color: var(--blue-dark);
}

.top-search {
    flex: 1;
    max-width: 360px;
    min-width: 200px;
    position: relative;
}

.th-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 6px 16px 6px 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.th-profile:hover {
    border-color: var(--blue-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.th-profile .avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.th-profile .tp-info {
    line-height: 1.2;
}

.th-profile .tp-info .nm {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
}

.th-profile .tp-info .rl {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

.th-profile i.chev {
    color: var(--muted);
    font-size: 12px;
    margin-left: 2px;
}

/* ============================================================
   MOBILE TOPBAR
   ============================================================ */
.mobile-topbar {
    display: none;
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.mobile-topbar .brand {
    padding: 0;
}

.menu-toggle {
    background: #eaf1fe;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--blue-dark);
    font-size: 20px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.menu-toggle:hover {
    background: #dbeafe;
}

/* ============================================================
   SIDEBAR BACKDROP
   ============================================================ */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 26, 51, 0.5);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* ============================================================
   SIDEBAR CLOSE BUTTON — Only visible when sidebar is open
   ============================================================ */
.sidebar-close-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--blue-dark);
    font-size: 18px;
    z-index: 1042;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.sidebar-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    transform: scale(1.05);
}

.sidebar-close-btn:active {
    transform: scale(0.95);
}

/* Show close button ONLY when sidebar is open */
body:has(.sidebar.show) .sidebar-close-btn {
    display: flex;
}

/* Hide bottom nav when sidebar is open */
body:has(.sidebar.show) .mobile-bottom-nav {
    display: none !important;
}

.theme-toggle-btn {
    position: static;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #eaf1fe;
    color: var(--blue-dark);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}


.theme-toggle-btn:hover {
    background: #e2e8f0;
}

.theme-toggle-btn:active {
    transform: scale(0.94);
}

/* ============================================================
   WELCOME HEADER
   ============================================================ */
.welcome-header {
    background: linear-gradient(120deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-light) 100%);
    border-radius: 20px;
    padding: 26px 28px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.welcome-header::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
}

.welcome-header h2 {
    font-weight: 800;
    font-size: 24px;
    margin: 0;
}

.welcome-header p {
    color: #dce8ff;
    margin: 4px 0 0;
    font-size: 14px;
}

.wh-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.wh-stat {
    min-width: 0;
}

.wh-stat .num {
    font-size: 22px;
    font-weight: 800;
}

.wh-stat .lbl {
    font-size: 12px;
    color: #dce8ff;
    font-weight: 600;
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 16px;
}

.section-title .sic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.section-title h2 {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
}

.section-title .sub {
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

/* ============================================================
   GENERIC CARD
   ============================================================ */
.app-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    height: 100%;
    min-width: 0;
    max-width: 100%;
}

.app-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 11px;
    background: #eaf1fe;
    color: var(--blue-dark);
    padding: 4px 12px;
    border-radius: 40px;
    font-weight: 700;
}

.tag.pending {
    background: #fef3c7;
    color: #b45309;
}

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metric-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-width: 0;
    max-width: 100%;
}

.metric-card::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--blue), var(--blue-light));
    opacity: 0.55;
}

.metric-card.green::after { background: linear-gradient(90deg, #16a34a, #4ade80); }
.metric-card.red::after { background: linear-gradient(90deg, #dc2626, #f87171); }
.metric-card.violet::after { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.metric-card.amber::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.metric-card .label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}

.metric-card .stat-value {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0;
}

/* ============================================================
   STATUS CHIPS
   ============================================================ */
.status-chip {
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 30px;
    text-transform: uppercase;
    display: inline-block;
}

.status-chip.present { background: #dcfce7; color: #15803d; }
.status-chip.absent { background: #fee2e2; color: #b91c1c; }
.status-chip.half_day { background: #ede9fe; color: #6d28d9; }
.status-chip.leave { background: #fef3c7; color: #b45309; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-page-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}

.empty-page-state i {
    font-size: 40px;
    opacity: 0.35;
}

.empty-page-state .msg {
    margin-top: 14px;
    font-weight: 700;
    font-size: 15px;
}

.empty-page-state .sub {
    font-size: 13px;
    margin-top: 4px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 16px;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ============================================================
   TABLE OVERFLOW FIX
   ============================================================ */
.rec-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rec-table {
    width: 100%;
    min-width: 900px;
}

.att-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

table.att-sheet {
    width: max-content;
    min-width: 100%;
}

/* ============================================================
   MOBILE APP-STYLE BOTTOM NAVIGATION
   ============================================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 1045;
    box-shadow: 0 -6px 20px rgba(37, 99, 235, 0.06);
}

.mobile-bottom-nav .bn-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-bottom-nav .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    flex: 1;
    padding: 4px 2px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-bottom-nav .bn-item i {
    font-size: 19px;
    line-height: 1;
}

.mobile-bottom-nav .bn-item.active {
    color: var(--blue);
}

.mobile-bottom-nav .bn-item .bn-badge {
    position: absolute;
    top: -2px;
    right: 18%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    border: 2px solid #fff;
}

/* ============================================================
   GLOBAL SAFETY NET
   ============================================================ */
.top-header,
.mobile-topbar,
.sidebar,
.sidebar-foot,
.wh-stats,
.nav-item-link {
    max-width: 100%;
}

/* ============================================================
   MOBILE SEARCH TOGGLE + SEARCH BAR (Premium)
   ============================================================ */
.mobile-topbar .tb-search-toggle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eaf1fe, #dbeafe);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--blue-dark);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
.mobile-topbar .tb-search-toggle:active {
  transform: scale(0.92);
}
.mobile-topbar .tb-search-toggle.active {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.mobile-search-bar {
  max-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  z-index: 1029;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.28s ease;
}
.mobile-search-bar.show {
  max-height: 80px;
  padding: 4px 16px 14px;
  border-bottom-color: var(--border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.mobile-search-bar .search-form {
  animation: mobileSearchFade 0.3s ease;
}

.mobile-search-bar .search-form input {
  width: 100%;
  font-size: 13.5px;
  padding: 11px 68px 11px 40px;
  border-radius: 14px;
  transition: var(--transition);
}
.mobile-search-bar .search-form input:focus {
  background: #fff;
}

/* ============================================================
   SEARCH (Top header + full-page search form) — FINAL, CONSOLIDATED
   ============================================================ */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.top-search input,
.search-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 75px 10px 42px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}

.top-search input {
    border-radius: 30px;
    padding: 10px 16px 10px 40px;
}

.top-search input::placeholder,
.search-form input::placeholder {
    color: #8496b3;
    opacity: 1;
}

.top-search input:focus,
.search-form input:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #5a7096;
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #ef4444;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-bar .search-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.mobile-search-bar .search-clear {
  right: 50px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fee2e2;
}

@keyframes mobileSearchFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Desktop: hide mobile search toggle + bar (top-header search already shows) */
@media (min-width: 992px) {
  .mobile-search-bar,
  .mobile-topbar .tb-search-toggle {
    display: none !important;
  }
}

/* Small phones: tighter spacing */
@media (max-width: 575.98px) {
  .mobile-search-bar.show {
    max-height: 74px;
    padding: 4px 14px 12px;
  }
  .mobile-search-bar .search-form input {
    font-size: 13px;
    padding: 10px 62px 10px 38px;
  }

  .theme-toggle-btn {
    bottom: 84px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 14px;
}
}

/* ============================================================
   RESPONSIVE — SMALL LAPTOPS (992px–1199.98px)
   ============================================================ */
@media (min-width: 992px) and (max-width: 1199.98px) {
    :root {
        --sbw: 220px;
    }

    .main {
        padding: 20px 22px;
        padding-top: 84px;
    }

    .top-header {
        padding: 12px 20px;
        left: var(--sbw);
    }

    .top-header .th-left h1 {
        font-size: 19px;
    }

    .top-header .th-left .crumb {
        font-size: 11.5px;
    }

    .top-search {
        max-width: 260px;
        min-width: 140px;
    }

    .th-profile {
        padding: 5px 12px 5px 5px;
    }

    .th-profile .tp-info {
        display: none;
    }

    .th-profile i.chev {
        display: none;
    }

    .nav-item-link {
        font-size: 13px;
        padding: 9px 12px;
    }

    .nav-item-link i {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .brand-logo {
        width: 120px;
    }

    .welcome-header {
        padding: 22px;
    }

    .welcome-header h2 {
        font-size: 21px;
    }
}

/* ============================================================
   RESPONSIVE — TABLET & BELOW (≤991.98px)
   Mobile sidebar, bottom nav, no top header
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        width: 100vw;
        max-width: 100%;
        padding: 24px 20px;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.2);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .main {
        padding: 16px;
       
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .top-header {
        display: none !important;
    }

    .mobile-topbar {
        display: flex !important;
    }

    .mobile-bottom-nav {
        display: block;
    }

    .welcome-header {
        padding: 22px;
        border-radius: 18px;
        margin-bottom: 16px;
    }

    .welcome-header h2 {
        font-size: 20px;
    }

    .welcome-header p {
        font-size: 13px;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤767.98px)
   Full-screen sidebar with larger touch targets
   ============================================================ */
@media (max-width: 767.98px) {
    .sidebar {
        width: 100vw;
        max-width: 100%;
        padding: 28px 22px;
    }

    .sidebar .brand {
        padding: 8px 4px 32px;
    }

    .brand-logo {
        width: 150px;
    }

    .nav-item-link {
        font-size: 16px;
        padding: 14px 18px;
        gap: 14px;
        border-radius: 14px;
    }

    .nav-item-link i {
        width: 38px;
        height: 38px;
        font-size: 18px;
        border-radius: 10px;
    }

    .nav-label {
        font-size: 11.5px;
        margin: 22px 0 10px 14px;
    }

    .sidebar-foot {
        margin-top: 20px;
        padding-top: 18px;
        gap: 14px;
    }

    .sf-user .avatar {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .sf-info .nm {
        font-size: 15px;
    }

    .sf-info .rl {
        font-size: 12px;
    }

    .sf-logout {
        width: 40px;
        height: 40px;
        font-size: 17px;
        border-radius: 12px;
    }

    .main {
        padding: 14px 14px calc(78px + env(safe-area-inset-bottom));
    }

    .mobile-topbar {
        padding: 14px 16px;
    }

    .mobile-topbar .avatar {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .welcome-header {
        padding: 20px;
        border-radius: 16px;
        margin-bottom: 14px;
    }

    .welcome-header h2 {
        font-size: 18px;
    }

    .welcome-header p {
        font-size: 12.5px;
    }

    .wh-stats {
        gap: 0;
        width: 100%;
        justify-content: space-between;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .wh-stat {
        text-align: center;
        flex: 1;
    }

    .wh-stat .num {
        font-size: 17px;
    }

    .wh-stat .lbl {
        font-size: 10px;
    }

    .app-card {
        padding: 16px;
        border-radius: 16px;
    }

    .app-card h3 {
        font-size: 14.5px;
        margin-bottom: 12px;
    }

    .section-title {
        margin: 22px 0 12px;
    }

    .section-title h2 {
        font-size: 16px;
    }

    .section-title .sub {
        font-size: 11px;
    }

   .theme-toggle-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

    /* Full-width columns on mobile */
    .row.g-3 > [class*="col-lg-6"] {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Overflow fixes */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100%;
    }

    .row > [class*="col-"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .container,
    .container-fluid {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }

    .wh-stats,
    .att-mini-row,
    .att-mini-stats,
    .th-profile,
    .chat-contact,
    .notif-item {
        flex-wrap: wrap;
        min-width: 0;
    }

    .t-title,
    .t-desc,
    .p-title,
    .p-desc,
    .dl-title,
    .dl-sub,
    .nt,
    .ns,
    .label {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .stat-card,
    .app-card,
    .welcome-header,
    .task-card,
    .project-card,
    .notif-item,
    .announcement {
        min-width: 0;
        max-width: 100%;
    }
}

/* ============================================================
   RESPONSIVE — BETWEEN TOPBAR & MOBILE (576px–767.98px)
   ============================================================ */
@media (min-width: 576px) and (max-width: 767.98px) {
    .top-search {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE — STANDARD PHONES (≤575.98px)
   ============================================================ */
@media (max-width: 575.98px) {
    .sidebar {
        padding: 22px 18px;
    }

    .sidebar .brand {
        padding: 4px 4px 24px;
    }

    .brand-logo {
        width: 130px;
    }

    .nav-item-link {
        font-size: 15px;
        padding: 12px 16px;
        gap: 12px;
    }

    .nav-item-link i {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .nav-label {
        font-size: 10px;
        margin: 16px 0 6px 10px;
    }

    .sf-info .nm {
        font-size: 12.5px;
    }

    .sf-info .rl {
        font-size: 10.5px;
    }

    .sf-logout {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .main {
        padding: 12px 12px calc(78px + env(safe-area-inset-bottom));
    }

    .mobile-topbar {
        padding: 12px 14px;
    }

    .mobile-topbar .avatar {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .mobile-topbar .tb-bell {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .welcome-header {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: 12px;
    }

    .welcome-header h2 {
        font-size: 16px;
    }

    .welcome-header p {
        font-size: 11.5px;
    }

    .wh-stat .num {
        font-size: 15px;
    }

    .wh-stat .lbl {
        font-size: 9.5px;
    }

    .app-card {
        padding: 14px;
        border-radius: 14px;
    }

    .app-card h3 {
        font-size: 13.5px;
        margin-bottom: 10px;
    }

    .section-title {
        margin: 18px 0 10px;
        gap: 8px;
    }

    .section-title .sic {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .section-title h2 {
        font-size: 15px;
    }

    .section-title .sub {
        font-size: 11px;
    }

    .mobile-bottom-nav .bn-item i {
        font-size: 17px;
    }

    .mobile-bottom-nav .bn-item {
        font-size: 9.5px;
    }

    .theme-toggle-btn {
        bottom: 84px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ============================================================
   RESPONSIVE — SMALL PHONES (≤400px)
   ============================================================ */
@media (max-width: 400px) {
    .sidebar {
        padding: 18px 14px;
    }

    .brand-logo {
        width: 115px;
    }

    .nav-item-link {
        font-size: 14px;
        padding: 11px 14px;
    }

    .nav-item-link i {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .main {
        padding: 10px 10px calc(76px + env(safe-area-inset-bottom));
    }

    .mobile-topbar {
        padding: 10px 12px;
    }

    .welcome-header {
        padding: 14px;
        border-radius: 12px;
    }

    .welcome-header h2 {
        font-size: 15px;
    }

    .wh-stat .num {
        font-size: 14px;
    }

    .wh-stat .lbl {
        font-size: 9px;
    }

    .app-card {
        padding: 12px;
        border-radius: 12px;
    }

    .app-card h3 {
        font-size: 12.5px;
    }

    .mobile-bottom-nav .bn-item i {
        font-size: 16px;
    }

    .mobile-bottom-nav .bn-item {
        font-size: 9px;
        gap: 1px;
    }

   .theme-toggle-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
}
}

/* ============================================================
   RESPONSIVE — TINY PHONES (≤340px)
   ============================================================ */
@media (max-width: 340px) {
    .brand-logo {
        width: 100px;
    }

    .nav-item-link {
        font-size: 13px;
    }

    .welcome-header h2 {
        font-size: 14px;
    }

    .welcome-header p {
        font-size: 10.5px;
    }

    .wh-stat .num {
        font-size: 13px;
    }

    .wh-stat .lbl {
        font-size: 8.5px;
    }

    .app-card h3 {
        font-size: 12px;
    }

    .section-title h2 {
        font-size: 13.5px;
    }
}

/* ============================================================
   RESPONSIVE — LANDSCAPE PHONES (SHORT HEIGHT)
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .main {
        padding-top: 76px;
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .mobile-topbar {
        padding: 8px 14px;
    }

    .mobile-bottom-nav {
        padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav .bn-item i {
        font-size: 16px;
    }

    .mobile-bottom-nav .bn-item {
        font-size: 8.5px;
    }

    .welcome-header {
        padding: 14px 18px;
    }

    

    .sidebar {
        padding: 14px 10px;
    }
}