/* ========================================
   منصة اعتماد — الأنماط الرئيسية
   Taibah University Brand Identity
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════
   CSS Custom Properties
   ═══════════════════════════════════════ */
:root {
    /* Primary Colors */
    --tu-green: #0A8E6E;
    --tu-green-dark: #077a5e;
    --tu-green-light: rgba(10, 142, 110, 0.12);
    --tu-green-lighter: rgba(10, 142, 110, 0.06);
    --tu-blue: #4056E3;
    --tu-blue-dark: #3348c7;
    --tu-blue-light: rgba(64, 86, 227, 0.12);
    --tu-cyan: #00AEDA;
    --tu-cyan-dark: #0098bf;
    --tu-cyan-light: rgba(0, 174, 218, 0.12);

    /* Secondary Colors */
    --tu-pink: #FFD1DC;
    --tu-yellow: #E5CA03;
    --tu-yellow-light: rgba(229, 202, 3, 0.15);
    --tu-turquoise: #90CDC0;

    /* Accent / Background Colors */
    --tu-navy: #111144;
    --tu-navy-light: #1a1a5c;
    --tu-light-gray: #F2F2F2;
    --tu-medium-gray: #E0E0E0;
    --tu-dark-gray: #6B7280;
    --tu-white: #FFFFFF;

    /* Status Colors */
    --status-not-started: #9CA3AF;
    --status-not-submitted: #EF4444;
    --status-submitted: #3B82F6;
    --status-ai-verified: #8B5CF6;
    --status-awaiting-assign: #F59E0B;
    --status-under-review: #F97316;
    --status-needs-completion: #DC2626;
    --status-resubmitted: #60A5FA;
    --status-accepted: #10B981;
    --status-accepted-notes: #059669;
    --status-rejected: #991B1B;
    --status-late: #E11D48;
    --status-archived: #111144;

    /* Font */
    --tu-font: 'Alexandria', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(17, 17, 68, 0.06);
    --shadow-md: 0 4px 12px rgba(17, 17, 68, 0.08);
    --shadow-lg: 0 8px 24px rgba(17, 17, 68, 0.12);
    --shadow-xl: 0 12px 36px rgba(17, 17, 68, 0.16);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* ═══════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl;
    scroll-behavior: smooth;
}

body {
    font-family: var(--tu-font);
    font-size: 14px;
    color: var(--tu-navy);
    background-color: var(--tu-light-gray);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.875rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 500; }

a {
    color: var(--tu-green);
    text-decoration: none;
    transition: color var(--transition-normal);
}
a:hover { color: var(--tu-blue); }

img { max-width: 100%; }

/* ═══════════════════════════════════════
   Pattern Bar
   ═══════════════════════════════════════ */
.tu-pattern-bar {
    height: 5px;
    background: linear-gradient(to left, var(--tu-green), var(--tu-blue), var(--tu-cyan), var(--tu-green));
    background-size: 300% 100%;
    animation: patternShift 8s ease infinite;
    position: relative;
    z-index: 100;
}

@keyframes patternShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ═══════════════════════════════════════
   Login Screen
   ═══════════════════════════════════════ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tu-navy) 0%, #1a1a5c 30%, var(--tu-blue) 70%, var(--tu-green) 100%);
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(0, 174, 218, 0.08) 0%, transparent 70%);
    animation: loginGlow 6s ease-in-out infinite alternate;
}

@keyframes loginGlow {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--tu-green), var(--tu-cyan));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(10, 142, 110, 0.3);
}

.login-logo h1 {
    font-size: 1.5rem;
    color: var(--tu-navy);
    margin-bottom: 4px;
}

.login-logo .subtitle {
    color: var(--tu-dark-gray);
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: var(--space-lg);
}

.login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--tu-navy);
    font-size: 0.9rem;
}

.login-university-name {
    font-size: 0.85rem;
    color: var(--tu-dark-gray);
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--tu-medium-gray);
}

/* ═══════════════════════════════════════
   App Shell
   ═══════════════════════════════════════ */
.app-shell {
    display: none;
    min-height: 100vh;
}

.app-shell.active {
    display: block;
}

/* ═══════════════════════════════════════
   Header
   ═══════════════════════════════════════ */
.tu-header {
    background-color: var(--tu-navy);
    color: var(--tu-white);
    padding: 0 var(--space-xl);
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 5px;
    z-index: 90;
    box-shadow: 0 2px 12px rgba(17, 17, 68, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-right .logo-mark {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--tu-green), var(--tu-cyan));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: white;
}

.header-right .brand-text h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tu-white);
    line-height: 1.3;
}

.header-right .brand-text span {
    font-size: 0.72rem;
    color: var(--tu-turquoise);
    font-weight: 400;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.header-notifications {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.header-notifications:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-notifications .badge {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--status-not-submitted);
    border-radius: var(--radius-full);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.header-user:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--tu-green), var(--tu-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: white;
}

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

.header-user .user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.header-user .user-role {
    font-size: 0.7rem;
    color: var(--tu-turquoise);
}

/* ═══════════════════════════════════════
   App Layout (Sidebar + Content)
   ═══════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height) - 5px);
}

/* ═══════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--tu-white);
    border-left: 1px solid var(--tu-medium-gray);
    position: sticky;
    top: calc(var(--header-height) + 5px);
    height: calc(100vh - var(--header-height) - 5px);
    overflow-y: auto;
    padding: var(--space-md) 0;
    flex-shrink: 0;
    transition: width var(--transition-normal);
}

.sidebar-section {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--tu-dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    margin: 2px var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--tu-navy);
    position: relative;
}

.sidebar-item:hover {
    background: var(--tu-green-lighter);
    color: var(--tu-green);
}

.sidebar-item.active {
    background: var(--tu-green-light);
    color: var(--tu-green);
    font-weight: 600;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--tu-green);
    border-radius: 0 3px 3px 0;
}

.sidebar-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-item .count-badge {
    margin-right: auto;
    margin-left: 0;
    background: var(--status-not-submitted);
    color: white;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.sidebar-divider {
    height: 1px;
    background: var(--tu-medium-gray);
    margin: var(--space-md) var(--space-lg);
}

/* ═══════════════════════════════════════
   Main Content
   ═══════════════════════════════════════ */
.main-content {
    flex: 1;
    padding: var(--space-xl);
    overflow-x: hidden;
    min-width: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.page-header h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.page-header .breadcrumb {
    font-size: 0.8rem;
    color: var(--tu-dark-gray);
}

.page-header .breadcrumb span {
    color: var(--tu-green);
}

/* ═══════════════════════════════════════
   Stats Cards (Dashboard)
   ═══════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--tu-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all var(--transition-normal);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 0 0 4px;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--tu-dark-gray);
    margin-top: 2px;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 500;
}

/* Stat card color variants */
.stat-card.green::before { background: var(--tu-green); }
.stat-card.green .stat-icon { background: var(--tu-green-light); color: var(--tu-green); }
.stat-card.green .stat-value { color: var(--tu-green); }

.stat-card.blue::before { background: var(--tu-blue); }
.stat-card.blue .stat-icon { background: var(--tu-blue-light); color: var(--tu-blue); }
.stat-card.blue .stat-value { color: var(--tu-blue); }

.stat-card.cyan::before { background: var(--tu-cyan); }
.stat-card.cyan .stat-icon { background: var(--tu-cyan-light); color: var(--tu-cyan); }
.stat-card.cyan .stat-value { color: var(--tu-cyan); }

.stat-card.red::before { background: var(--status-not-submitted); }
.stat-card.red .stat-icon { background: rgba(239, 68, 68, 0.1); color: var(--status-not-submitted); }
.stat-card.red .stat-value { color: var(--status-not-submitted); }

.stat-card.orange::before { background: var(--status-under-review); }
.stat-card.orange .stat-icon { background: rgba(249, 115, 22, 0.1); color: var(--status-under-review); }
.stat-card.orange .stat-value { color: var(--status-under-review); }

.stat-card.yellow::before { background: var(--status-awaiting-assign); }
.stat-card.yellow .stat-icon { background: var(--tu-yellow-light); color: #b8860b; }
.stat-card.yellow .stat-value { color: #b8860b; }

.stat-card.purple::before { background: var(--status-ai-verified); }
.stat-card.purple .stat-icon { background: rgba(139, 92, 246, 0.1); color: var(--status-ai-verified); }
.stat-card.purple .stat-value { color: var(--status-ai-verified); }

.stat-card.navy::before { background: var(--tu-navy); }
.stat-card.navy .stat-icon { background: rgba(17, 17, 68, 0.08); color: var(--tu-navy); }
.stat-card.navy .stat-value { color: var(--tu-navy); }

/* ═══════════════════════════════════════
   Cards
   ═══════════════════════════════════════ */
.tu-card {
    background: var(--tu-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all var(--transition-normal);
}

.tu-card:hover {
    box-shadow: var(--shadow-md);
}

.tu-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--tu-light-gray);
}

.tu-card-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.content-grid.three-cols {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ═══════════════════════════════════════
   Buttons
   ═══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--tu-font);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn i { width: 18px; height: 18px; }

.btn-primary {
    background: var(--tu-green);
    color: var(--tu-white);
}
.btn-primary:hover {
    background: var(--tu-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 142, 110, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--tu-green);
    border-color: var(--tu-green);
}
.btn-secondary:hover {
    background: var(--tu-green);
    color: var(--tu-white);
}

.btn-blue {
    background: var(--tu-blue);
    color: var(--tu-white);
}
.btn-blue:hover {
    background: var(--tu-blue-dark);
    box-shadow: 0 4px 12px rgba(64, 86, 227, 0.3);
}

.btn-danger {
    background: var(--status-not-submitted);
    color: var(--tu-white);
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--tu-dark-gray);
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--tu-light-gray);
    color: var(--tu-navy);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════
   Form Elements
   ═══════════════════════════════════════ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--tu-navy);
    font-size: 0.875rem;
}

.form-label .required {
    color: var(--status-not-submitted);
    margin-right: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--tu-medium-gray);
    border-radius: var(--radius-md);
    font-family: var(--tu-font);
    font-size: 0.9rem;
    color: var(--tu-navy);
    transition: all var(--transition-fast);
    direction: rtl;
    background: var(--tu-white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--tu-green);
    box-shadow: 0 0 0 3px var(--tu-green-light);
}

.form-input::placeholder {
    color: var(--tu-dark-gray);
    opacity: 0.6;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--tu-dark-gray);
    margin-top: 4px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--status-not-submitted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* ═══════════════════════════════════════
   Tables
   ═══════════════════════════════════════ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.tu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tu-table thead {
    background: linear-gradient(135deg, var(--tu-navy), var(--tu-navy-light));
}

.tu-table th {
    padding: 14px 16px;
    text-align: right;
    color: var(--tu-white);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.tu-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--tu-light-gray);
    vertical-align: middle;
}

.tu-table tbody tr {
    background: var(--tu-white);
    transition: background var(--transition-fast);
}

.tu-table tbody tr:hover {
    background: var(--tu-green-lighter);
}

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

/* ═══════════════════════════════════════
   Status Badges
   ═══════════════════════════════════════ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.status-badge.not-started { background: rgba(156, 163, 175, 0.15); color: #6B7280; }
.status-badge.not-started::before { background: #9CA3AF; }

.status-badge.not-submitted { background: rgba(239, 68, 68, 0.1); color: #DC2626; }
.status-badge.not-submitted::before { background: #EF4444; }

.status-badge.submitted { background: rgba(59, 130, 246, 0.1); color: #2563EB; }
.status-badge.submitted::before { background: #3B82F6; }

.status-badge.ai-verified { background: rgba(139, 92, 246, 0.1); color: #7C3AED; }
.status-badge.ai-verified::before { background: #8B5CF6; }

.status-badge.awaiting-assign { background: rgba(245, 158, 11, 0.1); color: #B45309; }
.status-badge.awaiting-assign::before { background: #F59E0B; }

.status-badge.under-review { background: rgba(249, 115, 22, 0.1); color: #C2410C; }
.status-badge.under-review::before { background: #F97316; }

.status-badge.needs-completion { background: rgba(220, 38, 38, 0.1); color: #B91C1C; }
.status-badge.needs-completion::before { background: #DC2626; }

.status-badge.resubmitted { background: rgba(96, 165, 250, 0.1); color: #1D4ED8; }
.status-badge.resubmitted::before { background: #60A5FA; }

.status-badge.accepted { background: rgba(16, 185, 129, 0.1); color: #047857; }
.status-badge.accepted::before { background: #10B981; }

.status-badge.accepted-notes { background: rgba(5, 150, 105, 0.1); color: #065F46; }
.status-badge.accepted-notes::before { background: #059669; }

.status-badge.rejected { background: rgba(153, 27, 27, 0.1); color: #991B1B; }
.status-badge.rejected::before { background: #991B1B; }

.status-badge.late { background: rgba(225, 29, 72, 0.1); color: #BE123C; }
.status-badge.late::before { background: #E11D48; animation: pulse 1.5s infinite; }

.status-badge.archived { background: rgba(17, 17, 68, 0.1); color: var(--tu-navy); }
.status-badge.archived::before { background: var(--tu-navy); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════
   Upload Zone
   ═══════════════════════════════════════ */
.upload-zone {
    border: 2px dashed var(--tu-medium-gray);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--tu-white);
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--tu-green);
    background: var(--tu-green-lighter);
}

.upload-zone .upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    background: var(--tu-green-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tu-green);
}

.upload-zone h3 {
    margin-bottom: var(--space-sm);
}

.upload-zone p {
    color: var(--tu-dark-gray);
    font-size: 0.875rem;
}

.upload-zone .file-types {
    margin-top: var(--space-md);
    font-size: 0.8rem;
    color: var(--tu-green);
    font-weight: 500;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ═══════════════════════════════════════
   AI Validation Result
   ═══════════════════════════════════════ */
.ai-result {
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-lg);
    border: 1px solid;
}

.ai-result.compatible {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
}

.ai-result.compatible-notes {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.3);
}

.ai-result.incomplete {
    background: rgba(249, 115, 22, 0.06);
    border-color: rgba(249, 115, 22, 0.3);
}

.ai-result.not-report {
    background: rgba(220, 38, 38, 0.06);
    border-color: rgba(220, 38, 38, 0.3);
}

.ai-result-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-weight: 700;
    font-size: 1rem;
}

.ai-checklist {
    list-style: none;
}

.ai-checklist li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
}

.ai-checklist li .check {
    color: var(--tu-green);
    font-weight: 700;
}

.ai-checklist li .missing {
    color: var(--status-not-submitted);
    font-weight: 700;
}

.ai-checklist li .warning {
    color: var(--status-awaiting-assign);
    font-weight: 700;
}

/* ═══════════════════════════════════════
   Progress Bar
   ═══════════════════════════════════════ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--tu-light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-slow);
    background: linear-gradient(90deg, var(--tu-green), var(--tu-cyan));
}

.progress-bar.small { height: 5px; }

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--tu-dark-gray);
    margin-top: 4px;
}

/* ═══════════════════════════════════════
   Modal
   ═══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 68, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--tu-white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--tu-light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.15rem;
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--tu-light-gray);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-start;
}

/* ═══════════════════════════════════════
   Alerts
   ═══════════════════════════════════════ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.alert-success {
    background: var(--tu-green-light);
    border-right: 4px solid var(--tu-green);
    color: var(--tu-green-dark);
}

.alert-info {
    background: var(--tu-blue-light);
    border-right: 4px solid var(--tu-blue);
    color: var(--tu-blue-dark);
}

.alert-warning {
    background: var(--tu-yellow-light);
    border-right: 4px solid var(--tu-yellow);
    color: #92400E;
}

.alert-error {
    background: rgba(220, 38, 38, 0.08);
    border-right: 4px solid var(--status-not-submitted);
    color: #991B1B;
}

/* ═══════════════════════════════════════
   Notifications List
   ═══════════════════════════════════════ */
.notification-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--tu-light-gray);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--tu-green-lighter);
}

.notification-item.unread {
    background: rgba(64, 86, 227, 0.04);
}

.notification-item .notif-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item .notif-content {
    flex: 1;
}

.notification-item .notif-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.notification-item .notif-message {
    font-size: 0.8rem;
    color: var(--tu-dark-gray);
}

.notification-item .notif-time {
    font-size: 0.7rem;
    color: var(--tu-dark-gray);
    margin-top: 4px;
}

/* ═══════════════════════════════════════
   Timeline (Audit Trail)
   ═══════════════════════════════════════ */
.timeline {
    position: relative;
    padding-right: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--tu-medium-gray);
}

.timeline-item {
    position: relative;
    padding: var(--space-md) 0;
    padding-right: var(--space-lg);
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -24px;
    top: 22px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--tu-green);
    border: 2px solid var(--tu-white);
}

.timeline-item .timeline-time {
    font-size: 0.75rem;
    color: var(--tu-dark-gray);
    margin-bottom: 4px;
}

.timeline-item .timeline-text {
    font-size: 0.875rem;
}

.timeline-item .timeline-user {
    font-weight: 600;
    color: var(--tu-green);
}

/* ═══════════════════════════════════════
   Tabs
   ═══════════════════════════════════════ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--tu-light-gray);
    margin-bottom: var(--space-lg);
    gap: 0;
    overflow-x: auto;
}

.tab-item {
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tu-dark-gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tab-item:hover {
    color: var(--tu-green);
}

.tab-item.active {
    color: var(--tu-green);
    border-bottom-color: var(--tu-green);
    font-weight: 600;
}

/* ═══════════════════════════════════════
   Filters Bar
   ═══════════════════════════════════════ */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--tu-white);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.filters-bar .form-select,
.filters-bar .form-input {
    width: auto;
    min-width: 160px;
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════
   Chart Containers
   ═══════════════════════════════════════ */
.chart-container {
    position: relative;
    margin: var(--space-md) 0;
}

/* Simple CSS bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
    height: 200px;
    padding: var(--space-md) 0;
}

.bar-chart .bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.bar-chart .bar {
    width: 100%;
    max-width: 48px;
    border-radius: 6px 6px 0 0;
    transition: height var(--transition-slow);
    min-height: 4px;
}

.bar-chart .bar-label {
    font-size: 0.7rem;
    color: var(--tu-dark-gray);
    text-align: center;
    writing-mode: initial;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-chart .bar-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tu-navy);
}

/* Donut chart (CSS only) */
.donut-chart {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-full);
    position: relative;
    margin: 0 auto;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 110px;
    height: 110px;
    background: var(--tu-white);
    border-radius: var(--radius-full);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-center .donut-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tu-navy);
}

.donut-center .donut-label {
    font-size: 0.7rem;
    color: var(--tu-dark-gray);
}

/* ═══════════════════════════════════════
   Report Detail
   ═══════════════════════════════════════ */
.report-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
}

.report-info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--tu-light-gray);
    font-size: 0.875rem;
}

.report-info-row .info-label {
    width: 140px;
    font-weight: 600;
    color: var(--tu-dark-gray);
    flex-shrink: 0;
}

.report-info-row .info-value {
    flex: 1;
}

/* Comment / Decision Card */
.comment-card {
    background: var(--tu-light-gray);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
}

.comment-card .comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-size: 0.8rem;
}

.comment-card .comment-author {
    font-weight: 600;
    color: var(--tu-green);
}

.comment-card .comment-date {
    color: var(--tu-dark-gray);
}

.comment-card .comment-text {
    font-size: 0.875rem;
    line-height: 1.8;
}

/* ═══════════════════════════════════════
   Empty State
   ═══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--tu-dark-gray);
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: var(--tu-light-gray);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state h3 {
    color: var(--tu-navy);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 80px;
    left: var(--space-xl);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--tu-white);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 300px;
    animation: slideInLeft 0.3s ease;
    border-right: 4px solid var(--tu-green);
}

.toast.error { border-right-color: var(--status-not-submitted); }
.toast.warning { border-right-color: var(--tu-yellow); }

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════════════════════
   Department Progress Cards
   ═══════════════════════════════════════ */
.dept-progress-card {
    background: var(--tu-white);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dept-progress-card .dept-name {
    font-weight: 600;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
}

.dept-progress-card .dept-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--tu-dark-gray);
    margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════
   Quick Actions
   ═══════════════════════════════════════ */
.quick-actions {
    display: flex;
    gap: var(--space-sm);
}

.quick-actions .btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--tu-medium-gray);
    background: var(--tu-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--tu-dark-gray);
    transition: all var(--transition-fast);
}

.quick-actions .btn-icon:hover {
    border-color: var(--tu-green);
    color: var(--tu-green);
    background: var(--tu-green-lighter);
}

/* ═══════════════════════════════════════
   Notification Dropdown
   ═══════════════════════════════════════ */
.notif-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 380px;
    background: var(--tu-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 150;
    display: none;
    overflow: hidden;
    margin-top: 8px;
}

.notif-dropdown.open {
    display: block;
    animation: fadeIn 0.2s ease;
}

.notif-dropdown-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--tu-light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-dropdown-body {
    max-height: 400px;
    overflow-y: auto;
}

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

/* ═══════════════════════════════════════
   Footer
   ═══════════════════════════════════════ */
.tu-footer {
    background: var(--tu-navy);
    color: rgba(255, 255, 255, 0.6);
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
    font-size: 0.8rem;
}

.tu-footer a {
    color: var(--tu-turquoise);
}

/* ═══════════════════════════════════════
   Assignment Card
   ═══════════════════════════════════════ */
.assignment-card {
    background: var(--tu-white);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-fast);
}

.assignment-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--tu-green-light);
}

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

.assignment-card .assignment-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.assignment-card .assignment-info p {
    font-size: 0.8rem;
    color: var(--tu-dark-gray);
}

/* ═══════════════════════════════════════
   Tag / Label
   ═══════════════════════════════════════ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.tag-green { background: var(--tu-green-light); color: var(--tu-green); }
.tag-blue { background: var(--tu-blue-light); color: var(--tu-blue); }
.tag-cyan { background: var(--tu-cyan-light); color: var(--tu-cyan-dark); }
.tag-red { background: rgba(220, 38, 38, 0.1); color: #DC2626; }
.tag-yellow { background: var(--tu-yellow-light); color: #92400E; }

/* ═══════════════════════════════════════
   Search Box
   ═══════════════════════════════════════ */
.search-box {
    position: relative;
}

.search-box input {
    padding-right: 40px;
}

.search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tu-dark-gray);
}

/* ═══════════════════════════════════════
   Loading Spinner
   ═══════════════════════════════════════ */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tu-light-gray);
    border-top-color: var(--tu-green);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
}

/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .report-detail-grid {
        grid-template-columns: 1fr;
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        right: -280px;
        top: calc(var(--header-height) + 5px);
        height: calc(100vh - var(--header-height) - 5px);
        z-index: 95;
        width: 260px;
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-normal);
    }
    .sidebar.open {
        right: 0;
    }
    .main-content {
        padding: var(--space-md);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════
   Scrollbar Styling
   ═══════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(17, 17, 68, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(17, 17, 68, 0.3);
}

/* ═══════════════════════════════════════
   Utilities
   ═══════════════════════════════════════ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-green { color: var(--tu-green); }
.text-blue { color: var(--tu-blue); }
.text-red { color: var(--status-not-submitted); }
.text-gray { color: var(--tu-dark-gray); }
.text-navy { color: var(--tu-navy); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }
.hidden { display: none !important; }
.clickable { cursor: pointer; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Animation for page transitions */
.page-enter {
    animation: pageEnter 0.3s ease;
}

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