:root {
    --primary: #2563eb;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --primary-light: #eff6ff;
    --primary-dark: #1e3a8a;
    --secondary: #64748b;
    --surface: #f8fafc;
    --bg-main: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 280px;
    --header-height: 70px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #b91c1c;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Inter', system-ui, sans-serif;
}

body, html {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--surface);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Mobile browser friendly height */
    /* App-like behaviors */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

/* 1. Header */
header {
    height: calc(var(--header-height) + var(--safe-area-top));
    padding-top: var(--safe-area-top);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 0.5rem;
    padding-right: 1.5rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

header .brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 15px;
}

header .brand .btn-toggle {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

header .brand .btn-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

header .brand-text {
    transition: all 0.3s ease;
}

body.sidebar-collapsed .brand-text {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
}

header .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

/* 2. Main Layout */
.layout-container {
    display: flex;
    flex-direction: row;
    margin-top: calc(var(--header-height) + var(--safe-area-top));
    height: calc(100vh - (var(--header-height) + var(--safe-area-top)));
    width: 100%;
    overflow: hidden;
}

/* Sidebar */
aside.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 900;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

body.sidebar-collapsed aside.sidebar {
    width: 80px;
    min-width: 80px;
}

body.sidebar-collapsed aside.sidebar .sidebar-title,
body.sidebar-collapsed aside.sidebar .nav-item span,
body.sidebar-collapsed aside.sidebar .nav-sub-item span,
body.sidebar-collapsed aside.sidebar .submenu-arrow,
body.sidebar-collapsed aside.sidebar .copyright-section {
    display: none !important;
}

body.sidebar-collapsed header .brand {
    gap: 5px;
}

body.sidebar-collapsed aside.sidebar .nav-item,
body.sidebar-collapsed aside.sidebar .nav-sub-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    border-left-width: 4px;
}

body.sidebar-collapsed aside.sidebar .submenu {
    background: #f8fafc;
}

body.sidebar-collapsed aside.sidebar .nav-sub-item {
    padding: 0.8rem 0;
}

body.sidebar-collapsed aside.sidebar .nav-item i,
body.sidebar-collapsed aside.sidebar .nav-sub-item i {
    margin: 0;
    font-size: 1.25rem;
    width: auto;
}

body.sidebar-collapsed aside.sidebar .nav-sub-item {
    padding-left: 0;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0 0 0;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0 0.5rem 0;
    background: white;
    margin-top: auto;
}

.copyright-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid #f1f5f9;
    margin-top: 0.5rem;
    line-height: 1.4;
    text-align: center;
}

.copyright-section b {
    color: var(--primary-dark);
}

.sidebar-title {
    padding: 0 1.5rem 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-item {
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
    border-left: 3px solid transparent;
    overflow: hidden;
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item i.submenu-arrow {
    transition: transform 0.3s;
}

.nav-group.open i.submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    background: #fcfdfe;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.nav-sub-item {
    padding: 0.6rem 1.5rem 0.6rem 3rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-sub-item:hover,
.nav-sub-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-sub-item i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
}

/* Base Responsive Utilities */
aside.sidebar {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 900;
}

aside.sidebar.open {
    transform: translateX(0) !important;
    display: flex !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

#sidebar-overlay {
    transition: opacity 0.3s ease;
}

/* Base Responsive Utilities */
.responsive-grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-1 {
    grid-template-columns: 1fr;
}

@media (max-width: 768px) {
    .grid-md-1 {
        grid-template-columns: 1fr !important;
    }
}

/* Notification Badge */
.notification-badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
}

/* Main Content */
main.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.page-section {
    display: none;
    /* Hidden by default */
    animation: fadeIn 0.3s ease-out;
}

.page-section.active {
    display: block;
}

/* Card Styles */
.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card h3 {
    margin-bottom: 1.25rem;
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #f3f4f6;
    color: #64748b;
    cursor: not-allowed;
    border-color: #cbd5e1;
    opacity: 0.8;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
    margin-right: 5px;
}

.btn:last-child {
    margin-right: 0;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Dashboard Specifics */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.info-item div {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Posts & News Accordion Style */
.post-item {
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.post-item:hover {
    background: #f9fafb;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-title {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-content {
    display: none;
    margin-top: 1rem;
    padding: 1.2rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: #444;
    line-height: 1.6;
    animation: slideDown 0.3s ease-out;
}

.post-item.expanded .post-content {
    display: block;
}

/* NEWS COMPACT LIST */
.news-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.news-row>div:first-child {
    min-width: 0;
    flex: 1;
}

.news-row>div:last-child {
    flex-shrink: 0;
}

.news-row:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.news-row.unread {
    border-left: 5px solid var(--primary);
    background: linear-gradient(to right, var(--primary-light), white);
}

.news-row-title {
    font-weight: 600;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    max-width: 100%;
}

.news-row-meta {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* NEWS DETAIL VIEW */
.news-detail-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow-x: hidden;
}

.news-detail-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.news-detail-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.news-detail-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.news-detail-header h2 {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* BANNER UPDATES */
.news-banner-container {
    width: 100%;
    aspect-ratio: 16 / 6;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.news-banner-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-banner-container:hover img {
    transform: scale(1.02);
}

/* Unread Badge */
.unread-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* News Tabs */
.news-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Gateway Overlay (Login / Security) */
#gateway-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    /* Soft gray background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Note: Tasks utilize .news-row and .news-detail-container classes to maintain consistent compact styling */

/* CALENDAR STYLES */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border: 1px solid #e2e8f0;
    background: #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
    position: relative;
}

.calendar-grid>div {
    min-width: 120px;
    /* Ensure columns don't get too thin */
}


.calendar-header-day {
    background: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #64748b;
    font-size: 0.85rem;
    border-bottom: 1px solid #e2e8f0;
}

.calendar-day-cell {
    background: white;
    min-height: 120px;
    padding: 8px;
    border: 0.5px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    /* Allow individual day scroll if many tasks */
}

.calendar-day-cell.other-month {
    background: #f8fafc;
    color: #cbd5e1;
}

.calendar-day-cell.today {
    background: #eff6ff;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.calendar-task-item {
    background: #fff1f2;
    border: 1px solid #fee2e2;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.75rem;
    color: #b91c1c;
    word-break: break-word;
    overflow-wrap: break-word;
    cursor: pointer;
    transition: transform 0.1s;
    line-height: 1.4;
    display: block;
    margin-bottom: 4px;
}

.calendar-task-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-task-item.timeout {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
    font-weight: bold;
}

.calendar-day-cell.selected {
    background: #2563eb !important;
}

.calendar-day-cell.selected .calendar-day-number {
    color: white;
}

.calendar-day-cell.selected .calendar-task-item {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

@keyframes toast-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Toast notification container */
#toast-container {
    position: fixed !important;
    bottom: 16px !important;
    right: 16px !important;
    left: auto !important;
    width: 320px;
    max-width: calc(100vw - 32px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notification {
    width: 100%;
    box-sizing: border-box;
    /* Do NOT set word-break or overflow-wrap here — it cascades to children and breaks white-space:nowrap on title */
}

.toast-notification .toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    line-height: 1.3;
}

.toast-notification .toast-body {
    font-size: 0.82rem;
    opacity: 0.88;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    margin-top: 3px;
}

@media (max-width: 480px) {
    #toast-container {
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        bottom: 12px !important;
    }
}

/* Timeline Styles */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1rem;
}

.timeline-item {
    display: flex;
    gap: 20px;
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
    flex-shrink: 0;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    z-index: 2;
    margin-top: 6px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1), 0 0 0 4px var(--primary-light);
}

.timeline-line {
    width: 2px;
    height: 100%;
    background: var(--border);
    position: absolute;
    left: 11px;
    top: 15px;
}

.timeline-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.timeline-info b {
    color: var(--text-main);
    font-size: 1rem;
}

.timeline-action-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-left: 8px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.timeline-note {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border);
    line-height: 1.6;
}

.timeline-time {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Workflow Journey Visuals */
.workflow-journey-wrapper {
    display: flex;
    justify-content: flex-start;
    padding: 2rem 0 1rem;
    margin-bottom: 2rem;
    position: relative;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: thin;
}

.workflow-journey-wrapper::-webkit-scrollbar {
    height: 4px;
}

.workflow-journey-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.journey-step {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.journey-step::after {
    content: '';
    position: absolute;
    top: 24px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--line-color, #e2e8f0) !important;
    z-index: -1;
}

.journey-step:last-child::after {
    display: none;
}


.journey-step.completed::after,
.journey-step.passed-through::after {
    background: var(--success);
}

.journey-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #94a3b8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    position: relative;
}

.journey-step.active .journey-icon {
    border-color: var(--primary);
    color: white;
    background: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 75, 145, 0.15);
    border-width: 3px;
}

.journey-step.completed .journey-icon {
    border-color: var(--success);
    color: white;
    background: var(--success);
}

.journey-name {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-main);
    margin-bottom: 4px;
    padding: 0 5px;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    min-height: 2.4em;
}

.journey-status {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

/* JOURNEY STEP TIMEOUT */
.journey-step.timeout .journey-icon,
.journey-step.timeout .journey-name,
.journey-step.timeout .journey-status {
    color: #dc2626 !important;
}

.journey-step.timeout .journey-icon {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
}

.journey-step.timeout.active .journey-icon {
    background: #dc2626 !important;
    color: white !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.journey-step.timeout::after {
    background: #dc2626 !important;
}

/* Timeline Timeout Marker */
.journey-step.timeout-marker .journey-icon {
    background: #dc2626 !important;
    color: white !important;
    border-color: #dc2626 !important;
    animation: pulse-timeout 2s ease-in-out infinite;
}

.journey-step.timeout-marker .journey-name,
.journey-step.timeout-marker .journey-status {
    color: #dc2626 !important;
    font-weight: 700;
}

@keyframes pulse-timeout {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
    }
}

/* Timeline Timeout Styles */
/* Timeline Timeout Styles */
.timeline-item.timeline-timeout .timeline-content {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

.timeline-item.timeline-timeout .timeline-note {
    background: #fef2f2;
    border: 1px dashed #ef4444;
    color: #b91c1c;
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.05);
}

.timeline-item.timeline-timeout {
    padding-bottom: 2rem;
}

.timeline-dot-timeout {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef4444;
    z-index: 2;
    margin-top: 6px;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    position: relative;
}

.badge-timeout {
    background: #ef4444 !important;
    color: white !important;
}

.journey-step.rejected .journey-icon {
    border-color: #cbd5e1;
    color: #94a3b8;
    background: #f8fafc;
}

.journey-step.rejected.active .journey-icon {
    border-color: var(--danger);
    color: var(--danger);
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 100;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-top: 8px;
    animation: fadeIn 0.15s ease-out;
}

.dropdown.show .dropdown-content {
    display: block;
}

.dropdown-content button {
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.dropdown-content button:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dropdown-content button i {
    width: 20px;
    text-align: center;
}

.dropdown-content .divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.btn-icon-only {
    padding: 8px 12px;
    background: #f1f5f9;
    color: var(--text-main);
}

.action-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

/* TASK LIST REFINEMENTS */
.task-deadline-container {
    cursor: pointer;
    transition: opacity 0.2s;
    user-select: none;
}

.task-deadline-container:hover {
    opacity: 0.8;
}

/* MOBILE RESPONSIVENESS */
@media screen and (max-width: 768px) {
    header {
        padding: 0 15px;
    }

    /* Fixed profile 2-column crash on mobile */
    #view-profile .grid-2 {
        grid-template-columns: 1fr !important;
    }

    /* Table Wrapping for Status and User Management */
    .table-container,
    div[style*="overflow-x"] {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }

    table {
        min-width: 600px;
        /* Ensure table doesn't squash too much */
    }

    /* User Management Search Form */
    #view-admin-users [style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #view-admin-users input,
    #view-admin-users select {
        width: 100% !important;
        margin-bottom: 10px;
    }

    /* Device Stats Grid */
    .device-stats-grid {
        grid-template-columns: 1fr !important;
    }

    #form-create-user .grid-2 {
        grid-template-columns: 1fr !important;
    }

    /* Button stacking on mobile */
    .form-actions {
        flex-direction: column !important;
        gap: 10px;
        display: flex !important;
    }

    .form-actions button {
        width: 100% !important;
        margin: 0 !important;
    }

    header .brand span {
        display: none;
        /* Hide HHA Dashboard text on small screens */
    }

}

@media screen and (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }

    aside.sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        bottom: 0;
        width: 280px;
        height: calc(100vh - var(--header-height));
        z-index: 900;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        background: white;
    }

    aside.sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    main.content-area {
        padding: 1rem;
    }

    /* Calender Mobile Adjustments */
    .btn-calendar-nav {
        display: none !important;
    }

    .calendar-mobile-slider {
        display: flex;
        overflow-x: auto;
        padding: 10px 5px;
        gap: 10px;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        border-bottom: 1px solid var(--border);
        background: #f8fafc;
    }

    .calendar-mobile-slider::-webkit-scrollbar {
        display: none;
    }

    .calendar-day-item {
        flex: 0 0 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px 5px;
        border-radius: 12px;
        background: white;
        border: 1px solid var(--border);
        scroll-snap-align: center;
    }

    .calendar-day-item.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    .calendar-day-item.today:not(.active) {
        border: 2px solid var(--primary);
        color: var(--primary);
    }

    .calendar-day-name {
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-bottom: 4px;
        opacity: 0.8;
    }

    .calendar-day-num {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .calendar-day-dot {
        width: 4px;
        height: 4px;
        background: #ef4444;
        border-radius: 50%;
        margin-top: 4px;
    }

    .calendar-mobile-tasks {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .mobile-task-card {
        background: white;
        padding: 12px;
        border-left: 4px solid var(--primary);
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 12px;
        align-items: center;
    }

    .mobile-task-time {
        font-weight: 700;
        color: var(--primary);
        font-size: 0.85rem;
        min-width: 45px;
    }

    .mobile-task-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        overflow: hidden;
    }

    .mobile-task-header {
        font-size: 0.75rem;
        color: var(--text-muted);
        display: flex;
        gap: 8px;
    }

    .mobile-task-title {
        font-weight: 600;
        font-size: 0.9rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .calendar-grid {
        display: none;
    }

    #task-calendar-card {
        padding: 0 !important;
    }

    .task-meta-split {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 4px;
    }

    .task-meta-right {
        text-align: left !important;
    }

    .news-row-title {
        font-size: 0.95rem !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .news-row>div:first-child {
        min-width: 0;
        /* Allow flex child to shrink and trigger text-overflow */
        flex: 1;
    }

    .news-row>div:last-child {
        flex-shrink: 0;
        /* Don't shrink action buttons */
    }

    .status-badge {
        font-size: 0.6rem !important;
    }

    @media screen and (max-width: 480px) {
        .news-row {
            padding: 10px;
        }

        .meta-assign-flow {
            display: block;
            font-size: 0.75rem;
        }

        .meta-created-at {
            display: none;
        }

        .calendar-grid.mobile-grid {
            display: grid !important;
            overflow-x: auto;
            background: #f1f5f9;
            border-radius: 0;
            grid-template-columns: repeat(7, minmax(60px, 1fr)) !important;
        }

        .calendar-grid.mobile-grid>div {
            min-width: 0;
            /* More compact for mobile month view */
            min-height: 80px;
        }

        .calendar-grid.mobile-grid .calendar-task-item {
            font-size: 0.6rem;
            padding: 2px 4px;
        }
    }
}

/* Rich Text Editor Styles */
.rte-toolbar {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.rte-font-select {
    width: auto !important;
    padding: 4px 8px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
    min-width: 140px;
}

.btn-rte {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s;
}

.btn-rte:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.rte-editor {
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px !important;
    background: white;
    padding: 12px !important;
    line-height: 1.6;
}

.rte-editor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Post Content Styles (Preserve formatting) */
.post-content,
.news-detail-content {
    font-family: 'Inter', system-ui, sans-serif;
    /* Default */
}

/* Pin Styles */
.btn-pin {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    padding: 4px;
}

.btn-pin:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.btn-pin.pinned {
    color: var(--primary);
    transform: rotate(45deg);
}

.pinned-indicator {
    color: var(--primary);
    font-size: 0.8rem;
    margin-right: 8px;
    transform: rotate(45deg);
}

.news-row.pinned,
.task-row.pinned {
    background: linear-gradient(to right, #eff6ff, white);
    border-left: 3px solid var(--primary);
}

/* Quill Custom Fonts */
.ql-font-roboto {
    font-family: 'Roboto', sans-serif;
}

.ql-font-open-sans {
    font-family: 'Open Sans', sans-serif;
}

.ql-font-montserrat {
    font-family: 'Montserrat', sans-serif;
}

.ql-font-playfair-display {
    font-family: 'Playfair Display', serif;
}

.ql-font-dancing-script {
    font-family: 'Dancing Script', cursive;
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="roboto"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="roboto"]::before {
    content: 'Roboto';
    font-family: 'Roboto', sans-serif;
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="open-sans"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="open-sans"]::before {
    content: 'Open Sans';
    font-family: 'Open Sans', sans-serif;
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="montserrat"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="montserrat"]::before {
    content: 'Montserrat';
    font-family: 'Montserrat', sans-serif;
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="playfair-display"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="playfair-display"]::before {
    content: 'Playfair Display';
    font-family: 'Playfair Display', serif;
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="dancing-script"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="dancing-script"]::before {
    content: 'Dancing Script';
    font-family: 'Dancing Script', cursive;
}

.ql-font-times-new-roman {
    font-family: 'Times New Roman', Times, serif;
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="times-new-roman"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="times-new-roman"]::before {
    content: 'Times New Roman';
    font-family: 'Times New Roman', Times, serif;
}

/* Quill Alignment */
.ql-align-center {
    text-align: center;
}

.ql-align-right {
    text-align: right;
}

.ql-align-justify {
    text-align: justify;
}

/* Task Action Buttons Equalizer */
.task-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 16px !important;
    gap: 6px;
    min-width: 80px;
    max-width: 140px;
    min-height: 60px;
    font-size: 0.8rem !important;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    flex: 0 0 auto;
    border-radius: 8px;
    white-space: nowrap;
}

.task-action-btn i {
    font-size: 1.25rem;
    margin-right: 0 !important;
}

.sidebar-menu>* {
    flex-shrink: 0;
}

/* Quill 2.0 Global Table Styles */
.ql-editor table {
    border-collapse: collapse;
    width: 100% !important;
    margin: 1rem 0;
    table-layout: auto !important;
}
.ql-editor table td, .ql-editor table th {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    min-width: 50px;
    height: auto !important;
    word-break: break-word;
}
.ql-editor table th {
    background-color: #f8fafc;
    font-weight: 600;
}
.ql-editor table p {
    margin-bottom: 0;
}

/* Custom RBAC Styles */
.perm-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    user-select: none;
}
.perm-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.perm-card.checked {
    border-color: #22c55e;
    background: #f0fdf4;
}
.perm-card input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #22c55e;
    margin-top: 2px;
    flex-shrink: 0;
}
.role-item {
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #475569;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.role-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.role-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}
.role-item i {
    font-size: 1rem;
    color: #94a3b8;
}
.role-item.active i {
    color: #3b82f6;
}

/* Action Icons Styling in Users Table */
/* Action Buttons Wrap Container */
.action-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    max-width: 80px; /* Force it to wrap (e.g. 3 on top, 2 on bottom) */
}

/* Action Icons Styling in Users Table */
.action-icon-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.8rem;
    color: #64748b;
    padding: 0;
}
.action-icon-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-1px);
}
.action-icon-btn.edit-btn:hover {
    color: #2563eb;
}
.action-icon-btn.kick-btn:hover {
    color: #ea580c;
}
.action-icon-btn.delete-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}
.action-icon-btn.status-btn-active {
    color: #64748b;
}
.action-icon-btn.status-btn-active:hover {
    color: #1e293b;
}
.action-icon-btn.status-btn-locked {
    color: #dc2626;
}
.action-icon-btn.status-btn-locked:hover {
    background: #fef2f2;
    color: #b91c1c;
}
.action-icon-btn.custom-perms-default {
    color: #64748b;
}
.action-icon-btn.custom-perms-default:hover {
    color: #1e293b;
}
.action-icon-btn.custom-perms-override {
    color: #7c3aed;
}
.action-icon-btn.custom-perms-override:hover {
    background: #f5f3ff;
    color: #6d28d9;
}

/* Custom permissions user row highlights */
tr.user-row-custom {
    background-color: #faf5ff !important;
}
tr.user-row-custom td {
    color: #6b21a8 !important;
}
tr.user-row-custom td b {
    color: #581c87 !important;
}
tr.user-row-custom td span {
    color: #6b21a8 !important;
}

/* Extra custom permissions added checkcard styles */
.perm-card.checked.extra-custom {
    border-color: #7c3aed;
    background: #f5f3ff;
}
.perm-card.checked.extra-custom input[type="checkbox"] {
    accent-color: #7c3aed;
}

/* Checked state text color styling overrides */
.perm-card.checked > div > div:first-child {
    color: #15803d !important;
}
.perm-card.checked > div > div:last-child {
    color: #16a34a !important;
}

.perm-card.checked.extra-custom > div > div:first-child {
    color: #581c87 !important;
}
.perm-card.checked.extra-custom > div > div:last-child {
    color: #7c3aed !important;
}

/* --- PREMIUM GROUP MANAGEMENT CARD GRID --- */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 1.5rem;
}

.group-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.group-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.group-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: all 0.3s;
}

.group-card:hover .group-icon-wrapper {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    transform: scale(1.05);
}

.group-card-info {
    min-width: 0;
    flex: 1;
}

.group-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.group-member-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.group-card-actions {
    display: flex;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
}

.btn-group-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-group-action.btn-manage {
    flex: 1;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    gap: 6px;
}

.btn-group-action.btn-manage:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-group-action.btn-edit {
    background: #fafafa;
    color: #475569;
    border: 1px solid #e2e8f0;
    width: 36px;
    padding: 0;
}

.btn-group-action.btn-edit:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #bfdbfe;
}

.btn-group-action.btn-delete {
    background: #fff5f5;
    color: #e11d48;
    border: 1px solid #ffe4e6;
    width: 36px;
    padding: 0;
}

.btn-group-action.btn-delete:hover {
    background: #ffe4e6;
    color: #be123c;
    border-color: #fecaca;
}

/* --- PREMIUM GROUP MEMBERS MODAL LAYOUT --- */
.members-split-container {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: stretch;
}

.members-pane {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 16px;
}

.members-pane.current-pane {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pane-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1e293b;
    margin: 0;
}

.pane-title-current {
    color: #14532d;
}

.members-list-container {
    height: 320px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
}

.members-pane.current-pane .members-list-container {
    border-color: #bbf7d0;
}

/* User Card inside lists */
.user-assign-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    transition: all 0.2s;
    background: white;
    cursor: pointer;
}

.user-assign-card:hover {
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.members-pane.current-pane .user-assign-card {
    border-color: #dcfce7;
    background: #f8fafc;
}

.members-pane.current-pane .user-assign-card:hover {
    border-color: #86efac;
}

.user-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    cursor: pointer;
}

.user-card-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.user-card-details {
    min-width: 0;
    flex: 1;
}

.user-card-name {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.members-pane.current-pane .user-card-name {
    color: #14532d;
}

.user-card-dept {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.members-pane.current-pane .user-card-dept {
    color: #166534;
}

/* Instant action buttons */
.btn-instant-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.78rem;
    margin-left: 8px;
    flex-shrink: 0;
}

.btn-instant-add {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-instant-add:hover {
    background: #0284c7;
    color: white;
}

.btn-instant-remove {
    background: #fee2e2;
    color: #be123c;
}

.btn-instant-remove:hover {
    background: #ef4444;
    color: white;
}

/* Central bulk action buttons wrapper */
.bulk-actions-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 0 10px;
}

@media (max-width: 900px) {
    .bulk-actions-container {
        flex-direction: row;
        width: 100%;
        margin: 16px 0;
    }
}

/* ========================================== */
/* GATEWAY SPLIT-SCREEN & LOGIN REDESIGN     */
/* ========================================== */

.gateway-screen-layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    z-index: 10000;
    background: #f8fafc;
    overflow: hidden;
}

.login-split-visual {
    display: none;
}

.visual-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.3) 0%, rgba(15, 23, 42, 0.85) 100%);
    z-index: 1;
}

.visual-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.visual-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.visual-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.visual-subtitle {
    font-size: 1.15rem;
    line-height: 1.6;
    color: rgba(241, 245, 249, 0.85);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.visual-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.visual-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: rgba(241, 245, 249, 0.9);
}

.visual-feature-item i {
    color: #3b82f6;
}

/* Right side form container */
.login-split-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background-image: linear-gradient(rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.45)), url('backgroundlogin.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Responsive Visual Side */
@media (max-width: 1024px) {
    .login-split-visual {
        display: none;
    }
    .login-split-form {
        flex: 1;
        width: 100%;
        background-image: linear-gradient(rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.45)), url('backgroundlogin.jpg');
        background-size: cover;
        background-position: center;
    }
}

/* Modern Glassmorphic Login Card */
.login-card-modern {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 24px;
    padding: 2.25rem 1.75rem;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.15), 0 0 25px rgba(59, 130, 246, 0.15);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    display: flex;
    flex-direction: column;
}

#login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-logo-img {
    height: 52px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(15, 23, 42, 0.05));
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.login-subtitle-form {
    color: #64748b;
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
}

/* Modern inputs & forms */
.form-group-modern {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label-modern {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.input-container-modern {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-modern {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s;
}

.form-control-modern {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 0.95rem;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control-modern::placeholder {
    color: #94a3b8;
}

.form-control-modern:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.form-control-modern:focus + .input-icon-modern {
    color: #3b82f6;
}

/* Modern Submit Button */
.btn-submit-modern {
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: #2563eb;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    background: #1d4ed8;
}

.btn-submit-modern:active {
    transform: translateY(0);
}

.login-footer-modern {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.78rem;
    color: #334155;
    text-align: center;
    font-weight: 500;
}

#restricted-notice {
    margin-top: 1.5rem;
    padding: 1.25rem 1rem;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
