/**
 * LHL Project Portal - Main Stylesheet
 * Brand Colors based on LHL logo:
 * Primary Blue: #0066A1
 * Dark Blue: #004d7a
 * Light Blue: #e6f2f8
 * Gray: #6c757d
 */

:root {
    --lhl-primary: #0066A1;
    --lhl-primary-dark: #004d7a;
    --lhl-primary-light: #3388b8;
    --lhl-primary-bg: #e6f2f8;
    --lhl-gray: #6c757d;
    --lhl-gray-light: #adb5bd;
    --lhl-gray-dark: #495057;
    --lhl-success: #28a745;
    --lhl-warning: #ffc107;
    --lhl-danger: #dc3545;
    --lhl-info: #17a2b8;

    --sidebar-width: 260px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

/* =====================================================
   BASE STYLES
   ===================================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
}

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

a:hover {
    color: var(--lhl-primary-dark);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--lhl-gray-dark);
    margin-bottom: 0.5rem;
}

/* =====================================================
   LAYOUT
   ===================================================== */

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--lhl-primary) 0%, var(--lhl-primary-dark) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform var(--transition-speed);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-brand img {
    height: 100px;
    width: auto;
    background: #fff;
    padding: 12px 20px;
    border-radius: 10px;
}

.sidebar-brand span {
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 0.75rem;
    color: #fff;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-label {
    padding: 0.75rem 1.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav .nav-item {
    margin: 2px 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    transition: all var(--transition-speed);
    font-size: 0.875rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
    text-align: center;
}

.sidebar-nav .nav-link .badge {
    margin-left: auto;
    font-size: 0.7rem;
}

/* Sidebar Submenu (collapsible project items under My Projects) */
.sidebar-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform var(--transition-speed);
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-submenu-toggle:hover {
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-submenu-toggle[aria-expanded="false"] i {
    transform: rotate(-90deg);
}

.sidebar-submenu-toggle i {
    transition: transform var(--transition-speed);
}

.sidebar-submenu {
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.sidebar-submenu-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-submenu .nav-item {
    margin: 1px 0;
}

.sidebar-submenu .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.813rem;
}

.sidebar-submenu .nav-link i {
    font-size: 0.875rem;
}

/* Sidebar Divider */
.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.15);
    margin: 0.5rem 1.25rem;
}

/* My Projects List */
.sidebar-projects-list {
    padding: 0 0.5rem;
}

.sidebar-project-item {
    margin-bottom: 2px;
    border-radius: 8px;
    transition: all var(--transition-speed);
}

.sidebar-project-item.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-project-name {
    font-weight: 600;
    font-size: 0.813rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.5rem 0.5rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-project-item.is-active .sidebar-project-name {
    color: #fff !important;
}

.project-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.sidebar-project-name i {
    width: 18px;
    margin-right: 0.5rem;
    font-size: 0.875rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-project-nav {
    padding: 0 0.25rem 0.25rem;
}

.sidebar-project-nav .nav-item {
    margin: 1px 0;
}

.sidebar-project-nav .nav-link {
    padding: 0.35rem 0.75rem;
    font-size: 0.788rem;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
}

.sidebar-project-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-project-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 500;
}

.sidebar-project-nav .nav-link i {
    width: 18px;
    margin-right: 0.5rem;
    font-size: 0.813rem;
    text-align: center;
}

/* Sidebar Search Placeholder */
.sidebar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}
.sidebar-search-input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.sidebar-search-input::-moz-placeholder {
    color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

/* Sidebar Icon Buttons (Quick Access) */
.sidebar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
    transition: all var(--transition-speed);
    font-size: 1.125rem;
}

.sidebar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sidebar-icon-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Workflow Status Badges in Sidebar */
.workflow-status-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.2em 0.5em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Workflow Step Button (Admin Project View) */
.workflow-step-btn:hover {
    background: #f8f9fa;
    border-radius: 4px;
}
.workflow-step-btn:hover .badge {
    opacity: 0.7;
}

/* Left sidebar collapsed state */
.left-sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.left-sidebar-collapsed .main-content {
    margin-left: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
    transition: margin var(--transition-speed);
}

/* Header */
.main-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.sidebar-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--lhl-gray);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.breadcrumb-wrapper {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--lhl-gray);
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.header-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--lhl-gray);
    transition: all var(--transition-speed);
    cursor: pointer;
    position: relative;
    text-decoration: none;
    flex-shrink: 0;
}

.header-icon:hover {
    background: var(--lhl-primary-bg);
    color: var(--lhl-primary);
    text-decoration: none;
}

.header-badge {
    position: absolute;
    top: 0;
    right: -4px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15em 0.4em;
    border-radius: 10px;
    background: var(--lhl-danger);
    color: #fff;
    line-height: 1.2;
    min-width: 16px;
    text-align: center;
}

.user-dropdown {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    transition: background var(--transition-speed);
}

.user-dropdown:hover {
    background: var(--lhl-primary-bg);
}

.user-dropdown img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.user-dropdown .user-name {
    font-weight: 500;
    color: var(--lhl-gray-dark);
    font-size: 0.875rem;
}

.user-dropdown .user-role {
    font-size: 0.75rem;
    color: var(--lhl-gray);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--lhl-gray-dark);
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--lhl-gray);
    margin-top: 0.25rem;
}

/* =====================================================
   CARDS
   ===================================================== */

.card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
    background: #fafbfc;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--lhl-primary-dark);
    border-color: var(--lhl-primary-dark);
}

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

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

.btn-light {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: var(--lhl-gray-dark);
}

.btn-light:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

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

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
}

/* =====================================================
   FORMS
   ===================================================== */

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--lhl-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 161, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--lhl-gray-dark);
    margin-bottom: 0.375rem;
}

.form-text {
    font-size: 0.8125rem;
    color: var(--lhl-gray);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    font-size: 0.875rem;
}

/* =====================================================
   TABLES
   ===================================================== */

.table {
    font-size: 0.875rem;
}

.table thead th {
    font-weight: 600;
    color: var(--lhl-gray-dark);
    border-bottom: 2px solid #e9ecef;
    padding: 0.75rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* =====================================================
   BADGES & STATUS
   ===================================================== */

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 4px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-dot.active { background-color: var(--lhl-success); }
.status-dot.pending { background-color: var(--lhl-warning); }
.status-dot.inactive { background-color: var(--lhl-gray); }

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: var(--lhl-primary-bg);
    color: var(--lhl-primary-dark);
}

/* =====================================================
   MODAL
   ===================================================== */

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
}

/* =====================================================
   DROPDOWNS
   ===================================================== */

.dropdown-menu {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover {
    background-color: var(--lhl-primary-bg);
    color: var(--lhl-primary);
}

.dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
}

.dropdown-divider {
    margin: 0.5rem 0;
}

/* =====================================================
   FILE MANAGER
   ===================================================== */

.file-manager {
    display: flex;
    gap: 1.5rem;
}

.folder-tree {
    width: 250px;
    flex-shrink: 0;
}

.file-list {
    flex: 1;
}

.folder-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.folder-item:hover {
    background-color: var(--lhl-primary-bg);
}

.folder-item.active {
    background-color: var(--lhl-primary);
    color: #fff;
}

.folder-item i {
    margin-right: 0.5rem;
    color: var(--lhl-warning);
}

.folder-item.active i {
    color: #fff;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all var(--transition-speed);
}

.file-item:hover {
    border-color: var(--lhl-primary);
    box-shadow: 0 2px 8px rgba(0, 102, 161, 0.1);
}

.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 1rem;
    font-size: 1.25rem;
}

.file-icon.pdf { background: #fee2e2; color: #dc2626; }
.file-icon.xlsx { background: #dcfce7; color: #16a34a; }
.file-icon.docx { background: #dbeafe; color: #2563eb; }
.file-icon.dwg { background: #fef3c7; color: #d97706; }
.file-icon.image { background: #f3e8ff; color: #9333ea; }

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--lhl-gray-dark);
    margin-bottom: 0.125rem;
}

.file-meta {
    font-size: 0.8125rem;
    color: var(--lhl-gray);
}

/* =====================================================
   MEETINGS
   ===================================================== */

.meeting-card {
    border-left: 4px solid var(--lhl-primary);
}

.meeting-card.scheduled { border-left-color: var(--lhl-info); }
.meeting-card.in_progress { border-left-color: var(--lhl-warning); }
.meeting-card.completed { border-left-color: var(--lhl-success); }
.meeting-card.cancelled { border-left-color: var(--lhl-gray); }

.meeting-datetime {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--lhl-gray);
}

.meeting-datetime i {
    width: 16px;
}

/* =====================================================
   DASHBOARD WIDGETS
   ===================================================== */

.stat-card {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.primary {
    background: var(--lhl-primary-bg);
    color: var(--lhl-primary);
}

.stat-card .stat-icon.success {
    background: #d4edda;
    color: var(--lhl-success);
}

.stat-card .stat-icon.warning {
    background: #fff3cd;
    color: var(--lhl-warning);
}

.stat-card .stat-icon.danger {
    background: #f8d7da;
    color: var(--lhl-danger);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--lhl-gray-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--lhl-gray);
    margin-top: 0.25rem;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--lhl-primary) 0%, var(--lhl-primary-dark) 100%);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px !important;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 2.5rem 3rem;
    margin: 0 auto;
    box-sizing: border-box;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 60px;
    width: auto;
}

.auth-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--lhl-gray-dark);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--lhl-gray);
    margin-bottom: 2rem;
}

.auth-form .form-label {
    font-weight: 500;
    color: var(--lhl-gray-dark);
    margin-bottom: 0.5rem;
}

.auth-form .form-control {
    height: 48px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.auth-form .input-group-text {
    background-color: var(--lhl-primary-bg);
    border-color: #dee2e6;
    color: var(--lhl-primary);
}

.auth-form .btn-primary {
    height: 48px;
    font-size: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.auth-form .form-check {
    margin-bottom: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
    color: var(--lhl-gray);
}

/* Auth page mobile responsive */
@media (max-width: 576px) {
    .auth-wrapper {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        margin: 0;
        border-radius: 12px;
    }

    .auth-logo img {
        height: 50px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .auth-form .form-control {
        height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .auth-form .btn-primary {
        height: 44px;
    }

    .auth-footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* On mobile, sidebar.show must always override collapsed state */
    .left-sidebar-collapsed .sidebar.show {
        transform: translateX(0);
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .file-manager {
        flex-direction: column;
    }

    .folder-tree {
        width: 100%;
    }

    /* Card adjustments for mobile */
    .card-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header h5 {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Table responsive improvements */
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Nav tabs mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .nav-tabs .nav-link i {
        margin-right: 0.25rem;
    }

    /* Stat cards mobile */
    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-label {
        font-size: 0.8rem;
    }

    /* Button groups mobile */
    .btn-group {
        flex-wrap: wrap;
    }

    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    /* Modal mobile */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    /* Form controls mobile */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Breadcrumb mobile */
    .breadcrumb {
        font-size: 0.8rem;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 0.3rem;
    }

    /* User dropdown mobile */
    .user-dropdown .user-name,
    .user-dropdown .user-role {
        display: none;
    }

    .header-right {
        gap: 0.375rem;
        margin-left: 0.5rem;
    }
}

/* Small mobile specific */
@media (max-width: 480px) {
    .page-content {
        padding: 0.75rem;
    }

    .card {
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    .card-header,
    .card-body {
        padding: 0.75rem;
    }

    /* Hide some text on very small screens */
    .btn .d-none-xs {
        display: none !important;
    }

    /* Progress bars */
    .progress {
        height: 6px;
    }

    /* Badges smaller */
    .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
    }

    /* Prevent header icons from overflowing */
    .main-header {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .header-right {
        gap: 0.15rem !important;
        margin-left: 0.25rem;
        flex-shrink: 0;
    }

    .header-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .header-left {
        min-width: 0;
        overflow: hidden;
    }

    .breadcrumb-wrapper {
        display: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Global overflow prevention */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* =====================================================
   WORKFLOW PAGE MOBILE RESPONSIVE
   ===================================================== */

/* Mobile-friendly tables for workflow pages */
@media (max-width: 767.98px) {
    /* Convert table to card-style layout on mobile */
    .workflow-table-mobile thead {
        display: none;
    }

    .workflow-table-mobile tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 0.75rem;
        background: #fff;
    }

    .workflow-table-mobile tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f1f3f5;
    }

    .workflow-table-mobile tbody td:last-child {
        border-bottom: none;
    }

    .workflow-table-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--lhl-gray-dark);
        margin-right: 1rem;
        flex-shrink: 0;
        width: 80px;
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .workflow-table-mobile .table-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .workflow-table-mobile .table-actions::before {
        content: none;
    }

    /* Action buttons smaller and wrapping */
    .table-actions .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .table-actions .btn i {
        font-size: 0.875rem;
    }

    /* Document/file item mobile layout - keep icon and text on same row */
    .workflow-table-mobile td[data-label="Name"] .d-flex.align-items-center {
        flex-direction: row;
        align-items: center !important;
    }

    .workflow-table-mobile td[data-label="Name"] .d-flex.align-items-center > i {
        margin-right: 0.5rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .workflow-table-mobile td[data-label="Name"] .d-flex.align-items-center > div {
        min-width: 0;
        flex: 1;
    }

    .workflow-table-mobile td[data-label="Name"] .d-flex.align-items-center strong {
        display: block;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Folder link on mobile */
    .workflow-table-mobile .folder-link {
        flex-direction: row !important;
        align-items: center !important;
    }

    .workflow-table-mobile .folder-link > i {
        margin-right: 0.5rem;
        margin-bottom: 0;
    }

    /* Hide non-essential columns on mobile */
    .mobile-hide {
        display: none !important;
    }
}

/* Even smaller screens */
@media (max-width: 576px) {
    /* Page header adjustments */
    .page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .page-header > div:first-child {
        text-align: center;
    }

    .page-header .d-flex.gap-2 {
        justify-content: center;
        flex-wrap: wrap;
    }

    .page-header .btn {
        flex: 1;
        min-width: 120px;
    }

    /* Alert box mobile */
    .alert {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .alert .btn-close {
        padding: 0.5rem;
    }

    /* Nav tabs more compact */
    .nav-tabs {
        margin-bottom: 1rem !important;
    }

    .nav-tabs .nav-item {
        flex: 1;
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .nav-tabs .nav-link i {
        margin-right: 0;
        font-size: 1rem;
    }

    /* Hide tab text, show only icons on very small screens */
    .nav-tabs .nav-link span.tab-text {
        display: none;
    }

    /* Meeting list mobile */
    .meeting-datetime {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    /* Folder breadcrumb mobile */
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 0.75rem;
    }

    /* Modal adjustments */
    .modal-lg {
        max-width: 100%;
        margin: 0.5rem;
    }

    .modal-body .row.g-3 > [class*="col-"] {
        margin-bottom: 0.5rem;
    }

    /* File/document name truncation */
    .file-name,
    .workflow-table-mobile td strong {
        word-break: break-word;
        font-size: 0.85rem;
    }

    /* Checkbox list in modals - more compact */
    .modal-body .border.rounded.p-3 {
        padding: 0.5rem !important;
        max-height: 150px !important;
    }

    .modal-body .form-check {
        padding-left: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .modal-body .form-check-label {
        font-size: 0.8rem;
    }

    /* Share link section mobile */
    .input-group {
        flex-wrap: wrap;
    }

    .input-group .form-control {
        flex: 1;
        min-width: 0;
    }
}

/* Touch-friendly action buttons */
@media (pointer: coarse) {
    .table-actions .btn {
        min-width: 36px;
        min-height: 36px;
        padding: 0.5rem;
    }

    .btn-sm {
        min-height: 32px;
        padding: 0.375rem 0.625rem;
    }
}

/* Personal Files / Documents action buttons mobile layout */
@media (max-width: 767.98px) {
    .workflow-table-mobile .table-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.375rem;
        justify-content: flex-start;
        padding-top: 0.5rem;
    }

    .workflow-table-mobile .table-actions .btn {
        flex: 0 0 auto;
    }

    .workflow-table-mobile .table-actions form.d-inline {
        display: inline-flex;
    }
}

/* =====================================================
   UTILITIES
   ===================================================== */

.text-primary { color: var(--lhl-primary) !important; }
.bg-primary-light { background-color: var(--lhl-primary-bg) !important; }
.border-primary { border-color: var(--lhl-primary) !important; }

.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.min-w-0 { min-width: 0; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* Button that's small on mobile, normal on larger screens */
@media (min-width: 576px) {
    .btn-sm.btn-md-normal {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* =====================================================
   DRAG & DROP FILE UPLOAD (Windows Explorer Style)
   ===================================================== */

/* File Explorer Card - the main container */
.file-explorer-card {
    position: relative;
    transition: all 0.2s ease;
}

.file-explorer-card.drop-enabled {
    /* Ready to receive drops */
}

.file-explorer-card.drag-over {
    border-color: var(--lhl-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 161, 0.15);
}

/* Drop overlay - appears when dragging files over */
.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 102, 161, 0.95);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.file-explorer-card.drag-over .drop-overlay {
    opacity: 1;
    visibility: visible;
}

.drop-overlay-content {
    text-align: center;
}

.drop-overlay-content i {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.75rem;
    animation: bounce 0.6s ease infinite;
}

.drop-overlay-content span {
    font-size: 1.25rem;
    font-weight: 600;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Empty folder state */
.empty-folder-state {
    padding: 3rem 1.5rem;
}

/* Upload Progress - Floating panel (bottom right) */
.upload-progress-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    z-index: 1050;
    max-height: 350px;
}

.upload-progress-floating .card {
    border: none;
}

.upload-progress-list {
    max-height: 180px;
    overflow-y: auto;
}

.upload-progress-item .upload-file-icon {
    font-size: 1.1rem;
    color: var(--lhl-gray);
}

.upload-progress-item.upload-error {
    background-color: #fff5f5;
}

.upload-status {
    min-width: 22px;
    text-align: center;
}

.upload-status i {
    font-size: 1.1rem;
}

.btn-xs {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

.min-width-0 {
    min-width: 0;
}

/* Folder row drop target */
.folder-row.drop-target {
    transition: all 0.15s ease;
}

.folder-row.drop-target.folder-drag-over {
    background-color: var(--lhl-primary-bg) !important;
    outline: 2px solid var(--lhl-primary);
    outline-offset: -2px;
}

.folder-row.drop-target.folder-drag-over .folder-icon {
    transform: scale(1.2);
    color: var(--lhl-primary) !important;
}

.folder-row.drop-target.folder-drag-over td {
    background-color: transparent !important;
}

/* Draggable document items */
.draggable-item {
    cursor: default;
}

.draggable-item .drag-handle {
    cursor: grab;
}

.draggable-item.dragging {
    opacity: 0.5;
    background-color: #f8f9fa !important;
}

.draggable-item.dragging td {
    background-color: transparent !important;
}

/* File checkbox styling */
.file-checkbox {
    cursor: pointer;
}

/* Selected row highlight */
.document-row.table-primary {
    --bs-table-bg: rgba(0, 102, 161, 0.1);
}

/* Bulk actions toolbar */
#bulkActionsToolbar {
    animation: slideDown 0.2s ease-out;
}

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

/* Mobile adjustments */
@media (max-width: 575.98px) {
    .upload-progress-floating {
        left: 10px;
        right: 10px;
        width: auto;
        bottom: 10px;
    }

    .upload-progress-list {
        max-height: 150px;
    }

    .empty-folder-state {
        padding: 2rem 1rem;
    }
}
