/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f4f7fb;
    color: #1a2a3a;
    min-height: 100vh;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   HEADER
   ============================================================ */
.main-header {
    background: #0f2a38;
    color: white;
    padding: 12px 24px;
    border-bottom: 3px solid #2c85aa;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible !important;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}
/* ============================================================
   LOGIN OVERLAY & CARD
   ============================================================ */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f2a38;          /* Matches header color */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;               /* Highest layer */
    animation: fadeIn 0.3s ease;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header .logo-img {
    width: auto;              /* Auto width */
    height: auto;  
    max-width: 170px;           /* Fixed height */
    border-radius: 0px;
    object-fit: contain;
    border: 2px solid #2c85aa;
    margin-bottom: 12px;
    background: transparent;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f2a38;
    margin: 0;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 4px;
}

.login-card .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.login-card .form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #2c3e50;
}

.login-card .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cfdfea;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.login-card .form-group input:focus {
    border-color: #2c85aa;
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #1e5b7c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #164a66;
}

.login-footer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #95a5a6;
}

/* ============================================================
   HEADER RIGHT - User info and buttons
   ============================================================ */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#userDisplay {
    display: none;   /* Hidden by default, shown after login */
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: white;
}

#logoutBtn {
    display: none;   /* Hidden by default, shown after login */
}

/* Keep existing switch-role-btn styles */
.logo { 
  display: flex; 
  align-items: center; 
  gap: 14px;
  /* Add these to ensure proper alignment */
  flex-shrink: 0;           /* Prevents logo from shrinking */
}
/* For dark logos on dark background - add subtle border */

.logo div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.logo-img { 
  width: auto;              /* Auto width */
  height: auto;             /* Fixed height */
  max-width: 170px;          /* Maximum width limit */
  border-radius: 0px;
  background: transparent;
  object-fit: contain;
}
.logo h1 { 
  font-size: 1.7rem; 
  font-weight: 700; 
  background: linear-gradient(130deg,#fff,#c3e2f0); 
  -webkit-background-clip: text; 
  background-clip: text; 
  color: transparent; 
  margin: 0;
  line-height: 1.2;
}

.logo p {
  font-size: 0.7rem;
  opacity: 0.8;
  margin: 0;
  letter-spacing: 0.5px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
}

.switch-role-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    padding: 6px 14px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.switch-role-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.main-layout {
    display: flex;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.left-panel {
    width: 220px;
    background: white;
    padding: 20px 0;
    border-right: 1px solid #e8edf2;
    min-height: calc(100vh - 120px);
    flex-shrink: 0;
    overflow-y: auto;
}

.content-area {
    flex: 1;
    padding: 24px 32px;
    background: #f4f7fb;
    min-height: calc(100vh - 120px);
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.nav-btn-category {
    padding: 12px 20px;
    margin: 4px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn-category:hover {
    background: #e8f0f6;
}

.nav-btn-category.active-cat {
    background: #e1f0f8;
    color: #1a5c7a;
    font-weight: 600;
    border-left: 4px solid #2c85aa;
}

.nav-btn-category i {
    width: 20px;
    text-align: center;
    color: #2c85aa;
}

/* ============================================================
   PAGE CARDS / CONTENT
   ============================================================ */
.page-card {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.page-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f2a38;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-card h2 i {
    color: #2c85aa;
}

.btn-back {
    background: #e8edf2;
    border: none;
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #2c3e50;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.btn-back:hover {
    background: #d5dde5;
}

/* ============================================================
   FEATURE GRID (Category View)
   ============================================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 12px;
}

.feature-card {
    background: #f8fafc;
    border: 1px solid #e8edf2;
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(44, 133, 170, 0.12);
    border-color: #2c85aa;
}

.feature-card .card-icon {
    font-size: 2.4rem;
    color: #2c85aa;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #0f2a38;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.feature-card .card-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2c85aa;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    margin-top: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    background: #f0f4f8;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #1a3a4a;
    border-bottom: 2px solid #dde5ed;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.filter-row th {
    padding: 4px 14px;
    background: #fafbfc;
}

.filter-input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #dde5ed;
    border-radius: 6px;
    font-size: 0.75rem;
    background: white;
    transition: border 0.2s;
}

.filter-input:focus {
    border-color: #2c85aa;
    outline: none;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pagination button {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #cbdde9;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #e8f0f6;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.per-page-selector select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #cbdde9;
    background: white;
}

.table-info {
    font-size: 0.85rem;
    color: #5c7f8c;
    margin-bottom: 10px;
}

/* ============================================================
   ACTION BUTTONS
   ============================================================ */
.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn.edit {
    background: #e8f0fe;
    color: #1a5c7a;
}

.action-btn.edit:hover {
    background: #d0e2f8;
}

.action-btn.delete {
    background: #fee8e8;
    color: #b33c3c;
}

.action-btn.delete:hover {
    background: #fcd5d5;
}

.action-btn.view {
    background: #e8f5e9;
    color: #2e7d32;
}

.action-btn.view:hover {
    background: #c8e6c9;
}

.add-btn {
    background: #1e5b7c;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #164a66;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
    padding: 3px 12px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #fce4ec;
    color: #c62828;
}

.status-warning {
    background: #fff3e0;
    color: #e65100;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.25s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f2a38;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cfdfea;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2c85aa;
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.save-btn {
    background: #1e5b7c;
    color: white;
}

.save-btn:hover {
    background: #164a66;
}

.cancel-btn {
    background: #e8edf2;
    color: #2c3e50;
}

.cancel-btn:hover {
    background: #d5dde5;
}

/* ============================================================
   LOGIN / ROLE MODAL
   ============================================================ */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 92%;
    text-align: center;
}

.login-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.login-card input {
    width: 100%;
    padding: 10px 14px;
    margin: 8px 0;
    border: 1px solid #cfdfea;
    border-radius: 8px;
    font-size: 0.9rem;
}

.login-card button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #1e5b7c;
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.login-card button:hover {
    background: #164a66;
}

.error-msg {
    color: #c62828;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ============================================================
   KPI CARDS (Dashboard)
   ============================================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e8edf2;
}

.kpi-card h4 {
    font-size: 0.75rem;
    font-weight: 500;
    color: #5c7f8c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f2a38;
}

.kpi-icon {
    font-size: 2rem;
    color: #2c85aa;
    opacity: 0.6;
}

/* ============================================================
   PUNCH IN/OUT
   ============================================================ */
.punch-container {
    max-width: 700px;
    margin: 0 auto;
}

.punch-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 30px;
    border: 1px solid #e8edf2;
}

.punch-header {
    text-align: center;
    margin-bottom: 24px;
}

.punch-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f2a38;
}

.punch-header p {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.current-session {
    background: #e8f5e9;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #2e7d32;
}

.current-session-info {
    font-size: 0.9rem;
}

.current-session-label {
    font-weight: 600;
    color: #1a3a4a;
}

.current-session-time {
    color: #2c3e50;
}

.time-display,
.location-display {
    margin-bottom: 16px;
}

.time-display label,
.location-display label {
    font-weight: 500;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 4px;
}

.time-display input,
.location-display input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cfdfea;
    border-radius: 8px;
    background: #f5f7fa;
    font-size: 0.9rem;
}

.punch-buttons {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.btn-punch {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-punch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-punch-in {
    background: #2c85aa;
    color: white;
}

.btn-punch-in:hover:not(:disabled) {
    background: #1f6f8f;
}

.btn-punch-out {
    background: #e8edf2;
    color: #2c3e50;
}

.btn-punch-out:hover:not(:disabled) {
    background: #d5dde5;
}

.punch-history {
    margin-top: 24px;
}

.punch-history h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #0f2a38;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th {
    background: #f0f4f8;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dde5ed;
}

.history-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
}

/* ============================================================
   SITE VISIT REPORT
   ============================================================ */
.upload-container {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px dashed #2c85aa;
    transition: all 0.3s;
}

.file-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.file-item:hover {
    border-color: #2c85aa;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.company-filter-row {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #0f2a38;
    color: rgba(255,255,255,0.6);
    padding: 12px 24px;
    font-size: 0.75rem;
    border-top: 1px solid #1a4050;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c85aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .left-panel {
        width: 180px;
    }
    .content-area {
        padding: 16px 20px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    .left-panel {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e8edf2;
        padding: 8px 0;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
    .nav-btn-category {
        padding: 8px 14px;
        margin: 2px 4px;
        font-size: 0.8rem;
    }
    .content-area {
        padding: 12px 16px;
        min-height: auto;
    }
    .header-container {
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-badge {
        font-size: 0.75rem;
    }
    .feature-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .punch-buttons {
        flex-direction: column;
    }
    .modal-content {
        padding: 20px;
    }
}
/* Multi-Select Chips */
.multiselect-container {
    border: 1px solid #cfdfea;
    border-radius: 8px;
    padding: 10px;
    background: #fafbfc;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    min-height: 36px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e1f0f8;
    color: #1a5c7a;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.chip-remove {
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    color: #7f8c8d;
    margin-left: 4px;
    transition: color 0.2s;
}

.chip-remove:hover {
    color: #e74c3c;
}

.add-chip-btn {
    padding: 8px 16px;
    background: #2c85aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.add-chip-btn:hover {
    background: #1f6f8f;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

   @media print {
    /* Hide everything except the modal content */
    body * {
        visibility: hidden;
    }
    
    #viewModal,
    #viewModal * {
        visibility: visible;
    }
    
    #viewModal {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: white !important;
        z-index: 99999;
    }
    
    #viewModal .modal-content {
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: none !important;
        padding: 20px !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }
    
    #viewModal .modal-content .modal-actions,
    #viewModal .modal-content .btn-close-modal,
    #viewModal .modal-content button:not(.no-print) {
        display: none !important;
    }
    
    #viewModal .modal-content button.print-btn {
        display: none !important;
    }
    
    /* Keep status badges visible in print */
    .status-badge {
        -webkit-print-color-adjust: exact;
         print-color-adjust: exact;
    }
    
    /* Keep table backgrounds */
    table {
        -webkit-print-color-adjust: exact;
         print-color-adjust: exact;
    }
    
    .status-active {
        -webkit-print-color-adjust: exact;
         print-color-adjust: exact;
    }
    
    .status-warning {
        -webkit-print-color-adjust: exact;
         print-color-adjust: exact;
    }
    
    .status-inactive {
        -webkit-print-color-adjust: exact;
         print-color-adjust: exact;
    }
}

/* ============================================================
   USER PROFILE DROPDOWN – Consolidated
   ============================================================ */

.header-container,
.user-profile-container {
    overflow: visible !important;
    position: relative;
}

.user-profile-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px 6px 8px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    min-width: 100px;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-profile-btn i.fa-user-circle {
    font-size: 1.4rem;
}

.user-profile-btn i.fa-chevron-down {
    font-size: 0.7rem;
    opacity: 0.7;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    min-width: 280px;
    padding: 8px 0;
    z-index: 9999;
    color: #2c3e50;
    display: none; /* hidden by default */
    animation: dropdownFadeIn 0.2s ease;
}

/* Show state – must come AFTER the default rule */
.user-dropdown.show {
    display: block !important; /* force override */
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 8px 16px;
    border-bottom: 1px solid #eef2f7;
}

.user-avatar i {
    font-size: 2.8rem;
    color: #2c85aa;
}

.user-info .user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a2a3a;
}

.user-info .user-email {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.user-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.user-dropdown-menu li {
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.user-dropdown-menu li:hover {
    background: #f0f4f8;
}

.user-dropdown-menu li i {
    width: 20px;
    color: #5c7f8c;
}

.user-dropdown-menu .divider {
    height: 1px;
    background: #eef2f7;
    margin: 4px 12px;
    padding: 0;
    cursor: default;
}

.user-dropdown-menu li#dropdownLogout {
    color: #e74c3c;
}

.user-dropdown-menu li#dropdownLogout i {
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .user-dropdown {
        right: -20px;
        min-width: 240px;
    }
}

/* ============================================================
   ROLE MANAGEMENT STYLES
   ============================================================ */

/* Tab Buttons */
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #2c3e50;
}

.tab-btn.active {
    color: #2c85aa;
    border-bottom-color: #2c85aa;
    font-weight: 600;
}

/* Role Badge */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    background: #e8f4f8;
    color: #2c3e50;
}

/* Action Buttons in Table */
.action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 2px;
    font-size: 14px;
    transition: all 0.2s;
}

.action-btn.edit {
    background: #3498db;
    color: white;
}

.action-btn.edit:hover {
    background: #2980b9;
}

.action-btn.delete {
    background: #e74c3c;
    color: white;
}

.action-btn.delete:hover {
    background: #c0392b;
}

/* Multi-select dropdown styling */
select[multiple] {
    min-height: 80px;
}

select[multiple] option {
    padding: 6px 10px;
}

select[multiple] option:checked {
    background: #2c85aa;
    color: white;
}

/* Permissions container */
.permissions-container,
.users-container {
    padding: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .permissions-controls {
        flex-direction: column;
    }
    
    .permissions-controls > div {
        width: 100%;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}
.profile-details .form-group {
    margin-bottom: 12px;
}
.profile-details label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}
.profile-value {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ecf0f1;
    color: #2c3e50;
}

.image-preview {
    border: 1px solid #cfdfea;
    object-fit: cover;
}
.upload-image-btn {
    transition: all 0.2s;
}
.upload-image-btn:hover {
    opacity: 0.8;
}
.upload-image-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   IMAGE UPLOAD STYLES
   ============================================================ */

/* Image preview container */
.image-preview-container {
    transition: all 0.3s ease;
}

.image-preview-container:hover {
    border-color: #2c85aa;
    box-shadow: 0 2px 8px rgba(44, 133, 170, 0.2);
}

/* Upload button hover */
.upload-image-btn:hover {
    background: #2980b9 !important;
    transform: scale(1.05);
}

.upload-image-btn:active {
    transform: scale(0.95);
}

/* Remove image button */
.remove-image-btn:hover {
    background: #c0392b !important;
    transform: scale(1.05);
}

/* Upload progress bar animation */
.upload-progress {
    transition: opacity 0.3s ease;
}

.upload-progress-bar {
    transition: width 0.3s ease;
}

/* Image upload wrapper */
.image-upload-wrapper {
    position: relative;
}

/* Thumbnail image hover effect */
.image-preview-container img {
    transition: transform 0.3s ease;
}

.image-preview-container img:hover {
    transform: scale(1.1);
}

/* File input styling */
.item-image-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .image-preview-container {
        width: 40px !important;
        height: 40px !important;
    }
    
    .upload-image-btn,
    .remove-image-btn {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }
}

/* ============================================================
   HELP PAGE STYLES
   ============================================================ */

/* Help topic cards hover effect */
.help-topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #2c85aa;
}

/* Help section styles */
.help-section {
    transition: all 0.3s ease;
}

.help-section h3 {
    font-size: 1.1rem;
}

/* FAQ toggle styles */
.faq-item > div:first-child:hover {
    color: #2c85aa;
}

.faq-item .fa-chevron-right {
    transition: transform 0.3s ease;
}

.faq-item > div:first-child.open .fa-chevron-right {
    transform: rotate(90deg);
}

/* Print styles */
@media print {
    .btn-back,
    .help-topic-card,
    #helpSearch,
    button,
    .page-card > div:first-child {
        display: none !important;
    }
    
    .help-section {
        break-inside: avoid;
        page-break-inside: avoid;
        border-left-color: #2c85aa !important;
    }
    
    .help-section h3 {
        color: #0f2a38 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .help-topic-card {
        padding: 12px !important;
    }
    
    .help-topic-card i {
        font-size: 20px !important;
    }
    
    .help-topic-card span {
        font-size: 0.85rem;
    }
}