:root {
    /* Brand Colors */
    --primary: #11366e;
    --secondary: #bba037;
    --tertiary: #eece37;
    --alternate: #e0e3e7;

    /* Text Colors */
    --text-primary: #14181b;
    --text-secondary: #57636c;
    --text-light: #ffffff;

    /* Background Colors */
    --bg-primary: #f1f4f8;
    --bg-secondary: #ffffff;
    --bg-sidebar: #11366e;

    /* Spacing - 8px base unit system */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    /* Standard Heights */
    --height-input: 40px;
    --height-button: 40px;
    --height-button-sm: 32px;
    --height-button-lg: 48px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    display: flex;
    min-height: 100vh;
}

/* Typography - Consistent Text Styling */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary);
    margin: 0;
}

h1 {
    font-size: 28px;
    margin-bottom: 16px;
}

h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

h4 {
    font-size: 18px;
    margin-bottom: 12px;
}

h5 {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

h6 {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

a:hover {
    color: #0d2b5a;
    text-decoration: underline;
}

small {
    font-size: 12px;
    color: var(--text-secondary);
}

strong,
b {
    font-weight: 600;
}

/* Form Section Headings */
.form-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--alternate);
}

.form-section h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    margin-top: 20px;
}

/* Text Utilities */
.text-xs {
    font-size: 12px;
}

.text-sm {
    font-size: 13px;
}

.text-base {
    font-size: 14px;
}

.text-lg {
    font-size: 16px;
}

.text-xl {
    font-size: 18px;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}


/* Layout */
.app-container {
    display: flex;
    width: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: width 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sidebar Components */
.sidebar-header {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 64px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--secondary);
}

.nav-links {
    padding: var(--spacing-md) 0;
    flex: 1;
    overflow-y: auto;
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-section-label {
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px var(--spacing-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: var(--spacing-md);
    font-size: 14px;
    min-height: 44px;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-left: 4px solid var(--secondary);
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Navbar */
.top-navbar {
    background-color: var(--bg-secondary);
    height: 64px;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Content Area */
.content-wrapper {
    padding: var(--spacing-lg);
    flex: 1;
}

/* Cards */
.card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.card-header {
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--alternate);
    padding-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

/* Buttons - Consistent Heights */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-md);
    height: var(--height-button);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    gap: var(--spacing-sm);
    white-space: nowrap;
    line-height: 1;
}

.btn-sm {
    height: var(--height-button-sm);
    padding: 0 12px;
    font-size: 13px;
}

.btn-lg {
    height: var(--height-button-lg);
    padding: 0 var(--spacing-lg);
    font-size: 15px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #0d2b5a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: #a38b2e;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background-color: #0891b2;
    color: var(--text-light);
}

.btn-info:hover {
    background-color: #0e7490;
}

.btn-danger {
    background-color: #dc2626;
    color: var(--text-light);
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-success {
    background-color: #16a34a;
    color: var(--text-light);
}

.btn-success:hover {
    background-color: #15803d;
}

/* Forms - Consistent Heights */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    height: var(--height-input);
    padding: 0 12px;
    border: 1px solid var(--alternate);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: all 0.2s ease;
}

textarea.form-control,
textarea {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17, 54, 110, 0.1);
}

.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Select Dropdowns */
select.form-control,
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2357636c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Checkboxes and Radio Buttons */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

/* Tables - Consistent Styling */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead th {
    background-color: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--alternate);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

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

.table-bordered {
    border: 1px solid var(--alternate);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--alternate);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Search and Filter Bar */
.search-bar {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    align-items: center;
}

.search-bar .form-control {
    flex: 1;
    max-width: 400px;
}

/* Action Buttons Container */
.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--alternate);
    margin-top: var(--spacing-lg);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    height: 24px;
}

.badge-admin {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-registrar {
    background: #fae8ff;
    color: #86198f;
}

.badge-accountant {
    background: #dbeafe;
    color: #1e40af;
}

.badge-admission_officer {
    background: #ffedd5;
    color: #9a3412;
}

.badge-teacher {
    background: #dcfce7;
    color: #166534;
}

.badge-parent {
    background: #f3f4f6;
    color: #374151;
}

.badge-student {
    background: #fef9c3;
    color: #854d0e;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background: #f1f5f9;
    color: #64748b;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
    font-size: 14px;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #16a34a;
    color: #166534;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #dc2626;
    color: #991b1b;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Utilities */
.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.ml-1 {
    margin-left: var(--spacing-sm);
}

.mr-1 {
    margin-right: var(--spacing-sm);
}

.p-1 {
    padding: var(--spacing-sm);
}

.p-2 {
    padding: var(--spacing-md);
}

.p-3 {
    padding: var(--spacing-lg);
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 80px;
}

.main-content.collapsed {
    margin-left: 80px;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item span:last-child {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: var(--spacing-md);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: var(--spacing-md);
}

.sidebar.collapsed .nav-icon {
    margin: 0;
    font-size: 1.2rem;
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-content h4 {
    margin-bottom: var(--spacing-md);
    color: var(--primary);
    font-size: 1.25rem;
}

/* List Group */
.list-group {
    display: flex;
    flex-direction: column;
}

.list-group-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    transition: background-color 0.2s;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item-action {
    cursor: pointer;
}

.list-group-item-action:hover {
    background-color: #f9fafb;
}

/* Pagination */
.pagination {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-lg);
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--alternate);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: var(--bg-primary);
    border-color: var(--primary);
}

.pagination .current {
    background-color: var(--primary);
    color: var(--text-light);
    border-color: var(--primary);
}

/* File Upload Wrapper */
.file-upload-wrapper {
    display: flex;
    flex-direction: column;
}

.file-upload-wrapper input[type="file"] {
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    padding: 0;
    border: none;
    background-color: transparent;
    height: auto;
}

.file-upload-wrapper input[type="file"]::file-selector-button {
    margin-right: 16px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--alternate);
    background-color: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-upload-wrapper input[type="file"]::file-selector-button:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}