* {
    box-sizing: border-box;
}

.counselor-portal {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Header Styles */
.portal-header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-title {
    color: #2c3e50 !important;
    font-size: 2rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.user-info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 25px;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Sidebar Styles */
.sidebar-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    height: fit-content;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
}

/* Navigation Items */
.nav-item {
    padding: 12px 15px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: #3498db !important;
    color: white !important;
    transform: translateX(5px);
}

.nav-item.active {
    background: #2c3e50 !important;
    color: white !important;
}

/* Main Content Area */
.main-content-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Student Cards */
.student-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border-left: 4px solid #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.student-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.student-status {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.student-issues {
    margin-top: 8px;
    font-size: 0.9rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 8px;
}

.status-at-risk {
    background: #ffebee;
    color: #c62828;
}

.status-on-track {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-needs-attention {
    background: #fff3e0;
    color: #ef6c00;
}

/* Alerts */
.alert {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
}

.alert-critical {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Right Panel */
.right-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    height: fit-content;
}

/* Buttons */
.portal-btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    margin: 5px 0;
}

.portal-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.portal-btn-secondary {
    background: #95a5a6;
}

.portal-btn-secondary:hover {
    background: #7f8c8d;
}

/* Calendar Widget */
.calendar-widget {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.appointment-item {
    padding: 10px;
    border-left: 3px solid #3498db;
    background: white;
    margin: 8px 0;
    border-radius: 5px;
}

/* Tabs */
.tab-container {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab-item {
    padding: 12px 25px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    background: none;
    border: none;
}

.tab-item.active {
    border-bottom-color: #3498db;
    color: #3498db;
    font-weight: 600;
}

/* Progress Bars */
.progress-bar {
    background: #eee;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Table Overrides for Baserow */
.baserow-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.baserow-table th {
    background: #2c3e50 !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 15px !important;
}

.baserow-table td {
    padding: 12px 15px !important;
    border-bottom: 1px solid #eee !important;
}

.baserow-table tr:hover {
    background: #f8f9fa !important;
}

/* Form Field Overrides */
.portal-form-field {
    margin-bottom: 20px;
}

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

.portal-form-field input,
.portal-form-field select,
.portal-form-field textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.portal-form-field input:focus,
.portal-form-field select:focus,
.portal-form-field textarea:focus {
    border-color: #3498db;
    outline: none;
}

/* Cards */
.portal-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin: 15px 0;
    transition: all 0.3s ease;
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Icons (using emoji or text) */
.icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.icon-large {
    font-size: 3rem;
    margin-bottom: 15px;
    text-align: center;
    display: block;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quick-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portal-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .quick-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-container {
        overflow-x: auto;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.margin-top { margin-top: 20px; }
.margin-bottom { margin-bottom: 20px; }
.no-margin { margin: 0; }

.padding { padding: 20px; }
.no-padding { padding: 0; }

.full-width { width: 100%; }
.half-width { width: 50%; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-center { justify-content: center; align-items: center; }
.flex-between { justify-content: space-between; }
.flex-gap { gap: 15px; }

.hidden { display: none; }
.visible { display: block; }

/* Custom Data Attributes for Dynamic Styling */
[data-status="at-risk"] {
    border-left-color: #e74c3c !important;
}

[data-status="on-track"] {
    border-left-color: #27ae60 !important;
}

[data-status="needs-attention"] {
    border-left-color: #f39c12 !important;
}

[data-priority="high"] {
    background: #ffe6e6 !important;
}

[data-priority="medium"] {
    background: #fff4e6 !important;
}

[data-priority="low"] {
    background: #e6ffe6 !important;
}