/* TSD Tanzania Portal Modern Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary-dark: #213874;
    --primary-blue: #1A6AC3;
    --bg-light: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --radius-lg: 16px;
    --radius-md: 8px;
    
    --shadow-soft: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    /* Soft radial mesh gradient to simulate the airy feel */
    background-image: 
        radial-gradient(at 0% 0%, hsla(223,61%,30%,0.04) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(212,85%,45%,0.04) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.dashboard-wrapper {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.sidebar .logo img {
    max-width: 80%;
    margin-bottom: 10px;
}

.sidebar nav {
    padding: 20px 10px;
}

.sidebar nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text-main);
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.8);
    color: var(--primary-blue);
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.5);
    position: sticky;
    top: 0;
    z-index: 10;
}

.content {
    padding: 40px;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Glassmorphism Cards */
.card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* Typography Headers */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26, 106, 195, 0.1);
}

/* Modern Gradient Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: white !important;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(26, 106, 195, 0.3);
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(26, 106, 195, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: rgba(248, 250, 252, 0.5);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

tr:hover td {
    background: rgba(248, 250, 252, 0.8);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.badge-excellent { background: #dcfce7; color: #166534; }
.badge-verygood { background: #dbeafe; color: #1e40af; }
.badge-good { background: #fef9c3; color: #854d0e; }
.badge-fair { background: #ffedd5; color: #9a3412; }
.badge-poor { background: #fee2e2; color: #991b1b; }

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}
.alert-success { 
    background: rgba(220, 252, 231, 0.8); 
    color: #166534; 
    border-color: #bbf7d0; 
    backdrop-filter: blur(8px);
}
.alert-error { 
    background: rgba(254, 226, 226, 0.8); 
    color: #991b1b; 
    border-color: #fecaca; 
    backdrop-filter: blur(8px);
}

/* Public Page specific */
.public-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.public-header .logo h2 {
    color: var(--primary-dark);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}
.public-header nav a {
    color: var(--primary-dark);
    margin-left: 20px;
    font-weight: 600;
}
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: var(--white);
    text-align: center;
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
}

/* Soft gradient mesh over hero */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 { 
    color: white; 
    font-size: 3.5rem; 
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

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

/* Auth Pages Specific */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
}

/* Utility */
.text-right { text-align: right; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.mt-4 { margin-top: 20px; }
