/* Import T2 Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;700&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* NEXTWO Color Scheme */
:root {
    --t2-green: #00A0DC;
    --t2-green-dark: #0080B8;
    --t2-orange: #FF9800;
    --t2-sky: #03A9F4;
    --t2-purple: #9C27B0;
    --t2-dark: #2C3E50;
    --t2-black: #1a1a1a;
    --t2-gray: #666;
    --t2-light-gray: #f5f5f5;
    --t2-border: #ddd;
    --text-primary: #333;
    --text-secondary: #666;
    --background-light: #F8F6EF;
}

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

body {
    font-family: 'IBM Plex Sans Arabic', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background-light);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Loading Spinner */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.btn-logout-img {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-logout-img:hover {
    transform: scale(1.1);
}

.btn-logout-img img {
    height: 24px;
    width: auto;
    display: block;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--t2-green) 0%, var(--t2-green-dark) 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.robot-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.robot-icon-small {
    font-size: 32px;
    margin-right: 10px;
}

.login-box h1 {
    color: var(--t2-dark);
    margin-bottom: 5px;
    font-size: 32px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--t2-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--t2-green);
    box-shadow: 0 0 0 3px rgba(0, 160, 220, 0.1);
}

.form-group input.invalid,
.form-group textarea.invalid,
.form-group select.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group input.valid,
.form-group textarea.valid,
.form-group select.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.field-error {
    display: block;
    color: #dc3545;
    font-size: 13px;
    font-style: italic;
    margin-top: 5px;
    font-weight: 500;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 13px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
}

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

.btn-primary:hover {
    background: var(--t2-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 160, 220, 0.3);
}

.btn-secondary {
    background: #1a1a1a;
    color: white;
}

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

.btn-logout {
    background: #f8f9fa;
    color: var(--t2-dark);
    border: 1px solid var(--t2-border);
}

.btn-logout:hover {
    background: #e9ecef;
}

.btn-block {
    width: 100%;
    display: block;
}

.dashboard {
    min-height: 100vh;
    background: var(--background-light);
}

.header {
    background: white;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 3px solid var(--t2-green);
    justify-content: flex-start;
}

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

.header-left h1 {
    font-size: 24px;
    color: var(--t2-dark);
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--t2-green);
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--t2-green);
}

.alert-warning {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--t2-green);
}

/* Dashboard Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 200px));
    gap: 12px;
    margin-bottom: 28px;
    justify-content: center;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border-top: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 200px;
}

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

.stat-card:nth-child(1) {
    border-top-color: #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f9f7ff 100%);
}

.stat-card:nth-child(1):hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.stat-card:nth-child(2) {
    border-top-color: #764ba2;
    background: linear-gradient(135deg, #ffffff 0%, #faf8ff 100%);
}

.stat-card:nth-child(2):hover {
    box-shadow: 0 8px 24px rgba(118, 75, 162, 0.2);
}

.stat-card:nth-child(3) {
    border-top-color: #00A0DC;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.stat-card:nth-child(3):hover {
    box-shadow: 0 8px 24px rgba(0, 160, 220, 0.2);
}

.stat-card:nth-child(4) {
    border-top-color: #9C27B0;
    background: linear-gradient(135deg, #ffffff 0%, #fdf5ff 100%);
}

.stat-card:nth-child(4):hover {
    box-shadow: 0 8px 24px rgba(156, 39, 176, 0.2);
}

.stat-icon {
    font-size: 18px;
    margin-bottom: 4px;
    opacity: 0.85;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--t2-dark);
    margin-bottom: 3px;
    font-family: 'Cairo', sans-serif;
    line-height: 1;
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive breakpoints for stats grid */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
        gap: 10px;
    }
    
    .stat-card {
        padding: 10px;
        max-width: 180px;
    }
    
    .stat-icon {
        font-size: 16px;
    }
    
    .stat-number {
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 180px));
        gap: 8px;
        justify-content: center;
    }
    
    .stat-card {
        padding: 10px;
        max-width: 180px;
    }
    
    .stat-icon {
        font-size: 16px;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 9px;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Activity Feed - Compact Version */
.activity-feed {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    padding: 12px 16px;
    margin-bottom: 24px;
}

.activity-feed h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--t2-dark);
    margin-bottom: 10px;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.activity-feed h2::before {
    content: '📋';
    font-size: 16px;
}

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

.activity-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.activity-item:nth-child(odd) {
    background: #f9f9f9;
}

.activity-item:nth-child(even) {
    background: #ffffff;
}

.activity-item:hover {
    border-color: var(--t2-green);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 160, 220, 0.1);
}

.activity-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.activity-icon.stage-pending,
.activity-icon.stage-screening {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
}

.activity-icon.stage-client-review,
.activity-icon.stage-interview-scheduling {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.activity-icon.stage-interview-scheduled,
.activity-icon.stage-interviewed {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.activity-icon.stage-selected,
.activity-icon.stage-offered,
.activity-icon.stage-accepted {
    background: linear-gradient(135deg, #E8F5E9 0%, #A5D6A7 100%);
}

.activity-icon.stage-rejected,
.activity-icon.stage-withdrawn,
.activity-icon.stage-no-show {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.activity-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--t2-dark);
    line-height: 1.3;
}

.activity-text .candidate-name {
    font-weight: 600;
    color: var(--t2-green);
}

.activity-text .stage-name {
    font-weight: 600;
    color: #764ba2;
}

.activity-meta {
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.activity-meta .user {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.activity-meta .user::before {
    content: '👤';
    font-size: 10px;
}

.activity-timestamp {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    text-align: right;
}

.no-activities {
    text-align: center;
    padding: 20px 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.no-activities::before {
    content: '📭';
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Responsive breakpoints for activity feed */
@media (max-width: 768px) {
    .activity-feed {
        padding: 16px;
    }
    
    .activity-feed h2 {
        font-size: 18px;
    }
    
    .activity-item {
        grid-template-columns: 32px 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    .activity-timestamp {
        grid-column: 2;
        text-align: left;
        font-size: 12px;
        margin-top: 4px;
    }
    
    .activity-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .activity-text {
        font-size: 13px;
    }
    
    .activity-meta {
        font-size: 11px;
    }
}

.candidates-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #1a1a1a;
    color: white;
}

th {
    padding: 14px;
    text-align: left;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--t2-border);
    vertical-align: middle;
    font-size: 14px;
}

/* Only apply hover to tbody rows, not thead */
tbody tr:hover {
    background: #f9f9f9;
}

/* Keep thead background black on hover */
thead tr:hover {
    background: #1a1a1a;
}

/* Clickable rows */
tr.clickable-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

tr.clickable-row:hover {
    background: #f5f9f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

tr.clickable-row:active {
    transform: translateY(0);
}

/* Table wrapper - no scroll needed with responsive columns */
.table-wrapper,
.table-container {
    overflow-x: visible;
}

/* Responsive column hiding for mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    
    /* Make table more compact on mobile */
    td, th {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    /* Ensure status badges stay readable */
    .status-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

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

.status-in-progress,
.status-in_progress {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.status-active {
    background: #d1e7dd;
    color: #0f5132;
}

.status-archived {
    background: #e2e3e5;
    color: #41464b;
}

.status-closed {
    background: #6c757d;
    color: #ffffff;
}

/* Stage badges - color-coded for candidate workflow stages */
.stage-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.stage-pending {
    background: #FEF3C7;
    color: #92400E;
}

.stage-in-progress {
    background: #DBEAFE;
    color: #1E40AF;
}

.stage-nextwo-review {
    background: #E9D5FF;
    color: #6B21A8;
}

.stage-client-review {
    background: #FED7AA;
    color: #9A3412;
}

.stage-interview-scheduling {
    background: #CCFBF1;
    color: #115E59;
}

.stage-client-interview {
    background: #A5F3FC;
    color: #155E75;
}

.stage-selected {
    background: #BBF7D0;
    color: #166534;
}

.stage-offering {
    background: #D9F99D;
    color: #3F6212;
}

.stage-hired {
    background: #86EFAC;
    color: #14532D;
    font-weight: 700;
}

.stage-rejected {
    background: #FECACA;
    color: #991B1B;
}

.stage-offer-rejected {
    background: #FCA5A5;
    color: #7F1D1D;
}

.stage-screening {
    background: #DBEAFE;
    color: #1E40AF;
}

.stage-interview-scheduled {
    background: #BFDBFE;
    color: #1E3A8A;
}

.stage-interviewed {
    background: #DDD6FE;
    color: #5B21B6;
}

.stage-offered {
    background: #D9F99D;
    color: #3F6212;
}

.stage-accepted {
    background: #86EFAC;
    color: #14532D;
    font-weight: 700;
}

.stage-withdrawn {
    background: #E5E7EB;
    color: #374151;
}

.stage-no-show {
    background: #FED7AA;
    color: #9A3412;
}

@media (max-width: 768px) {
    .stage-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
}

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

.btn-view {
    background: var(--t2-green);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-view:hover {
    background: var(--t2-green-dark);
}

.btn-edit {
    background: var(--t2-green);
    color: white;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-edit:hover {
    background: var(--t2-green-dark);
}

.btn-delete {
    background: #e63946;
    color: white;
    padding: 10px 16px;
    font-size: 20px;
    margin-inline-start: auto;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.btn-delete:hover {
    background: #d62828;
}

.btn-icon {
    background: var(--t2-black);
    color: white;
    padding: 10px 16px;
    font-size: 20px;
    font-weight: bold;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #2d2d2d;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-icon-emoji {
    font-size: 18px;
    line-height: 1;
}

.btn-label {
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .btn-label {
        display: none;
    }
    .btn-with-icon {
        padding: 10px 12px;
    }
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
}

.form-container h2 {
    color: var(--t2-dark);
    margin-bottom: 25px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.view-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.candidate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--t2-light-gray);
}

.candidate-header h2 {
    color: var(--t2-dark);
    font-size: 28px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.candidate-info {
    margin-bottom: 30px;
}

.info-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--t2-border);
}

.info-row strong {
    min-width: 150px;
    color: var(--t2-dark);
    font-weight: 600;
}

.interview-messages {
    margin-top: 30px;
}

.interview-messages h3 {
    color: var(--t2-dark);
    margin-bottom: 20px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.message {
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    position: relative;
}

.message-bot {
    background: linear-gradient(135deg, var(--t2-green) 0%, var(--t2-green-dark) 100%);
    color: white;
    margin-right: 60px;
}

.message-user {
    background: var(--t2-light-gray);
    color: var(--t2-dark);
    margin-left: 60px;
}

.message-role {
    font-weight: 600;
    margin-bottom: 5px;
    font-family: 'Cairo', sans-serif;
}

.message-content {
    line-height: 1.6;
}

.message-timestamp {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 8px;
}

.badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    background: var(--t2-light-gray);
    color: var(--t2-dark);
    font-weight: 500;
}

.btn-copy {
    background: var(--t2-green);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-copy:hover {
    background: var(--t2-green-dark);
}

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

.btn-archive {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    transition: all 0.3s ease;
}

.btn-archive:hover {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
    transform: translateY(-1px);
}

.btn-unarchive {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    transition: all 0.3s ease;
}

.btn-unarchive:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    transform: translateY(-1px);
}

.users-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.users-container h2 {
    color: var(--t2-dark);
    margin-bottom: 25px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.users-container h3 {
    color: var(--t2-dark);
    margin-bottom: 15px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.users-table {
    margin-bottom: 30px;
}

.btn-action {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-action-password {
    color: var(--t2-green);
}

.btn-action-password:hover {
    background: rgba(76, 175, 80, 0.1);
}

.btn-action-delete {
    color: #dc3545;
}

.btn-action-delete:hover {
    background: rgba(220, 53, 69, 0.1);
}

.add-user-section {
    background: var(--t2-light-gray);
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
}

.add-user-form {
    margin-top: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

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

.form-row .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--t2-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-row .form-group input:focus {
    outline: none;
    border-color: var(--t2-green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    color: var(--t2-dark);
    font-size: 28px;
    margin-bottom: 10px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Duplicate stats styles removed - using dashboard styles above */

.section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.section h3 {
    color: var(--t2-dark);
    margin-bottom: 20px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #1a1a1a;
    color: white;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--t2-border);
    vertical-align: middle;
}

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

.info-box {
    background: #d4edda;
    border: 1px solid var(--t2-green);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: var(--t2-dark);
}

.structure-preview {
    margin-top: 20px;
}

.structure-preview h3 {
    color: var(--t2-dark);
    margin-bottom: 15px;
    font-family: 'Cairo', sans-serif;
}

.structure-content {
    background: var(--t2-light-gray);
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .content {
        padding: 15px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .inline-form {
        flex-direction: column;
    }
    
    .message-bot {
        margin-right: 0;
    }
    
    .message-user {
        margin-left: 0;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--t2-dark);
    font-size: 22px;
}

@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 20px;
        max-height: 95vh;
    }
    
    .modal-content h3 {
        font-size: 18px;
    }
}

/* Select2 Custom Styling - Purple/Blue Gradient Theme */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: auto;
    min-height: 33px;
    border: 1px solid var(--t2-border);
    border-radius: 6px;
    padding: 7px 10px;
    background: white;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 13px;
}

.select2-container--default .select2-selection--single:hover {
    border-color: var(--t2-purple);
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--t2-purple);
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
    outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    line-height: 19px;
    padding-left: 0;
    padding-right: 0;
    font-size: 13px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-secondary);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 31px;
    position: absolute;
    top: 1px;
    right: 6px;
    width: 18px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--t2-purple) transparent transparent transparent;
    border-width: 6px 5px 0 5px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--t2-purple) transparent;
    border-width: 0 5px 6px 5px;
}

.select2-dropdown {
    border: 1px solid var(--t2-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.select2-search--dropdown {
    padding: 8px;
    background: var(--t2-light-gray);
    border-bottom: 1px solid var(--t2-border);
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--t2-border);
    border-radius: 6px;
    padding: 8px 12px;
    outline: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--t2-purple);
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
}

.select2-results__option {
    padding: 10px 12px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.select2-results__option--highlighted {
    background: linear-gradient(135deg, var(--t2-purple) 0%, var(--t2-sky) 100%) !important;
    color: white !important;
}

.select2-results__option[aria-selected=true] {
    background: var(--t2-light-gray);
    color: var(--t2-purple);
    font-weight: 500;
}

.select2-results__option--selectable {
    cursor: pointer;
}

.select2-container--default .select2-results__option--disabled {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Filter Bar Styles */
.filter-bar {
    background: white;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 18px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0;
}

.filter-search-input,
.filter-select {
    padding: 7px 10px;
    border: 1px solid var(--t2-border);
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.filter-search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--t2-purple);
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--t2-border);
}

.filter-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.filter-count strong {
    color: var(--t2-purple);
    font-weight: 600;
}

.btn-clear-filters {
    background: var(--t2-light-gray);
    color: var(--text-primary);
    border: 1px solid var(--t2-border);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-filters:hover {
    background: var(--t2-purple);
    color: white;
    border-color: var(--t2-purple);
}

.btn-clear-filters:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-search-filters {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.btn-search-filters:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-search-filters:active {
    transform: translateY(0);
}

/* Active Filter Badges */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--t2-purple) 0%, var(--t2-sky) 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.filter-badge-remove {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.filter-badge-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile Responsive Filters */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .btn-clear-filters {
        width: 100%;
    }
}
