/* 
   Custom CSS Framework for Academy System (Tailwind-like) 
   No External CDNs, completely standalone.
*/

:root {
    /* Color Palette */
    --bg-main: #f3f4f6; /* Gray 100 */
    --bg-card: #ffffff;
    --navy-900: #1e1b4b; /* Deep Navy Blue */
    --navy-800: #312e81;
    --navy-700: #4338ca;
    
    --slate-800: #1e293b;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    
    --emerald-500: #10b981; /* Success / Income */
    --emerald-600: #059669;
    
    --crimson-500: #ef4444; /* Danger / Expense */
    --crimson-600: #dc2626;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-white: #ffffff;
    
    --border-color: #e5e7eb;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
}

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

ul {
    list-style: none;
}

/* Typography Utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

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

/* Colors */
.text-white { color: var(--text-white); }
.text-navy { color: var(--navy-900); }
.text-slate { color: var(--slate-500); }
.text-emerald { color: var(--emerald-500); }
.text-crimson { color: var(--crimson-500); }

.bg-navy-900 { background-color: var(--navy-900); }
.bg-navy-800 { background-color: var(--navy-800); }
.bg-emerald { background-color: var(--emerald-500); }
.bg-crimson { background-color: var(--crimson-500); }
.bg-white { background-color: var(--bg-card); }
.bg-gray-100 { background-color: var(--bg-main); }

/* Layout & Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Spacing (Padding & Margin) */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.h-screen { height: 100vh; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Borders & Shadows */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

.border { border: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-t-4 { border-top: 4px solid var(--border-color); }
.border-l-4 { border-left: 4px solid var(--border-color); }

/* Custom borders */
.border-navy-700 { border-color: var(--navy-700) !important; }
.border-emerald-500 { border-color: var(--emerald-500) !important; }
.border-crimson-500 { border-color: var(--crimson-500) !important; }

/* Components */
.card {
    background-color: var(--bg-card);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    border-radius: 0.375rem;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--navy-900);
    color: var(--text-white);
}
.btn-primary:hover { background-color: var(--navy-800); }

.btn-success {
    background-color: var(--emerald-500);
    color: var(--text-white);
}
.btn-success:hover { background-color: var(--emerald-600); }

.btn-danger {
    background-color: var(--crimson-500);
    color: var(--text-white);
}
.btn-danger:hover { background-color: var(--crimson-600); }

.input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--bg-card);
    transition: border-color 0.2s;
}
.input:focus {
    outline: none;
    border-color: var(--navy-700);
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-800);
    margin-bottom: 0.25rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    background-color: var(--slate-200);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--slate-800);
}
td {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}
.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}
