/* =========================================================
   TUITION MANAGEMENT SYSTEM — COMPACT MOBILE-FIRST CSS
   ========================================================= */

:root {
    /* Color Palette */
    --primary: #4f3679;
    --primary-hover: #392064;
    --primary-light: #eff6ff;
    
    --secondary: #475569;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #e11d48;
    --danger-light: #fff1f2;

    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #cbd5e1;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    /* Compact Spacing & Sizing */
    --nav-height: 56px;
    --header-height: 50px;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --card-shadow: none;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =========================================================
   GLOBAL: Remove box-shadow from all buttons and icon boxes
   ========================================================= */
.btn,
button,
a.btn,
[class*="btn-"],
.app-header .btn,
.app-header button {
    box-shadow: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: calc(var(--nav-height) + 16px);
}

body.auth-page {
    padding-bottom: 0;
    background-color: #f8fafc;
}

body.has-nav {
    padding-top: calc(var(--header-height) + 4px);
}

/* Base mobile container <= 480px optimized */
.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 12px;
}

.app-main-content {
    padding: 12px 0;
}

/* =========================================================
   HEADER & NAVBAR (Sleek Compact)
   ========================================================= */
.app-header {
    background: var(--bg-card);
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.app-logo {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
   BOTTOM NAVIGATION BAR (Ultra-Compact App Feel)
   ========================================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    width: 100%;
    height: var(--nav-height);
    gap: 3px;
    transition: color 0.15s ease;
}

.bottom-nav-item i {
    font-size: 1.15rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

/* =========================================================
   CARDS & COMMON UI ELEMENTS (Compact Padding)
   ========================================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Buttons (Sleek Compact: 38px height) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    gap: 6px;
}

.btn-sm {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
    background: var(--secondary);
    color: #ffffff;
}
.btn-secondary:hover { background: #334155; }

.btn-outline {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    background: var(--bg-main);
    border-color: #94a3b8;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-block {
    width: 100%;
}

/* Forms (Compact Inputs) */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.88rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Remove up/down arrows (spinners) from number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}


/* Flash Messages */
.flash-message {
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.flash-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #86efac;
}
.flash-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fca5a5;
}

/* =========================================================
   BOTTOM SHEET MODAL (More Options Menu)
   ========================================================= */
.more-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.more-modal-backdrop.active,
.more-modal-backdrop.show {
    display: block;
    opacity: 1;
}

.more-modal-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    background: var(--bg-card);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    z-index: 2001;
    padding: 18px 16px 28px 16px;
    box-shadow: none;
    transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 600px;
    margin: 0 auto;
}

.more-modal-backdrop.active .more-modal-sheet,
.more-modal-backdrop.show .more-modal-sheet {
    bottom: 0;
}

.more-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.more-modal-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.more-modal-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.more-modal-close:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.more-modal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.more-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.15s ease;
}

.more-modal-item i {
    width: 22px;
    font-size: 1.1rem;
    text-align: center;
    color: var(--primary);
}

.more-modal-item:hover {
    background: var(--bg-main);
}

.more-modal-item.item-danger {
    color: var(--danger);
}

.more-modal-item.item-danger i {
    color: var(--danger);
}

/* =========================================================
   TABLET & DESKTOP (@media queries >= 768px)
   ========================================================= */
@media (min-width: 768px) {
    body { font-size: 15px; }
    .app-container { max-width: 720px; }
}

@media (min-width: 1024px) {
    .app-container { max-width: 960px; }
}

/* =========================================================
   TOP PROGRESS BAR LOADER
   ========================================================= */
.top-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
    z-index: 101;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    pointer-events: none;
}

.top-loader.active {
    opacity: 1;
}
