/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #222;
}

a {
    text-decoration: none;
}

/* Layout */
.app-container {
    min-height: 100vh;
}

.topbar {
    background: #0f172a;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 22px;
    font-weight: bold;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav a {
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    transition: 0.3s;
}

.nav a:hover {
    background: rgba(255,255,255,0.15);
}

.welcome-bar {
    display: none;
}

.main-content {
    padding: 20px;
    max-width: 1280px;
    margin: auto;
}

.page-title {
    margin-bottom: 20px;
    font-size: 28px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.login-wrapper {
    min-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.subtext {
    color: #666;
    margin-bottom: 20px;
}

.demo-box {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.btn {
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-full {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-card h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 28px;
    font-weight: bold;
    color: #111827;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.styled-table th,
.styled-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
}

.styled-table th {
    background: #f8fafc;
}

.styled-table td {
    vertical-align: top;
}

/* Tasks */
.task-list {
    display: grid;
    gap: 15px;
}

.task-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.task-card p {
    margin-top: 8px;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.badge-low {
    background: #64748b;
}

.badge-medium {
    background: #2563eb;
}

.badge-high {
    background: #f59e0b;
}

.badge-critical {
    background: #dc2626;
}

.status-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

/* Extra buttons */
.btn-secondary {
    background: #64748b;
    color: #fff;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

/* Mobile */
@media (max-width: 991px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        width: 100%;
        flex-direction: column;
    }

    .nav a {
        width: 100%;
        background: rgba(255,255,255,0.08);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }

    .main-content {
        padding: 15px;
    }

    .task-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Create task helper text */
.form-group small {
    font-size: 13px;
    line-height: 1.4;
}

/* =========================================
   HEADER / NAVIGATION - SINGLE ROW DESKTOP
========================================= */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.app-header-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 14px 20px;
}

.app-header-left,
.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.app-logo:hover {
    color: #2563eb;
}

.desktop-nav-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.header-user-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.header-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.header-user-role {
    font-size: 12px;
    color: #64748b;
    line-height: 1.1;
}

.header-icon-link {
    position: relative;
    display: inline-flex;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    flex-direction: column-reverse;
    align-content: stretch;
    align-items: center;
    flex-wrap: wrap;
}

.header-icon-link:hover,
.header-icon-link.active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.header-icon {
    font-size: 18px;
    line-height: 1;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.desktop-nav-link,
.desktop-nav-dropdown-btn,
.desktop-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.desktop-nav-link {
    color: #334155;
    background: transparent;
}

.desktop-nav-link:hover,
.desktop-nav-link.active {
    color: #0f172a;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.desktop-logout-btn {
    color: #dc2626;
    background: #fff5f5;
    border-color: #fecaca;
    flex-shrink: 0;
}

.desktop-logout-btn:hover {
    background: #fee2e2;
}

.desktop-nav-dropdown {
    position: relative;
}

.desktop-nav-dropdown-btn {
    cursor: pointer;
    background: transparent;
    color: #334155;
}

.desktop-nav-dropdown-btn:hover {
    color: #0f172a;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.desktop-nav-dropdown.open .desktop-nav-dropdown-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

.desktop-nav-caret {
    font-size: 12px;
    color: #64748b;
}

.desktop-nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    padding: 8px;
    display: none;
    z-index: 1100;
}

.desktop-nav-dropdown.open .desktop-nav-dropdown-menu {
    display: block;
}

.desktop-nav-dropdown-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
}

.desktop-nav-dropdown-menu a:hover,
.desktop-nav-dropdown-menu a.active {
    background: #f8fafc;
    color: #0f172a;
}

.mobile-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.mobile-nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #1e3a8a;
    border-radius: 999px;
    transition: all 0.25s ease;
}

.mobile-nav-toggle.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1200;
}

.mobile-nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-panel {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    padding: 16px;
    z-index: 1300;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px) scale(0.98);
    transition: all 0.25s ease;
}

.mobile-nav-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mobile-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 14px;
}

.mobile-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-user-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-user-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.mobile-user-role {
    font-size: 13px;
    color: #64748b;
}

.mobile-session-badge-wrap {
    display: flex;
    justify-content: center;
}

.mobile-nav-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-nav-group-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0 4px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0f172a;
}

.mobile-logout-link {
    color: #dc2626 !important;
    background: #fff5f5 !important;
    border-color: #fecaca !important;
}

body.mobile-nav-open {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .header-user-summary {
        display: none;
    }

    .desktop-nav-inline {
        gap: 8px;
    }

    .desktop-nav-link,
    .desktop-nav-dropdown-btn,
    .desktop-logout-btn {
        padding: 0 12px;
        font-size: 13px;
    }
}

@media (max-width: 992px) {
    .desktop-nav-inline,
    .desktop-logout-btn {
        display: none;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }

    .header-user-summary {
        display: none;
    }

    .app-header-bar {
        grid-template-columns: auto 1fr auto;
        padding: 12px 14px;
    }

    .app-logo {
        font-size: 20px;
    }

    .app-header-right {
        justify-content: flex-end;
    }
}

@media (max-width: 600px) {
    .mobile-nav-panel {
        top: 66px;
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 76px);
        padding: 14px;
        border-radius: 18px;
    }

    .mobile-nav-links a {
        font-size: 14px;
        padding: 12px 13px;
    }

    .session-timer-badge {
        min-width: 72px;
        height: 32px;
        font-size: 11px;
        padding: 0 10px;
    }
}

@media (min-width: 993px) {
    .mobile-nav-overlay,
    .mobile-nav-panel {
        display: none !important;
    }
}

/* Mobile-friendly table improvements */
.mobile-table-box {
    max-height: 62vh;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.mobile-table-box table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 5;
}

.compact-mobile-table th,
.compact-mobile-table td {
    padding: 10px 10px;
    font-size: 13px;
    white-space: nowrap;
}

.mobile-filter-panel {
    display: none;
    margin-bottom: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
}

.mobile-filter-panel.open {
    display: block;
}

.mobile-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.mobile-filter-toggle {
    display: none;
}

.hide-mobile {
    display: table-cell;
}

/* Task modal */
.task-modal-overlay {
    position: fixed;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1400;
}

.task-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.task-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(92vw, 520px);
    max-height: 82vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    transform: translate(-50%, -52%) scale(0.98);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1500;
}

.task-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.task-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
}

.task-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.task-modal-close {
    border: none;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 22px;
    cursor: pointer;
    color: #334155;
}

.task-modal-body {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.task-detail-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.task-detail-row strong {
    color: #0f172a;
    font-size: 13px;
}

.task-detail-row span {
    color: #334155;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 991px) {
    .mobile-filter-toggle {
        display: inline-flex;
    }

    .hide-mobile {
        display: none;
    }

    .compact-mobile-table th,
    .compact-mobile-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .mobile-table-box {
        max-height: 58vh;
    }
}

@media (max-width: 600px) {
    .mobile-filter-grid {
        grid-template-columns: 1fr;
    }

    .mobile-table-box {
        max-height: 55vh;
    }

    .task-modal {
        width: calc(100vw - 20px);
    }
}

/* My Tasks tabbed view */
.my-tasks-tabs-card {
    padding: 14px;
}

.task-status-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.task-tab {
    border: 1px solid #dbe2ea;
    background: #f8fafc;
    color: #334155;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.task-tab span {
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 999px;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}

.task-tab:hover {
    background: #e2e8f0;
}

.task-tab.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.task-tab.active span {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.my-task-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 12px 0;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.no-my-task-message {
    text-align: center;
    color: #64748b;
}

@media (max-width: 768px) {
    .task-status-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .task-tab {
        justify-content: center;
        width: 100%;
        text-align: center;
        font-size: 13px;
        padding: 10px 12px;
    }

    .my-task-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .task-status-tabs {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Modern Login Page
========================================= */

.login-page {
    min-height: calc(100vh - 0px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-shell {
    width: 100%;
    max-width: 1120px;
    min-height: 680px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
}

.login-brand-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-brand-content {
    max-width: 420px;
}

.login-brand-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.login-brand-panel h1 {
    font-size: 42px;
    line-height: 1.1;
    margin: 0 0 14px;
    color: #ffffff;
}

.login-brand-panel p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 26px;
}

.login-feature-list {
    display: grid;
    gap: 12px;
}

.login-feature-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: #ffffff;
}

.modern-login-card {
    width: 100%;
    max-width: 430px;
    padding: 0;
    box-shadow: none;
    background: transparent;
    margin: 0;
}

.login-card-header {
    margin-bottom: 22px;
}

.login-card-header h2 {
    margin: 0 0 8px;
    font-size: 32px;
    color: #0f172a;
}

.login-card-header p {
    margin: 0;
    font-size: 15px;
    color: #64748b;
}

.login-modern-form .form-group {
    margin-bottom: 18px;
}

.login-modern-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.login-modern-form input {
    width: 100%;
    height: 50px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 0 14px;
    font-size: 15px;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-modern-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 78px;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: none;
    background: #f1f5f9;
    color: #334155;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}

.password-toggle-btn:hover {
    background: #e2e8f0;
}

.login-submit-btn {
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
    margin-top: 6px;
}

.login-demo-box {
    margin-top: 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px;
}

.login-demo-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
}

.login-demo-grid {
    display: grid;
    gap: 10px;
}

.login-demo-item {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.login-demo-item strong {
    color: #0f172a;
    font-size: 14px;
}

.login-demo-item span {
    color: #475569;
    font-size: 13px;
    word-break: break-word;
}

/* Make login page use full width without normal app max width feel */
.login-page .card {
    box-shadow: none;
}

@media (max-width: 991px) {
    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-brand-panel {
        padding: 32px 24px;
    }

    .login-brand-content {
        max-width: none;
    }

    .login-brand-panel h1 {
        font-size: 34px;
    }

    .login-form-panel {
        padding: 30px 22px;
    }

    .modern-login-card {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .login-page {
        padding: 14px;
    }

    .login-shell {
        border-radius: 22px;
    }

    .login-brand-panel {
        padding: 24px 18px;
    }

    .login-brand-panel h1 {
        font-size: 28px;
    }

    .login-brand-panel p {
        font-size: 14px;
    }

    .login-feature-item {
        font-size: 14px;
        padding: 12px 14px;
    }

    .login-form-panel {
        padding: 22px 16px;
    }

    .login-card-header h2 {
        font-size: 26px;
    }

    .login-card-header p {
        font-size: 14px;
    }

    .login-modern-form input {
        height: 48px;
        font-size: 14px;
    }

    .login-submit-btn {
        height: 48px;
    }

    .login-demo-box {
        padding: 14px;
    }
}

/* =========================================
   Cleaner Mobile Login
========================================= */

@media (max-width: 768px) {
    .login-page {
        padding: 10px;
        min-height: 100vh;
        background: #f8fafc;
    }

    .login-shell {
        display: block;
        min-height: auto;
        border-radius: 18px;
        max-width: 460px;
        margin: 0 auto;
        box-shadow: 0 16px 35px rgba(15, 23, 42, 0.10);
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        padding: 20px 16px;
    }

    .modern-login-card {
        max-width: 100%;
    }

    .login-card-header {
        text-align: center;
        margin-bottom: 18px;
    }

    .login-card-header h2 {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .login-card-header p {
        font-size: 14px;
        line-height: 1.4;
    }

    .login-modern-form .form-group {
        margin-bottom: 14px;
    }

    .login-modern-form label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .login-modern-form input {
        height: 46px;
        border-radius: 12px;
        font-size: 14px;
    }

    .password-toggle-btn {
        height: 32px;
        font-size: 12px;
        padding: 0 10px;
    }

    .login-submit-btn {
        height: 46px;
        border-radius: 12px;
        font-size: 14px;
    }

    .login-demo-box {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 8px;
    }

    .login-shell {
        border-radius: 16px;
    }

    .login-form-panel {
        padding: 16px 14px;
    }

    .login-card-header h2 {
        font-size: 22px;
    }

    .login-card-header p {
        font-size: 13px;
    }
}

.login-mobile-app-title {
    display: none;
}

@media (max-width: 768px) {
    .login-mobile-app-title {
        display: block;
        font-size: 13px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #2563eb;
        margin-bottom: 8px;
    }
}

/* =========================================
   Smart Auto Logout Modal
========================================= */

.session-timeout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
}

.session-timeout-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(92vw, 420px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
    border: 1px solid #e2e8f0;
    transform: translate(-50%, -52%) scale(0.98);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 2100;
    overflow: hidden;
}

.session-timeout-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.session-timeout-header {
    padding: 18px 20px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.session-timeout-header h3 {
    margin: 0;
    font-size: 20px;
    color: #0f172a;
}

.session-timeout-body {
    padding: 18px 20px;
    color: #334155;
    line-height: 1.6;
}

.session-timeout-body p {
    margin: 0 0 10px;
}

.session-timeout-body p:last-child {
    margin-bottom: 0;
}

.session-timeout-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 0 20px 20px;
    flex-wrap: wrap;
}

.session-timeout-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .session-timeout-modal {
        width: calc(100vw - 20px);
    }

    .session-timeout-actions {
        flex-direction: column;
    }

    .session-timeout-actions .btn,
    .session-timeout-actions a.btn {
        width: 100%;
        text-align: center;
    }
}

.session-timer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.session-timer-badge.warning {
    background: #facc15;
    color: #111827;
}

.session-timer-badge.danger {
    background: #ef4444;
    color: #ffffff;
}

.mobile-session-timer-badge {
    min-width: 92px;
    height: 36px;
    font-size: 13px;
}

.session-timeout-popup {
    width: min(100%, 420px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    padding: 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.session-timeout-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.session-timeout-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 18px;
}

.session-timeout-countdown {
    font-size: 28px;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 18px;
}

.session-timeout-btn {
    border: none;
    background: #2563eb;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    min-width: 160px;
    transition: background 0.2s ease;
}

.session-timeout-btn:hover {
    background: #1d4ed8;
}

@media (max-width: 768px) {
    .session-timer-badge {
        min-width: 72px;
        height: 32px;
        font-size: 11px;
        padding: 0 10px;
    }

    .mobile-session-timer-badge {
        min-width: 90px;
        height: 36px;
        font-size: 13px;
    }

    .session-timeout-popup {
        padding: 20px;
        border-radius: 16px;
    }

    .session-timeout-title {
        font-size: 18px;
    }

    .session-timeout-countdown {
        font-size: 24px;
    }
}

/* =========================================
   DASHBOARD - CLEAN AND SPACE EFFICIENT
========================================= */

.dashboard-page {
    display: grid;
    gap: 18px;
}

.dashboard-top-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 0;
}

.dashboard-top-strip-left {
    min-width: 0;
}

.dashboard-top-strip-left h1 {
    margin: 0 0 4px;
    font-size: 26px;
    color: #0f172a;
    line-height: 1.1;
}

.dashboard-top-strip-left p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.dashboard-top-strip-right {
    flex-shrink: 0;
}

.dashboard-inline-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 0;
}

.dashboard-stat-card {
    text-align: left;
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dashboard-stat-card.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
    background: #f8fbff;
}

.dashboard-stat-card .stat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dashboard-stat-card h3 {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 700;
}

.dashboard-stat-card p {
    margin: 0 0 6px;
    font-size: 30px;
    line-height: 1;
    color: #0f172a;
}

.dashboard-stat-card small {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.35;
}

.dashboard-stat-alert {
    border-color: #fecaca;
    background: linear-gradient(to bottom, #ffffff, #fff7f7);
}

.dashboard-tasks-card {
    padding: 18px;
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-section-header h2 {
    font-size: 22px;
    margin: 0 0 4px;
    color: #0f172a;
}

.section-subtext {
    margin-top: 0;
    color: #64748b;
    font-size: 14px;
}

.dashboard-toolbar {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.dashboard-search-box label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #475569;
}

.dashboard-search-box input {
    width: 100%;
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    padding: 0 14px;
    font-size: 15px;
}

.dashboard-search-box input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.dashboard-filter-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
}

.dashboard-filter-grid .form-group {
    margin-bottom: 0;
}

.dashboard-filter-grid label {
    font-size: 13px;
    margin-bottom: 6px;
    color: #475569;
}

.dashboard-filter-grid input,
.dashboard-filter-grid select {
    height: 44px;
    background: #fff;
    width: 100%;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
}

.dashboard-filter-grid input:focus,
.dashboard-filter-grid select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.dashboard-filter-action .btn {
    width: 100%;
    height: 44px;
}

.dashboard-desktop-view {
    display: block;
}

.dashboard-mobile-view {
    display: none;
}

.dashboard-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-task-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.dashboard-task-table th,
.dashboard-task-table td {
    vertical-align: middle;
}

.dashboard-task-table th {
    padding: 13px 14px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
    background: #f8fafc;
    white-space: nowrap;
}

.dashboard-task-table td {
    padding: 14px;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.dashboard-task-table tbody tr {
    transition: background 0.15s ease;
}

.dashboard-task-table tbody tr:hover {
    background: #f8fbff;
}

.col-task {
    width: 36%;
}

.col-assigned {
    width: 22%;
}

.col-priority {
    width: 13%;
}

.col-status {
    width: 13%;
}

.col-date {
    width: 110px;
    white-space: nowrap;
}

.col-view {
    width: 90px;
    white-space: nowrap;
}

.dashboard-task-title-cell {
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-cell {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
    line-height: 1.4;
}

.dashboard-task-table .btn-sm {
    min-width: 74px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}

.priority-low {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.priority-medium {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.priority-high {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.priority-critical {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.priority-default {
    background: #f8fafc;
    color: #334155;
    border-color: #e2e8f0;
}

.status-pending {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.status-in-progress {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.status-completed {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.status-on-hold {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

.status-cancelled {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.status-default {
    background: #f8fafc;
    color: #334155;
    border-color: #e2e8f0;
}

.dashboard-due-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.due-date-today {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.due-date-overdue {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.text-center {
    text-align: center;
}

.no-data-row td {
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.dashboard-empty-state {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

.dashboard-mobile-task-list {
    display: grid;
    gap: 12px;
}

.dashboard-mobile-task-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.dashboard-mobile-task-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-mobile-task-top h3 {
    font-size: 16px;
    line-height: 1.4;
    color: #0f172a;
    margin: 0;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.dashboard-mobile-task-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-mobile-task-meta > div {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.meta-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 5px;
}

.dashboard-mobile-task-meta strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.4;
}

.mobile-truncate {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dashboard-mobile-task-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.dashboard-mobile-task-bottom .btn-sm {
    min-width: 108px;
}

@media (max-width: 1260px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-filter-action {
        grid-column: span 2;
    }
}

@media (max-width: 991px) {
    .dashboard-top-strip {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-top-strip-left h1 {
        font-size: 24px;
    }

    .dashboard-inline-date {
        min-height: 38px;
        font-size: 13px;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .dashboard-stat-card {
        padding: 14px;
    }

    .dashboard-stat-card p {
        font-size: 26px;
    }

    .dashboard-tasks-card {
        padding: 16px;
    }

    .dashboard-filter-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-action {
        grid-column: span 1;
    }

    .dashboard-desktop-view {
        display: none;
    }

    .dashboard-mobile-view {
        display: block;
    }
}

@media (max-width: 600px) {
    .dashboard-page {
        gap: 14px;
    }

    .dashboard-top-strip,
    .dashboard-tasks-card {
        padding: 14px;
    }

    .dashboard-top-strip-left h1 {
        font-size: 22px;
    }

    .dashboard-top-strip-left p {
        font-size: 13px;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .dashboard-stat-card {
        padding: 13px;
    }

    .dashboard-stat-card h3 {
        font-size: 13px;
    }

    .dashboard-stat-card p {
        font-size: 24px;
    }

    .dashboard-stat-card small {
        font-size: 12px;
    }

    .dashboard-section-header h2 {
        font-size: 20px;
    }

    .dashboard-search-box input,
    .dashboard-filter-grid input,
    .dashboard-filter-grid select,
    .dashboard-filter-action .btn {
        height: 42px;
        font-size: 14px;
    }

    .dashboard-mobile-task-meta {
        grid-template-columns: 1fr;
    }

    .dashboard-mobile-task-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-mobile-task-bottom .btn {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================
   DASHBOARD - ULTRA COMPACT SUMMARY
========================================= */

.dashboard-page {
    display: grid;
    gap: 14px;
}

.dashboard-top-strip-compact {
    padding: 12px 16px;
    margin-bottom: 0;
}

.dashboard-top-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dashboard-top-strip-left h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
    color: #0f172a;
}

.dashboard-top-strip-left p {
    display: none;
}

.dashboard-inline-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    margin-bottom: 0;
}

.dashboard-summary-pill {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    border-radius: 12px;
    min-height: 42px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font: inherit;
}

.dashboard-summary-pill:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.dashboard-summary-pill.active {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.dashboard-summary-pill-alert {
    background: #fff7f7;
    border-color: #fecaca;
}

.dashboard-summary-pill-alert:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.dashboard-summary-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
}

.dashboard-summary-count {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.dashboard-summary-pill.active .dashboard-summary-count {
    background: #2563eb;
    color: #fff;
}

.dashboard-summary-pill-alert .dashboard-summary-count {
    background: #fee2e2;
    color: #b91c1c;
}

.dashboard-tasks-card {
    padding: 14px;
}

.dashboard-section-header {
    margin-bottom: 10px;
}

.dashboard-section-header h2 {
    font-size: 18px;
    margin: 0 0 2px;
    color: #0f172a;
}

.section-subtext {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.dashboard-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-search-box label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #475569;
}

.dashboard-search-box input {
    width: 100%;
    height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    padding: 0 12px;
    font-size: 14px;
}

.dashboard-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
}

.dashboard-filter-grid .form-group {
    margin-bottom: 0;
}

.dashboard-filter-grid label {
    font-size: 12px;
    margin-bottom: 5px;
    color: #475569;
}

.dashboard-filter-grid input,
.dashboard-filter-grid select {
    height: 40px;
    background: #fff;
    width: 100%;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
}

.dashboard-filter-action .btn {
    width: 100%;
    height: 40px;
}

.dashboard-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-task-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.dashboard-task-table th {
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
    background: #f8fafc;
    white-space: nowrap;
}

.dashboard-task-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.col-task {
    width: 38%;
}

.col-assigned {
    width: 22%;
}

.col-priority {
    width: 12%;
}

.col-status {
    width: 12%;
}

.col-date {
    width: 110px;
    white-space: nowrap;
}

.col-view {
    width: 90px;
    white-space: nowrap;
}

.dashboard-task-title-cell {
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-cell {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
    line-height: 1.35;
}

.dashboard-task-table .btn-sm {
    min-width: 72px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.dashboard-due-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.due-date-today {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.due-date-overdue {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.dashboard-mobile-task-list {
    display: grid;
    gap: 10px;
}

.dashboard-mobile-task-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.dashboard-mobile-task-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-mobile-task-top h3 {
    font-size: 15px;
    line-height: 1.35;
    color: #0f172a;
    margin: 0;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.dashboard-mobile-task-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-mobile-task-meta > div {
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.meta-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 4px;
}

.dashboard-mobile-task-meta strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
}

.mobile-truncate {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dashboard-mobile-task-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.dashboard-mobile-task-bottom .btn-sm {
    min-width: 100px;
}

@media (max-width: 1100px) {
    .dashboard-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-filter-action {
        grid-column: span 2;
    }
}

@media (max-width: 991px) {
    .dashboard-top-strip-compact {
        padding: 12px 14px;
    }

    .dashboard-top-strip-left h1 {
        font-size: 18px;
    }

    .dashboard-inline-date {
        min-height: 34px;
        font-size: 12px;
    }

    .dashboard-desktop-view {
        display: none;
    }

    .dashboard-mobile-view {
        display: block;
    }

    .dashboard-filter-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-action {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .dashboard-page {
        gap: 12px;
    }

    .dashboard-summary-strip {
        padding: 10px;
        gap: 8px;
    }

    .dashboard-summary-pill {
        flex: 1 1 calc(50% - 8px);
        justify-content: space-between;
    }

    .dashboard-tasks-card {
        padding: 12px;
    }

    .dashboard-section-header h2 {
        font-size: 17px;
    }

    .dashboard-search-box input,
    .dashboard-filter-grid input,
    .dashboard-filter-grid select,
    .dashboard-filter-action .btn {
        height: 38px;
        font-size: 14px;
    }

    .dashboard-mobile-task-meta {
        grid-template-columns: 1fr;
    }

    .dashboard-mobile-task-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-mobile-task-bottom .btn {
        width: 100%;
    }
}
/* =========================================
   MY TASKS - COMPACT AND CLEAN
========================================= */



.my-tasks-top-strip {
    padding: 12px 16px;
    margin-bottom: 0;
}

.my-tasks-top-strip-left h1 {
    margin: 0 0 3px;
    font-size: 22px;
    line-height: 1.1;
    color: #0f172a;
}

.my-tasks-top-strip-left p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.my-tasks-tabs-card {
    padding: 12px;
    margin-bottom: 0;
}

.task-status-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.task-tab {
    border: 1px solid #dbe2ea;
    background: #f8fafc;
    color: #334155;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.task-tab span {
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 999px;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}

.task-tab:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.task-tab.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.task-tab.active span {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.my-task-list {
    gap: 12px;
}

.my-task-item {
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.05);
    margin-bottom: 0;
    padding: 0;
}

.task-is-locked {
    border-color: #e5e7eb;
    background: #fcfcfd;
}

.task-collapse-toggle {
    width: 100%;
    border: none;
    background: transparent;
    padding: 14px;
    cursor: pointer;
    text-align: left;
}

.task-collapse-toggle:hover {
    background: #f8fafc;
}

.task-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.task-summary-top-left {
    flex: 1;
    min-width: 0;
}

.task-summary-top-left h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    color: #101828;
    word-break: break-word;
}

.task-summary-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.task-chevron {
    font-size: 30px;
    color: #667085;
    transition: transform 0.40s ease;
}

.my-task-item.expanded .task-chevron {
    transform: rotate(180deg);
}

.compact-summary-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.compact-summary-meta > div {
    background: #f8fafc;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    padding: 8px 10px;
    min-width: 0;
}

.compact-summary-meta strong {
    color: #101828;
    font-size: 13px;
    line-height: 1.35;
}

.task-collapsible-body {
    display: none;
    padding: 14px;
    border-top: 1px solid #eaecf0;
    background: #fcfcfd;
}

.my-task-item.expanded .task-collapsible-body {
    display: block;
}

.my-task-detail-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.my-task-update-form {
    margin-top: 6px;
}

.my-task-form-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 14px;
}

.task-detail-row {
    margin-bottom: 0;
    color: #344054;
    line-height: 1.6;
}

.task-detail-row strong {
    display: block;
    color: #101828;
    font-size: 13px;
    margin-bottom: 4px;
}

.task-detail-row span {
    color: #475467;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.status-form {
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
}

.task-readonly-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fffaeb;
    border: 1px solid #fedf89;
    color: #b54708;
    font-size: 13px;
}

.task-button-row {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
}

.no-my-task-message {
    text-align: center;
    padding: 24px;
}

@media (max-width: 992px) {
    .compact-summary-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .my-task-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .my-tasks-page {
        gap: 12px;
    }

    .my-tasks-top-strip {
        padding: 12px 14px;
    }

    .my-tasks-top-strip-left h1 {
        font-size: 20px;
    }

    .my-tasks-top-strip-left p {
        font-size: 12px;
    }

    .task-collapse-toggle,
    .task-collapsible-body {
        padding: 12px;
    }

    .task-summary-top {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .task-summary-right {
        justify-content: space-between;
    }

    .compact-summary-meta {
        grid-template-columns: 1fr;
    }

    .task-status-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .task-tab {
        white-space: nowrap;
    }
}
/* =========================================
   ADMIN SUB-DROPDOWN SUPPORT
========================================= */

/* Desktop admin nested menu */
.desktop-admin-menu {
    min-width: 260px;
    padding: 8px;
}

.desktop-admin-submenu {
    position: relative;
}

.desktop-admin-submenu + .desktop-admin-submenu {
    margin-top: 4px;
}

.desktop-admin-submenu-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.desktop-admin-submenu-btn:hover {
    background: #f8fafc;
    color: #0f172a;
}

.desktop-admin-submenu.open > .desktop-admin-submenu-btn {
    background: #eff6ff;
    color: #0f172a;
}

.desktop-admin-submenu-panel {
    display: none;
    margin-top: 6px;
    margin-left: 8px;
    padding-left: 10px;
    border-left: 2px solid #e2e8f0;
}

.desktop-admin-submenu.open > .desktop-admin-submenu-panel {
    display: block;
}

.desktop-admin-submenu-panel a {
    display: block;
    padding: 9px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.desktop-admin-submenu-panel a:hover,
.desktop-admin-submenu-panel a.active {
    background: #f8fafc;
    color: #0f172a;
}

/* Mobile admin nested groups */
.mobile-admin-subgroup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-admin-subgroup + .mobile-admin-subgroup {
    margin-top: 4px;
}

.mobile-admin-subgroup-btn {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.mobile-admin-subgroup-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0f172a;
}

.mobile-admin-subgroup.open > .mobile-admin-subgroup-btn {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #0f172a;
}

.mobile-admin-subgroup-caret {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.22s ease;
}

.mobile-admin-subgroup.open .mobile-admin-subgroup-caret {
    transform: rotate(180deg);
}

.mobile-admin-subgroup-links {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding-left: 10px;
    border-left: 2px solid #e2e8f0;
    margin-left: 4px;
}

.mobile-admin-subgroup.open > .mobile-admin-subgroup-links {
    display: flex;
}

.mobile-admin-subgroup-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.mobile-admin-subgroup-links a:hover,
.mobile-admin-subgroup-links a.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0f172a;
}

@media (max-width: 992px) {
    .desktop-admin-menu,
    .desktop-admin-submenu,
    .desktop-admin-submenu-btn,
    .desktop-admin-submenu-panel {
        display: none !important;
    }
}

@media (min-width: 993px) {
    .mobile-admin-subgroup,
    .mobile-admin-subgroup-btn,
    .mobile-admin-subgroup-links {
        display: none !important;
    }
}