/* =====================================================
   Shiv Shakti Public School - Design System
   Modern, Professional School Management CSS
   ===================================================== */

/* CSS Variables - Design Tokens */
:root {
    /* Primary Colors - Red */
    --primary-dark: #7f1d1d;
    --primary: #dc2626;
    --primary-light: #ef4444;

    /* Accent Colors */
    --success: #22c55e;
    --success-light: #4ade80;
    --warning: #d97706;
    --warning-light: #f59e0b;
    --danger: #b91c1c;
    --danger-light: #dc2626;
    --info: #e11d48;

    /* Gold Accent */
    --gold: #d97706;
    --gold-light: #f59e0b;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7f1d1d 0%, #dc2626 100%);
    --gradient-success: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    --gradient-warning: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glass: 0 8px 32px 0 rgba(127, 29, 29, 0.2);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

/* =====================================================
   Layout Components
   ===================================================== */

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-brand h2 {
    color: var(--white);
    font-size: 1.25rem;
}

.sidebar-brand .brand-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sidebar-nav {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.nav-link .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin: 1.5rem 0 0.75rem;
    padding-left: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.page-title {
    font-size: 1.75rem;
    color: var(--gray-900);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

/* =====================================================
   Card Components
   ===================================================== */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.stat-card.revenue::before {
    background: var(--success);
}

.stat-card.expense::before {
    background: var(--danger);
}

.stat-card.income::before {
    background: var(--primary);
}

.stat-card.info::before {
    background: var(--info);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-card.revenue .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card.expense .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card.income .stat-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-card.info .stat-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-content .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-content .stat-change {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Glass Card Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-glass);
}

/* =====================================================
   Table Styles
   ===================================================== */

.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

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

.table th,
.table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.table tbody tr:hover {
    background: var(--gray-50);
}

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

/* =====================================================
   Button Styles
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.5);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--white);
}

.btn-warning {
    background: var(--gradient-warning);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* =====================================================
   Form Styles
   ===================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

select.form-input {
    cursor: pointer;
}

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

/* =====================================================
   Badge & Status Styles
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

/* =====================================================
   Alert / Message Styles
   ===================================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success);
    color: #065f46;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-left: 4px solid var(--info);
    color: #0e7490;
}

/* =====================================================
   Login Page Styles
   ===================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2.5rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

.login-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.login-links a {
    color: var(--primary);
    font-weight: 500;
}

/* =====================================================
   Home Page Styles
   ===================================================== */

.home-page {
    min-height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    flex-direction: column;
}

.home-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--white);
}

.home-logo .logo-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.home-logo h1 {
    color: var(--white);
    font-size: 1.5rem;
}

.home-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.home-content {
    text-align: center;
    color: var(--white);
    max-width: 700px;
}

.home-content h2 {
    font-size: 3rem;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.home-content p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
}

.login-options {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.login-option-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 180px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.login-option-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-8px);
}

.login-option-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-option-card h3 {
    color: var(--white);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.login-option-card p {
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0;
}

.home-footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* =====================================================
   Grid Layouts
   ===================================================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* =====================================================
   Utility Classes
   ===================================================== */

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

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

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

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

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

.text-muted {
    color: var(--gray-500);
}

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

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.rounded {
    border-radius: var(--radius);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.hidden {
    display: none;
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

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

    .login-options {
        flex-direction: column;
        align-items: center;
    }

    .login-option-card {
        width: 100%;
        max-width: 250px;
    }

    .home-content h2 {
        font-size: 2rem;
    }
}

/* =====================================================
   Animations
   ===================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease;
}

.animate-slideUp {
    animation: slideUp 0.5s ease;
}

/* =====================================================
   Print Styles
   ===================================================== */

@media print {

    .sidebar,
    .btn,
    .header-actions {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--gray-200);
    }
}