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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #004B87;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 7.5vh; /* Make header half as height */
}

.header-title {
    text-align: left;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 120px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.title-text {
    flex: 1;
}

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

.auth-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#user-name {
    font-weight: 600;
    color: white;
}

header h1 {
    color: white;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
}

.tab-navigation {
    display: none; /* Hidden by default until user is logged in */
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.tab-navigation.visible {
    display: flex;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: #004B87;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 75, 135, 0.4);
}

.tab-btn[data-tab="manage"] {
    flex: 0.33;
    font-size: 0.7em;
    padding: 8px 10px;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

/* Reduce top padding for requests tab specifically */
#requests-tab {
    padding-top: 15px !important;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.section-header h2 {
    color: #004B87;
    font-size: 1.8em;
    font-weight: 600;
}

.search-bar {
    margin-bottom: 25px;
}

.search-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.item-count-control {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.item-count-control label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.item-count-control select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.item-count-control select:focus {
    outline: none;
}

.search-bar input {
    flex: 1;
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
}

.search-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    height: auto;
    min-height: 50px;
}

.search-input-container input {
    flex: 1;
    width: 100%;
    padding: 15px 45px 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.search-input-container input:focus {
    outline: none;
}

.search-icon-inside {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 10;
    background: transparent;
    border: none;
    padding: 5px;
}

.search-icon-inside:hover {
    color: #004B87;
}

.search-icon-inside:active {
    transform: translateY(-50%) scale(0.9);
}

/* Search controls mobile improvements */
@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .item-count-control {
        justify-content: center;
    }
    
    .search-input-container {
        width: 100% !important;
        max-width: none;
    }
    
    .search-input-container input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* School selector mobile fixes */
    .school-selector select {
        max-width: 100% !important;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Override cards-container for publicaccounts-list to use full width */
#publicaccounts-list {
    display: block;
    width: 100%;
    min-width: 800px; /* Match table container minimum width */
}

/* Override cards-container for requests-list to use full width */
#requests-list {
    display: block;
    width: 100%;
    min-width: 800px; /* Match table container minimum width */
}

/* Override cards-container for relationships-list to use full width */
#relationships-list {
    display: block;
    width: 100%;
    min-width: 800px; /* Match table container minimum width */
}

/* Match heights for requests controls */
#request-item-count,
#request-search {
    height: 38px; /* Match Select2 default height */
    line-height: 38px;
    padding: 0 12px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
}

/* Ensure hidden class works properly */
.search-bar.hidden {
    display: none !important;
}

/* Hide requests search bar content by default */
#requests-search-bar-content {
    display: none !important;
}

/* Show requests search bar content when visible class is added */
#requests-search-bar-content.visible {
    display: block !important;
}

/* Hide relationships search bar content by default */
#relationships-search-bar-content {
    display: none !important;
}

/* Show relationships search bar content when visible class is added */
#relationships-search-bar-content.visible {
    display: block !important;
}

#request-item-count:focus,
#request-search:focus {
    outline: none;
}

/* Match heights for relationships controls */
#relationship-item-count {
    height: 38px; /* Match Select2 default height */
    line-height: 38px;
    padding: 0 12px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
}

#relationship-item-count:focus {
    outline: none;
}

/* Select2 specific styling to match other controls */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    border: 2px solid #e9ecef;
    border-radius: 4px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #e9ecef;
}

/* Ensure select2 selection text is visible */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #333 !important;
    padding-left: 12px !important;
    line-height: 36px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999 !important;
}

.card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #004B87;
}

.card h3 {
    color: #004B87;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.card p {
    color: #6c757d;
    margin-bottom: 8px;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #004B87;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 75, 135, 0.4);
}

#login-btn {
    background: white;
    color: #004B87;
    border: 2px solid #004B87;
}

#login-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 75, 135, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

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

.relationships-container {
    display: grid;
    gap: 20px;
}

.relationship-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.relationship-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.relationship-info {
    flex: 1;
}

.relationship-info h3 {
    color: #004B87;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.relationship-info p {
    color: #6c757d;
    margin-bottom: 5px;
}

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

.stat-card {
    background: #004B87;
    color: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 75, 135, 0.3);
}

.stat-card h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card p {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0;
}

.manage-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 15px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    border-top-right-radius: 15px;
    border-top-left-radius: 15px;
    border-bottom-right-radius: 15px;
    border-bottom-left-radius: 15px;
    position: relative;
}

.modal-content .close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

.modal-content .close:hover {
    color: #000;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #adb5bd;
}

.empty-state p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 12px;
    background: #004B87;
    color: white;
    margin-left: 10px;
}

/* Mobile-first responsive improvements */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        height: auto;
    }
    
    .header-title {
        text-align: center;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .logo {
        height: 80px;
        max-width: 80px;
    }
    
    header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    header p {
        font-size: 0.8em;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }
    
    .tab-btn {
        font-size: 0.9em;
        padding: 12px 16px;
    }
    
    .tab-btn[data-tab="manage"] {
        flex: 1;
        font-size: 0.8em;
        padding: 10px 12px;
    }
    
    .tab-content {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 1.4em;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Fix mobile card display */
    .card {
        padding: 15px;
        border-radius: 8px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .card h3 {
        font-size: 1.1em;
        line-height: 1.3;
    }
    
    .card p {
        font-size: 0.9em;
        line-height: 1.4;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .relationship-card {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Fix authentication error display on mobile */
    .auth-error {
        background: #f8d7da;
        border: 1px solid #f5c6cb;
        border-radius: 8px;
        padding: 15px;
        margin: 10px 0;
        color: #721c24;
        font-size: 0.9em;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Ensure error messages are fully visible */
    .error-message {
        background: #f8d7da;
        border: 1px solid #f5c6cb;
        border-radius: 8px;
        padding: 15px;
        margin: 10px 0;
        color: #721c24;
        font-size: 0.9em;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix button sizing on mobile */
    .btn {
        padding: 12px 16px;
        font-size: 0.9em;
        min-height: 44px; /* iOS touch target minimum */
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 0.8em;
        min-height: 36px;
    }
}

/* Table Styles */
#requests-list {
    width: 100%;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-width: 800px; /* Ensure minimum width for better horizontal space utilization */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.data-table th {
    background: #004B87;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #003566;
}

/* Grade filter dropdown styles */
.grade-filter-container {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.grade-filter-dropdown {
    background: white;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75em;
    min-width: 40px;
    max-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grade-filter-dropdown:focus {
    outline: none;
}

.grade-filter-dropdown:hover {
    border-color: #003566;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

/* Ensure status column is visible */
.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    min-width: 120px;
    text-align: center;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.object-id {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    color: #666;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    max-width: 120px;
    display: inline-block;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-badge.completed {
    background: #e8f5e8;
    color: #2d5a2d;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.unknown {
    background: #f8f9fa;
    color: #6c757d;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    min-width: 800px; /* Match table container minimum width */
}

/* Relationships pagination container */
#relationships-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    min-width: 800px; /* Match table container minimum width */
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.pagination-controls .btn {
    min-width: 80px;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table container mobile fixes */
@media (max-width: 768px) {
    .table-container {
        border-radius: 0;
        box-shadow: none;
        min-width: auto; /* Remove fixed min-width */
        width: 100%;
        overflow-x: auto;
    }
    
    .data-table {
        font-size: 0.8em;
        min-width: 600px; /* Reduced minimum width */
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
    
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        display: none; /* Hide Actions column on mobile */
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        min-width: auto; /* Remove fixed min-width */
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-controls .btn {
        min-width: 70px;
        font-size: 0.8em;
    }
    
    /* Override cards-container for mobile */
    #publicaccounts-list,
    #requests-list,
    #relationships-list {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        min-width: auto; /* Remove fixed min-width */
        gap: 15px;
    }
    
    #relationships-pagination {
        min-width: auto; /* Remove fixed min-width */
    }
}

/* Name Link Styles */
.name-link {
    color: #004B87;
    text-decoration: none;
    font-weight: 500;
}

.name-link:hover {
    color: #0066CC;
    text-decoration: underline;
}

/* Loading Modal Styles */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-modal.show {
    display: flex;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #004B87;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    margin: 0;
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

/* Loading modal mobile improvements */
@media (max-width: 768px) {
    .loading-content {
        padding: 30px;
        min-width: 160px;
        max-width: 90%;
        margin: 0 auto;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
        border-top-width: 3px;
        margin-bottom: 16px;
    }
    
    .loading-content p {
        font-size: 14px;
        line-height: 1.4;
    }
}

/* User Image Modal Styles */
.user-image-container {
    text-align: center;
    margin-bottom: 20px;
}

.user-image-container img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #004B87;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.user-image-container img:hover {
    transform: scale(1.05);
}

.user-image-container img[src=""] {
    display: none;
}

.user-jobtitle {
    font-size: 0.9em;
    font-weight: 500;
    color: #004B87;
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

/* Readonly input styles */
.form-group input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #e9ecef;
}

.form-group input[readonly]:focus {
    outline: none;
    border-color: #e9ecef;
    box-shadow: none;
}

/* Add global error message styles */
.error-message,
.auth-error,
.notification-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    color: #721c24;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}

/* Success message styles */
.success-message,
.auth-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    color: #155724;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}

/* Warning message styles */
.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    color: #856404;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}

/* Info message styles */
.info-message {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    color: #0c5460;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure all content is properly contained */
.tab-content {
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.form-group input[readonly]::placeholder {
    color: #adb5bd;
}

/* Request Details Modal Styles */
.modal-content-large {
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    border-radius: 15px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

#request-modal-title,
#requestor-modal-title {
    margin-bottom: 15px;
}

.request-modal-content {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 75, 135, 0.3) transparent;
}

#relationship-details-view {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.request-modal-content::-webkit-scrollbar {
    width: 8px;
}

.request-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.request-modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 75, 135, 0.3);
    border-radius: 4px;
}

.request-modal-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 75, 135, 0.5);
}

.request-status-section {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.status-label {
    font-weight: 600;
    color: #333;
    font-size: 1em;
}

.permission-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    margin-top: 8px;
}

#approve-notes-section {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#approve-notes-section h3 {
    color: #004B87;
    font-size: 1em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

#approve-notes {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
}

/* Relationship Detail Modal Styles */
.relationship-modal-content {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 75, 135, 0.3) transparent;
}

.relationship-modal-content::-webkit-scrollbar {
    width: 8px;
}

.relationship-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.relationship-modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 75, 135, 0.3);
    border-radius: 4px;
}

.relationship-modal-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 75, 135, 0.5);
}

.guardian-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-row:hover {
    background-color: transparent;
}

.detail-label {
    font-weight: 600;
    color: #495057;
    min-width: 140px;
    font-size: 0.9em;
}

.detail-value {
    color: #212529;
    font-size: 0.9em;
    font-weight: 500;
}

.detail-value.placeholder {
    background-color: #f8f9fa;
    color: #adb5bd;
    padding: 4px 12px;
    border-radius: 4px;
    min-width: 100px;
    display: inline-block;
    text-align: center;
    font-style: italic;
}

/* Student Card */
.student-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.guardian-image-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.guardian-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.guardian-photo-wrapper {
    width: 315px;
    height: 200px;
    border-radius: 8px;
    background-color: rgba(240, 240, 240, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.guardian-basic-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.guardian-basic-info h4.placeholder {
    background-color: #f8f9fa;
    color: #adb5bd;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
    font-style: italic;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.info-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #007bff;
    margin-right: 8px;
}

.info-row p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.info-row p.placeholder {
    background-color: #f8f9fa;
    color: #adb5bd;
    padding: 4px 12px;
    border-radius: 4px;
    font-style: italic;
}

/* Guardian Contact Card */
.guardian-contact-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.guardian-contact-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
}

.contact-item-full {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
}

.contact-label {
    margin: 0;
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

.contact-item p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.contact-item p.placeholder {
    background-color: #f8f9fa;
    color: #adb5bd;
    padding: 4px 12px;
    border-radius: 4px;
    font-style: italic;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

.confirmation-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.confirmation-message h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.confirmation-message p {
    color: #856404;
    margin-bottom: 10px;
    line-height: 1.5;
}

.confirmation-details {
    background: white;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.confirmation-details p {
    margin: 8px 0;
    font-size: 1em;
}

.warning-text {
    font-weight: 600;
    color: #dc3545 !important;
    margin-top: 15px !important;
}

/* Relationship Modal Card Layout */
.relationship-modal-content {
    display: flex;
    gap: 20px;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* Override for relationship detail modal which uses vertical layout */
#relationship-detail-modal .relationship-modal-content {
    display: block;
}

#relationship-detail-modal h2 {
    padding-bottom: 5px;
}

.relationship-left-card,
.relationship-right-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.student-search-section,
.guardian-search-section {
    margin-bottom: 15px;
}

.student-search-section label,
.guardian-search-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Semantic UI Search Styling */
.ui.fluid.icon.input.search.focus {
    width: 100%;
    position: relative;
}

.ui.fluid.icon.input.search.focus input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ui.fluid.icon.input.search.focus input:focus {
    outline: none;
}

.ui.fluid.icon.input.search.focus .search.icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.ui.fluid.icon.input.search.focus .guardian-clear-btn {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    transition: color 0.2s;
}

.ui.fluid.icon.input.search.focus .guardian-clear-btn:hover {
    color: #004B87;
}

.current-guardians-section {
    margin-top: 20px;
}

.current-guardians-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.current-guardians-list .guardian-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.current-guardians-list .no-data {
    color: #6c757d;
    font-style: italic;
    margin: 10px 0;
}

/* Guardian Placeholder Card */
.guardian-placeholder-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.placeholder-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.placeholder-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    min-width: 100px;
}

.placeholder-value {
    color: #333;
    font-size: 0.9em;
    font-weight: 500;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group select:focus {
    outline: none;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.result-details {
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

.no-results {
    padding: 15px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

#approve-notes:focus {
    outline: none;
}

.request-details-section,
.approvers-section,
.student-section,
.guardians-section {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    width: 100%;
    box-sizing: border-box;
}

.request-details-section h3,
.approvers-section h3,
.student-section h3,
.guardians-section h3 {
    color: #004B87;
    font-size: 1em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
    font-size: 0.9em;
}

.detail-value {
    color: #333;
    text-align: right;
    font-size: 0.9em;
}

.approvers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.approvers-table th {
    background: #004B87;
    color: white;
    padding: 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8em;
}

.approvers-table td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85em;
}

.approvers-table tr:last-child td {
    border-bottom: none;
}

.student-info-container {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    width: 100%;
}

.student-photo-container {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 8px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 16px;
}

.student-details {
    flex: 1;
}

.guardians-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.guardian-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.guardian-item .detail-row {
    border-bottom: none;
    padding: 3px 0;
}

/* Mobile responsive styles for request modal */
@media (max-width: 768px) {
    .modal-content-large {
        width: 95%;
        max-height: 95vh;
        margin: 5% auto;
    }
    
    .request-modal-content {
        padding: 10px 0;
    }
    
    .request-status-section,
    .request-details-section,
    .approvers-section,
    .student-section,
    .guardians-section {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .status-label {
        font-size: 0.9em;
    }
    
    .request-details-section h3,
    .approvers-section h3,
    .student-section h3,
    .guardians-section h3 {
        font-size: 0.95em;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 4px 0;
    }
    
    .detail-label {
        min-width: auto;
        font-size: 0.85em;
        margin-bottom: 2px;
    }
    
    .detail-value {
        text-align: left;
        font-size: 0.85em;
    }
    
    .approvers-table {
        font-size: 0.8em;
    }
    
    .approvers-table th,
    .approvers-table td {
        padding: 6px 4px;
    }
    
    .student-info-container {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .student-photo-container {
        width: 80px;
        height: 80px;
        margin-right: 0;
    }
    
    .student-details {
        width: 100%;
        text-align: center;
    }
    
    .guardian-item {
        padding: 6px;
    }
    
    .guardian-item .detail-row {
        padding: 2px 0;
    }
}

/* Status link styles */
.status-link {
    color: #004B87;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease;
}

.status-link:hover {
    color: #0066CC;
    text-decoration: underline;
}

/* Note icon styles */
.note-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    color: #666;
    cursor: help;
    position: relative;
    transition: color 0.3s ease;
}

.note-icon:hover {
    color: #004B87;
}

.note-icon::after {
    content: attr(data-reason);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    max-width: 300px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.note-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

.note-icon::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    margin-bottom: 0;
}

.note-icon:hover::before {
    opacity: 1;
    visibility: visible;
}
