* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #1e88e5;
    --secondary-color: #26a69a;
    --success-color: #43a047;
    --danger-color: #e53935;
    --warning-color: #fb8c00;
    --light-color: #f5f5f5;
    --dark-color: #212121;
    --border-color: #e0e0e0;
    --text-muted: #9e9e9e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-container {
    width: 100%;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    text-align: center;
}

.login-logo {
    margin-bottom: 30px;
}

.institutional-logos {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.institutional-logos img {
    height: 80px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.logo-img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    border-radius: 50%;
    background: var(--light-color);
    padding: 10px;
}

.login-logo h1 {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
    line-height: 1.3;
    word-wrap: break-word;
}

.login-form-container h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
    font-size: 22px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(30, 136, 229, 0.2);
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.login-info p {
    margin: 5px 0;
}

/* ========== MAIN LAYOUT ========== */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 15px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: font-size 0.3s ease;
    white-space: nowrap;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 6px;
    z-index: 1100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 36px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.hamburger:hover {
    background: rgba(255,255,255,0.15);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                width 0.25s ease;
    transform-origin: center;
}

/* Animated X when sidebar is open */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

.header-center {
    text-align: center;
}

.header-right {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.header-copyright {
    font-size: 11px;
    opacity: 0.85;
    white-space: nowrap;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.user-status {
    font-size: 12px;
    opacity: 0.9;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 150px;
    margin-top: 10px;
    display: none;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--dark-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.user-profile:hover .dropdown-menu,
.user-profile.open .dropdown-menu,
.dropdown-menu.active {
    display: block;
}

/* ========== CONTENT WRAPPER ========== */
.content-wrapper {
    display: flex;
    flex: 1;
    align-items: flex-start;
    transition: margin-left 0.3s ease;
}

.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow: visible;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease,
                width 0.3s ease;
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.user-details {
    text-align: center;
}

.user-name-full {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.user-spec {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.menu-section {
    display: flex;
    flex-direction: column;
}

.menu-section:first-child h3 {
    margin-bottom: 10px;
}

.menu-section:first-child ul {
    list-style: none;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.menu-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    flex: 1;
    transition: color 0.3s ease;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.menu-toggle.collapsed {
    transform: rotate(-90deg);
}

.menu-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.menu-list {
    list-style: none;
    max-height: none;
    overflow: visible;
    transition: opacity 0.35s ease;
    opacity: 1;
}

.menu-list.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.menu-section ul {
    list-style: none;
}

.menu-section li {
    margin-bottom: 6px;
}

.menu-link {
    display: block;
    padding: 10px 12px;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    cursor: pointer;
    word-wrap: break-word;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: break-word;
}

.menu-link:hover, .menu-link.active {
    background: var(--primary-color);
    color: white;
}

/* Submenu Styling */
.menu-item-with-submenu {
    margin-bottom: 8px;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    min-height: 38px;
    width: 100%;
}

.menu-item-header .menu-link {
    flex: 1;
    word-wrap: break-word;
    line-height: 1.4;
    margin-left: 0;
    padding: 10px 4px 10px 12px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    min-width: 0;
    overflow-wrap: break-word;
}

.submenu .menu-item-header .menu-link {
    padding: 8px 2px 8px 8px;
    font-size: 13px;
    white-space: normal;
    overflow: visible;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.menu-toggle-sub {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 10px 4px;
    width: 18px;
    height: auto;
    min-height: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-top: 2px;
}

.menu-toggle-sub:hover {
    color: var(--primary-color);
}

.menu-toggle-sub.collapsed {
    transform: rotate(-90deg);
}

.submenu {
    list-style: none;
    max-height: none;
    overflow: visible;
    transition: opacity 0.35s ease;
    opacity: 1;
    padding-left: 0px;
    margin-top: 4px;
    border-left: 2px solid var(--border-color);
    margin-bottom: 4px;
    margin-left: 10px;
}

.submenu.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.submenu li {
    margin-bottom: 4px;
    overflow: visible;
}

/* Nested submenu untuk layer lebih dalam */
.submenu .submenu {
    margin-left: 8px;
    border-left-color: #ddd;
}

.submenu-link {
    padding: 8px 8px !important;
    font-size: 13px;
    color: var(--dark-color);
    display: block;
    width: 100%;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
    overflow: visible;
}

/* Sidebar Logout Button */
.sidebar-logout {
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    display: none;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--danger-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.logout-btn:hover {
    background: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.logout-icon {
    font-size: 18px;
}

.logout-text {
    flex: 1;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
}

.content-section {
    animation: fadeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.page-header h1 {
    font-size: 28px;
    color: var(--dark-color);
}

/* ========== ALERTS & MESSAGES ========== */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    color: #155724;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* ========== DASHBOARD ========== */
.welcome-section {
    margin-bottom: 30px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.welcome-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.welcome-card p {
    margin: 5px 0;
    opacity: 0.95;
}

.welcome-card .subtitle {
    font-size: 14px;
    opacity: 0.85;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-icon {
    font-size: 32px;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.content-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.content-col {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.content-col:empty {
    display: none !important;
    background: none;
    padding: 0;
    margin: 0;
    height: 0;
    box-shadow: none;
}

.content-col h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* Settings styles */
.settings-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-card h3 {
    margin-top: 0;
    color: #333;
    font-size: 16px;
    border: none;
    padding: 0;
    margin-bottom: 15px;
}

/* Cards grid styles */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cards-grid .card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cards-grid .card:hover {
    border-color: #4CAF50;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.cards-grid .card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.cards-grid .card-image {
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cards-grid .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cards-grid .card h3 {
    color: #333;
    margin: 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.cards-grid .card p {
    color: #666;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.info-display {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row label {
    font-weight: 600;
    color: #555;
}

.info-row span {
    color: #2196f3;
}

.checkbox-group {
    background: white;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 14px;
}

.privacy-info,
.help-info {
    background: white;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.privacy-info ul,
.help-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.privacy-info li,
.help-info li {
    margin: 5px 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    padding: 12px;
    background: var(--light-color);
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.activity-date {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-title {
    font-weight: 500;
    color: var(--dark-color);
    margin-top: 4px;
}

.activity-user {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 4px;
}

/* ========== CALENDAR ========== */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.calendar-header h2 {
    font-size: 20px;
    color: var(--dark-color);
}

.calendar-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.calendar {
    width: 100%;
    border-collapse: collapse;
}

.calendar th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.calendar td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: center;
    min-height: 80px;
    vertical-align: top;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar td:hover {
    background: #f0f7ff;
}

.calendar td.other-month {
    background: var(--light-color);
    color: var(--text-muted);
}

.calendar td.today {
    background: #fff9e6;
    font-weight: bold;
}

.calendar td.selected {
    background: #c8e6f5;
    border: 2px solid var(--primary-color);
}

.calendar td.has-logs {
    background: #e8f5e9;
    font-weight: 600;
    color: var(--success-color);
}

.calendar .date-number {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.calendar .logs-count {
    font-size: 11px;
    color: var(--text-muted);
}

.logs-view {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.logs-view h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-item {
    padding: 15px;
    background: var(--light-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}

.log-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.log-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-top: 4px;
    margin-right: 4px;
}

.log-type {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-top: 4px;
}

.log-title {
    font-weight: 600;
    color: var(--dark-color);
    margin: 8px 0;
    font-size: 15px;
}

.log-description {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

/* ========== MESSAGES / INBOX ========== */
.unread-badge {
    display: inline-block;
    background: #f44336;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    min-width: 18px;
    text-align: center;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: #f5f5f5;
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    padding: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: start;
    gap: 12px;
}

.message-item .message-content {
    flex: 1;
    cursor: pointer;
}

.message-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.message-item.unread {
    background: #e3f2fd;
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.btn-delete-message {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 18px;
    flex-shrink: 0;
    opacity: 0.6;
    line-height: 1;
}

.btn-delete-message:hover {
    background: #ffebee;
    color: #f44336;
    opacity: 1;
    transform: scale(1.2);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.message-from {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.message-date {
    font-size: 12px;
    color: var(--text-muted);
}

.message-type-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

.message-type-badge.logbook {
    background: #4caf50;
}

.message-type-badge.portfolio {
    background: #ff9800;
}

.message-type-badge.user {
    background: #9c27b0;
}

.message-subject {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.message-body {
    font-size: 13px;
    color: #444;
    white-space: pre-wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-info {
    background: #00bcd4;
    color: white;
}

.btn-info:hover {
    background: #00acc1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background: #757575;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* ========== MODALS ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--dark-color);
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-header .close:hover {
    color: var(--dark-color);
}

.modal-body {
    padding: 20px;
}

/* ========== IMAGE MODAL ========== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    margin-top: 5vh;
    animation: zoomIn 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.image-modal-caption {
    margin: 20px;
    text-align: center;
    color: white;
    font-size: 18px;
    font-weight: 500;
}

.image-modal-actions {
    display: flex;
    justify-content: center;
    margin: 0 0 20px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2001;
}

.image-modal-close:hover {
    color: #ccc;
}

/* ========== PERSONAL DETAILS FORM ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    margin: 20px auto;
    animation: slideDown 0.3s ease;
}

.modal-dialog.modal-lg {
    max-width: 480px;
    max-height: 85vh;
}

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

.modal-header-personal {
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-personal h2 {
    margin: 0;
    color: var(--dark-color);
    font-size: 24px;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--dark-color);
}

.modal-body-personal {
    padding: 25px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* ========== FORM STYLES ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* ========== PHOTO UPLOAD ========== */
.photo-upload {
    width: 100%;
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background-color: #fafafa;
}

.photo-upload:hover {
    border-color: var(--primary-color);
    background-color: rgba(30, 136, 229, 0.05);
}

.photo-upload img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
}

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

.btn-primary:hover {
    background-color: #1565c0;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ========== PREVIEW CONTENT ========== */
.preview-content {
    background: white;
    padding: 40px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    page-break-after: avoid;
}

/* New Personal Details Preview Layout */
.preview-content-personal {
    background: white;
    padding: 12px 15px;
    border: none;
    border-radius: 0;
}

.preview-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: left;
    letter-spacing: 0.5px;
}

.personal-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    font-size: 10px;
}

.personal-details-table tr {
    border: 1px solid #000;
}

.personal-details-table td {
    padding: 4px 6px;
    border: 1px solid #000;
    vertical-align: top;
    min-height: 15px;
    height: 15px;
}

.personal-details-table .label-col {
    background-color: #d3d3d3;
    font-weight: 600;
    width: 15%;
    color: var(--dark-color);
}

.personal-details-table .value-col {
    background-color: #f0f0f0;
    color: var(--dark-color);
    word-break: break-word;
}

.preview-photo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    margin-top: 6px;
}

.preview-photo-box-large {
    width: 160px;
    height: 220px;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    overflow: hidden;
}

.preview-photo-box-large img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.date-field {
    display: flex;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: 10px;
}

.date-label {
    font-weight: 600;
    margin-right: 5px;
    min-width: 110px;
}

.date-value {
    color: var(--dark-color);
    padding-bottom: 1px;
    border-bottom: 1px solid #000;
    flex: 1;
    max-width: 200px;
}

.signature-field {
    display: flex;
    align-items: flex-end;
    font-size: 10px;
    margin-top: 12px;
}

.signature-label {
    font-weight: 600;
    margin-right: 5px;
    min-width: 70px;
}

.signature-line-long {
    flex: 1;
    border-bottom: 1px solid #000;
    min-height: 12px;
    max-width: 200px;
}

/* ========== OBJECTIVE LEVEL OF EDUCATION ========== */
.objective-level-content {
    padding: 20px 0;
    font-size: 13px;
    line-height: 1.6;
}

.objective-level-content h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.objective-level-content h3 {
    font-size: 12px;
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 8px;
}

.objective-level-content ul {
    margin: 0 0 10px 20px;
    padding: 0;
}

.objective-level-content li {
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.objective-level-content p {
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.6;
    text-align: justify;
}

.preview-header {
    text-align: center;
    border-bottom: 2px solid var(--dark-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.preview-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.preview-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.preview-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.preview-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-photo-box {
    width: 200px;
    height: 250px;
    border: 2px solid var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    overflow: hidden;
}

.preview-photo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.preview-details {
    flex: 1;
}

.preview-row {
    margin-bottom: 20px;
}

.preview-row-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
    font-size: 14px;
}

.preview-row-value {
    color: var(--dark-color);
    font-size: 14px;
    word-break: break-word;
    min-height: 20px;
}

.signature-section {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.signature-box {
    text-align: center;
}

.signature-line {
    border-top: 1px solid var(--dark-color);
    margin-bottom: 10px;
    padding-top: 30px;
    min-height: 50px;
}

@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        margin: 10px auto;
    }

    .modal-dialog.modal-lg {
        max-width: 95%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .preview-body {
        grid-template-columns: 1fr;
    }

    .signature-section {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .preview-content {
        padding: 20px;
    }
}

@page {
    size: A4 portrait;
    margin: 2cm;
}

/* Landscape page for rotation schedule */
@page rotationSchedule {
    size: A4 landscape;
    margin: 1.5cm;
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        background: white;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Hide everything by default */
    body > * {
        display: none !important;
    }

    /* Show only modal that has display: flex or display: block inline style */
    .modal-overlay[style*="display: flex"],
    .modal-overlay[style*="display: block"] {
        display: block !important;
        position: relative !important;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        background: white;
        top: auto;
        left: auto;
        overflow: visible !important;
        max-height: none !important;
    }

    #imageModal[style*="display: block"] {
        display: block !important;
        position: relative !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    #imageModal[style*="display: block"] .image-modal-content {
        margin: 0 auto !important;
        max-width: 100% !important;
        max-height: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    #imageModal[style*="display: block"] .image-modal-caption {
        color: #000 !important;
        margin: 12px 0 !important;
    }

    #imageModal[style*="display: block"] .image-modal-close,
    #imageModal[style*="display: block"] .image-modal-actions {
        display: none !important;
    }

    /* Modal dialog - clean layout */
    .modal-overlay[style*="display"] .modal-dialog {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        position: relative;
        box-shadow: none;
        border: none;
        background: white;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Remove restrictions on inner divs */
    .modal-overlay[style*="display"] .modal-dialog > div {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Hide UI elements */
    button, .btn, .form-actions, .modal-header, .modal-header-personal, .close, .btn-close, .btn-primary, .btn-secondary {
        display: none !important;
    }

    hr, .divider {
        display: none !important;
    }

    /* Personal Details Form */
    .modal-body-personal {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .preview-content-personal {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .preview-photo-container {
        margin-bottom: 5cm !important;
    }

    .preview-photo-container img {
        max-width: 200px;
    }

    .personal-details-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 3cm !important;
    }

    .personal-details-table tr, .personal-details-table td {
        border: none;
        padding: 4px 0;
    }

    .preview-photo-box-large {
        margin-bottom: 0.2cm !important;
    }

    .date-field {
        margin-bottom: 1.5cm !important;
    }

    .date-field input, .preview-signature {
        border: none;
        background: white;
    }

    /* Objective Level Content */
    .objective-level-content {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .objective-level-content h1, .objective-level-content h3 {
        border: none;
        margin-bottom: 10px;
        font-size: 14px;
    }

    .objective-level-content ul, .objective-level-content ol {
        margin-left: 20px;
    }

    .objective-level-content li, .objective-level-content p {
        font-size: 12px;
        margin: 5px 0;
    }

    /* Academic Tutors Form */
    #academicTutorsForm {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    #academicTutorsForm table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 15px;
    }

    #academicTutorsForm table td {
        border: 1px solid #000;
        padding: 6px 8px;
        font-size: 12px;
    }

    #academicTutorsForm input[type="text"] {
        width: 100%;
        border: none;
        padding: 4px;
        font-size: 12px;
    }

    /* Certificate Form */
    #certificateForm {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        margin-top: 0 !important;
    }

    #certificateForm input[type="text"],
    #certificateForm input[type="date"] {
        width: 100%;
        border: none;
        border-bottom: 1px solid #000 !important;
        padding: 8px 0;
        font-size: 12px;
        background: white;
    }

    #certificateForm div[style*="border: 2px"] {
        border: 2px solid #000 !important;
        border-top: 2px solid #000 !important;
        border-right: 2px solid #000 !important;
        border-bottom: 2px solid #000 !important;
        border-left: 2px solid #000 !important;
        padding: 20px !important;
        margin-top: 0 !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid !important;
    }

    /* Discussion & Assessment Form */
    #discussionAssessmentForm {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        margin-top: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #discussionAssessmentForm > * {
        display: block !important;
        visibility: visible !important;
    }

    #discussionAssessmentForm input[type="date"],
    #discussionAssessmentForm input[type="text"] {
        width: 100%;
        border: none !important;
        border-bottom: 1px solid #000 !important;
        padding: 6px 0;
        font-size: 12px;
        background: white;
    }

    #discussionAssessmentForm div[style*="border: 2px"] {
        border: 2px solid #000 !important;
        border-top: 2px solid #000 !important;
        border-right: 2px solid #000 !important;
        border-bottom: 2px solid #000 !important;
        border-left: 2px solid #000 !important;
        padding: 20px !important;
        margin-top: 0 !important;
        margin-bottom: 20px !important;
        display: block !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
    }

    #discussionAssessmentForm div[style*="page-break-before: always"] {
        page-break-before: always !important;
        break-before: page !important;
        display: block !important;
        visibility: visible !important;
    }

    #discussionAssessmentForm h2 {
        display: block !important;
        text-align: center !important;
        font-size: 14px !important;
        font-weight: bold !important;
        margin: 0 0 15px 0 !important;
    }

    #discussionAssessmentForm p {
        display: block !important;
        font-size: 12px !important;
        line-height: 1.6 !important;
        margin-bottom: 12px !important;
    }

    /* Rotation Schedule */
    #rotationScheduleContent {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        page: rotationSchedule;
    }

    /* Landscape orientation for rotation schedule */
    #rotationScheduleModal[style*="display: flex"],
    #rotationScheduleModal[style*="display: block"] {
        display: block !important;
        position: relative !important;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        background: white;
        overflow: visible !important;
        page: rotationSchedule;
    }

    #rotationScheduleContent h1,
    #rotationScheduleContent h2 {
        display: block !important;
        text-align: center !important;
        font-weight: bold !important;
    }

    #rotationScheduleContent h1 {
        font-size: 16px !important;
        margin: 0 0 5px 0 !important;
    }

    #rotationScheduleContent h2 {
        font-size: 14px !important;
        margin: 0 0 20px 0 !important;
    }

    #rotationScheduleContent table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 0 auto !important;
        page: rotationSchedule;
    }

    #rotationScheduleContent table td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        text-align: center !important;
        font-size: 11px !important;
    }

    /* Preserve background colors in print */
    #rotationScheduleContent table td[style*="background: #000"],
    #rotationScheduleContent table td[style*="background: black"] {
        background: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #rotationScheduleContent table td[style*="background: #ddd"] {
        background: #ddd !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #rotationScheduleContent table td[style*="background: #ff9999"] {
        background: #ff9999 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #rotationScheduleContent table td[style*="background: #ffff66"] {
        background: #ffff66 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #rotationScheduleContent table td[style*="background: #99ff99"] {
        background: #99ff99 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Academic Tasks Print Styling */
    #academicTasksModal {
        display: block !important;
    }

    #academicTasksModal .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #academicTasksModal .modal-content {
        box-shadow: none !important;
        border: none !important;
    }

    #academicTasksModal .modal-header,
    #academicTasksModal .btn,
    #academicTasksModal button {
        display: none !important;
    }

    #academicTasksContent {
        padding: 0 !important;
    }

    #academicTasksContent h2 {
        text-align: center;
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 20px;
    }

    .task-section {
        margin-bottom: 30px !important;
    }

    .task-section .academic-input {
        border: none !important;
        padding: 5px !important;
    }

    .task-section textarea.academic-input {
        min-height: 60px !important;
        overflow: visible !important;
    }

    /* Preserve black backgrounds in Academic Tasks */
    .task-section div[style*="background: #000"] {
        background: #000 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Page break for T2 section */
    .task-section[style*="page-break-before"] {
        page-break-before: always !important;
        break-before: page !important;
    }

    /* Research Activities Print Styling */
    #researchActivitiesModal {
        display: block !important;
    }

    #researchActivitiesModal .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #researchActivitiesModal .modal-content {
        box-shadow: none !important;
        border: none !important;
    }

    #researchActivitiesModal .modal-header,
    #researchActivitiesModal .btn,
    #researchActivitiesModal button {
        display: none !important;
    }

    #researchActivitiesContent {
        padding: 0 !important;
    }

    #researchActivitiesContent h2 {
        text-align: center;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 30px;
    }

    .research-section {
        margin-bottom: 40px !important;
        page-break-inside: avoid !important;
    }

    .research-section .research-input {
        border: none !important;
        padding: 5px !important;
    }

    .research-section textarea.research-input {
        min-height: 60px !important;
        overflow: visible !important;
    }

    /* Preserve black backgrounds in Research Activities */
    .research-section div[style*="background: #000"] {
        background: #000 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Preserve borders in Research Activities tables */
    .research-section table,
    .research-section table td {
        border: 1px solid #000 !important;
    }

    /* Scientific Activities Print Styling */
    #scientificActivitiesModal {
        display: block !important;
    }

    #scientificActivitiesModal .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #scientificActivitiesModal .modal-content {
        box-shadow: none !important;
        border: none !important;
    }

    #scientificActivitiesModal .modal-header,
    #scientificActivitiesModal .btn,
    #scientificActivitiesModal button {
        display: none !important;
    }

    #scientificActivitiesContent {
        padding: 0 !important;
    }

    #scientificActivitiesContent h2 {
        text-align: center;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 30px;
    }

    #scientificActivitiesTable {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    #scientificActivitiesTable th,
    #scientificActivitiesTable td {
        border: 1px solid #000 !important;
        padding: 8px !important;
    }

    #scientificActivitiesTable th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #scientificActivitiesTable .scientific-input {
        border: none !important;
        width: 100% !important;
        padding: 0 !important;
    }

    #scientificActivitiesTable textarea.scientific-input {
        min-height: 40px !important;
        overflow: visible !important;
        resize: none !important;
    }

    /* Hide Actions column and delete buttons in print */
    .no-print,
    .btn-delete {
        display: none !important;
    }

    /* Remove all borders and styling artifacts */
    .objective-level-content * {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }
}

.text-muted {
    color: var(--text-muted);
}

/* ========== SIDEBAR BACKDROP ========== */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Body scroll lock when sidebar open on mobile */
body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        padding: 20px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .statistics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        box-shadow: none;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.35s ease;
        border-right: 1px solid var(--border-color);
        padding: 20px 16px 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        will-change: transform;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0,0,0,0.25);
    }

    .sidebar-logout {
        display: block;
    }

    .institutional-logos {
        margin-right: 0 !important;
    }

    .header-copyright {
        font-size: 9px;
    }

    .menu-section {
        margin-bottom: 12px;
    }

    .menu-section h3 {
        font-size: 10px;
        margin-bottom: 6px;
        letter-spacing: 0.3px;
    }

    .sidebar-menu {
        gap: 12px;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .main-content {
        padding: 15px;
        flex: 1;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .statistics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-number {
        font-size: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }

    .calendar td {
        padding: 8px;
        min-height: 60px;
        font-size: 12px;
    }

    .calendar th {
        padding: 8px;
        font-size: 12px;
    }

    .welcome-card {
        padding: 20px;
    }

    .welcome-card h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 10px 15px;
    }

    .logo {
        font-size: 16px;
        letter-spacing: 0.5px;
    }

    .header-left {
        gap: 10px;
    }

    .institutional-logos {
        display: none;
    }

    .header-copyright {
        display: none;
    }

    .hamburger {
        padding: 6px 4px;
        gap: 4px;
        width: 36px;
        height: 32px;
    }

    .hamburger-line {
        width: 20px;
        height: 2px;
    }

    .hamburger.active .hamburger-line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .hamburger.active .hamburger-line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .main-content {
        padding: 10px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .welcome-card {
        padding: 15px;
        border-radius: 6px;
    }

    .welcome-card h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .welcome-card p {
        font-size: 12px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }

    .stat-icon {
        font-size: 28px;
    }

    .stat-number {
        font-size: 18px;
    }

    .stat-label {
        font-size: 12px;
    }

    .modal-content {
        width: 98%;
        max-height: 95vh;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px;
        padding: 10px;
    }

    .btn {
        padding: 9px 14px;
        font-size: 13px;
    }

    .sidebar-user {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .user-avatar-large {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .user-name-full {
        font-size: 13px;
    }

    .user-spec {
        font-size: 11px;
    }

    .menu-link {
        padding: 8px 6px;
        font-size: 11.5px;
        line-height: 1.4;
    }

    .menu-item-header .menu-link {
        padding: 8px 2px 8px 6px;
        font-size: 11px;
        line-height: 1.4;
    }

    .submenu .menu-item-header .menu-link {
        padding: 7px 2px 7px 4px;
        font-size: 10.5px;
        line-height: 1.4;
    }

    .submenu-link {
        padding: 7px 4px !important;
        font-size: 10.5px;
        line-height: 1.4;
    }

    .menu-toggle {
        width: 16px;
        height: 16px;
        font-size: 10px;
        padding: 0;
    }

    .menu-toggle-sub {
        width: 16px;
        min-height: 16px;
        padding: 8px 2px;
        font-size: 9px;
    }

    .menu-list {
        max-height: 800px;
    }

    .menu-item-header {
        gap: 4px;
        align-items: flex-start;
    }

    .submenu {
        margin-left: 6px;
    }

    .submenu .submenu {
        margin-left: 4px;
    }

    .menu-item-with-submenu {
        margin-bottom: 4px;
    }

    .menu-section li {
        margin-bottom: 4px;
    }

    .submenu li {
        margin-bottom: 3px;
    }

    .logout-btn {
        padding: 10px 12px;
        font-size: 13px;
        gap: 10px;
    }

    .logout-icon {
        font-size: 16px;
    }

    .sidebar-logout {
        padding: 15px 0;
        margin-top: 15px;
    }
}

/* ========== PORTFOLIO DATA TABLE ========== */
.portfolio-data-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.portfolio-data-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e88e5;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1e88e5;
}

.portfolio-patients-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: visible;
    table-layout: auto;
}

/* Target Tatalaksana column by styling class */
.portfolio-patients-table th:nth-child(6),
.portfolio-patients-table td:nth-child(6) {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Alternative styling for tatalaksana via inline class if added */
.tatalaksana-column {
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-edit, .btn-delete {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-edit {
    background-color: #4CAF50;
    color: white;
}

.btn-edit:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-delete:hover {
    background-color: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.portfolio-patients-table thead {
    background-color: #f5f5f5;
}

.portfolio-patients-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
    color: #495057;
}

.portfolio-patients-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
    color: #333;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.portfolio-patients-table tbody tr:hover {
    background-color: #f9f9f9;
    transition: background-color 0.2s ease;
}

/* Toast notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Trainee Cards */
.trainee-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.trainee-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.trainee-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.2);
    transform: translateY(-2px);
}

.trainee-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.trainee-initial {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 0;
}

.trainee-card-info {
    flex: 1;
}

.trainee-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.trainee-card-specialization {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
}

.trainee-card-semester {
    font-size: 12px;
    color: #999;
}

.trainee-card-footer {
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.trainee-card-link {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
}

.trainee-logbooks-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.trainee-logbooks-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: var(--dark-color);
}

.trainee-logbooks-header .btn {
    flex-shrink: 0;
}

/* Verification Summary */
.verification-summary {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 14px;
}

.summary-verified {
    color: #4caf50;
}

.summary-unverified {
    color: #f44336;
    font-weight: 600;
}

.summary-total {
    color: #666;
}

/* Verification Badges */
.log-verified-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.log-unverified-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    background: #ffebee;
    color: #c62828;
    border: 2px solid #f44336;
    text-transform: uppercase;
}

/* Blink Animation */
@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0.3;
    }
}

.blink {
    animation: blink 1.5s infinite;
}

.portfolio-patients-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* ========== FOOTER ========== */
footer {
    background-color: var(--light-color);
    color: var(--dark-color);
    text-align: center;
    padding: 20px;
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    bottom: 0;
    width: 100%;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
