/* 
   College Management System - Custom Styles
   Palette:
   #515661 (Text)
   #2e9f82 (Accent/Secondary)
   #68c170 (Success)
   #d6ec8c (Highlight)
   #66e1b4 (Mint)
   #006159 (Primary/Sidebar BG)
   #00796f (Hover)
   #009589 (Buttons)
   #93e4c1 (Light BG)
   #3baea0 (Info)
   #118a7e (Active)
   #1f6f78 (Dark/Border)
*/

:root {
    /* Layout Variables */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 60px;
    --topbar-height: 60px;

    /* Project Palette */
    --col-text: #515661;
    --col-accent: #2e9f82;
    --col-success: #68c170;
    --col-highlight: #d6ec8c;
    --col-mint: #66e1b4;
    --col-sidebar-bg: #006159;
    --col-hover: #00796f;
    --col-primary: #009589;
    --col-light-bg: #93e4c1;
    --col-info: #3baea0;
    --col-active: #118a7e;
    --col-dark: #1f6f78;

    /* Semantic Mappings */
    --primary-color: var(--col-sidebar-bg);
    --secondary-color: var(--col-accent);
    --accent-color: var(--col-mint);
    --text-dark: var(--col-text);
    --text-light: #ffffff;
}

body {
    background-color: #ffffff;
    color: var(--col-text);
    overflow-x: hidden;
    font-family: 'Outfit', sans-serif;
}

/* Urdu & Arabic Support */
.urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif !important;
    line-height: 2.2 !important;
    direction: rtl;
    text-align: right;
}

.arabic-text {
    font-family: 'Noto Sans Arabic', sans-serif !important;
    direction: rtl;
    text-align: right;
}

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

.ltr {
    direction: ltr;
    text-align: left;
}

/* Modern UI Utilities */
.glass-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.hover-scale:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--col-accent);
}

/* Micro-animations */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn:active {
    transform: translateY(0);
}

/* Global Focus Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--col-accent);
    box-shadow: 0 0 0 0.25rem rgba(46, 159, 130, 0.2);
    transform: translateY(-1px);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: #181a19;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--col-dark);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--col-dark);
    border-radius: 4px;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid var(--col-dark);
    background: var(--col-dark);
    display: flex;
    align-items: center;
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    width: 100%;
    color: #fff;
    text-decoration: none;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
}

.sidebar-brand i {
    margin-right: 10px;
    color: var(--col-mint);
    flex-shrink: 0;
}

.sidebar-brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-right: 10px;
    background: white;
    padding: 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-brand span {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu>li {
    border-bottom: 1px solid var(--col-dark);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 13.5px;
}

.sidebar-menu a:hover {
    background: var(--col-hover);
    color: #fff;
}

.sidebar-menu a.active {
    background: var(--col-active);
    color: #fff;
    border-left: 4px solid var(--col-mint);
}

.sidebar-menu a i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    color: var(--col-mint);
}

.sidebar.collapsed .sidebar-menu a span {
    display: none;
}

/* Submenu */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(31, 111, 120, 0.35);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu.show {
    max-height: 600px;
}

.submenu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.submenu li:last-child {
    border-bottom: none;
}

.submenu a {
    padding: 10px 20px 10px 52px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    transition: all 0.2s ease;
}

.submenu a:hover {
    color: #fff;
    background: var(--col-hover);
    padding-left: 56px;
}

.submenu a.active {
    color: var(--col-mint);
    background: rgba(17, 138, 126, 0.4);
    border-left: 3px solid var(--col-mint);
    padding-left: 49px;
    font-weight: 600;
}

.submenu a.active::before {
    content: '';
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--col-mint);
}

.sidebar.collapsed .submenu {
    display: none;
}

.sidebar-heading {
    padding: 15px 20px 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.sidebar.collapsed .sidebar-heading {
    display: none;
}

.menu-toggle-icon {
    float: right;
    transition: transform 0.3s;
}

.menu-toggle-icon.rotated {
    transform: rotate(90deg);
}

/* =========================================
   Top Bar Styles
   ========================================= */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--col-light-bg);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 999;
    transition: left 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar.collapsed~.main-wrapper .topbar {
    left: var(--sidebar-collapsed-width);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--col-text);
    margin-right: 15px;
}

.sidebar-toggle:hover {
    color: var(--col-primary);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* =========================================
   Main Content Styles
   ========================================= */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 20px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - var(--topbar-height));
    background-color: #ffffff;
}

.sidebar.collapsed~.main-wrapper .main-content,
.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* =========================================
   Login Page Styles
   ========================================= */
body.login-page {
    background: linear-gradient(-45deg, #006159, #009589, #2e9f82, #3baea0);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-y: auto !important;
}

/* Animated gradient background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating particles effect */
body.login-page::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: floatParticles 20s ease-in-out infinite;
}

@keyframes floatParticles {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.login-card {
    background: rgba(50, 172, 131, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    overflow: hidden;
    max-width: 440px;
    width: 100%;
    margin: 20px;
    animation: slideUp 0.6s ease-out;
    position: relative;
}

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

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

.login-header {
    background: linear-gradient(135deg, var(--col-primary) 0%, var(--col-secondary) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Animated shine effect on header */
.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.login-header i {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.login-header img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 15px;
    background: white;
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    animation: pulse 2s ease-in-out infinite;
}

.login-header h3 {
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.login-header p {
    opacity: 0.95;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.login-body {
    padding: 40px 35px;
}

.login-body .form-label {
    font-weight: 600;
    color: var(--col-text);
    margin-bottom: 8px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.login-body .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.login-body .form-control:focus {
    border-color: var(--col-secondary);
    box-shadow: 0 0 0 0.25rem rgba(46, 159, 130, 0.15);
    background-color: white;
    transform: translateY(-2px);
}

.login-body .form-control:hover:not(:focus) {
    border-color: #c0c0c0;
}

/* Enhanced input icons */
.login-body .form-label i {
    color: var(--col-secondary);
    margin-right: 6px;
}

/* Checkbox styling */
.login-body .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #d0d0d0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-body .form-check-input:checked {
    background-color: var(--col-secondary);
    border-color: var(--col-secondary);
}

.login-body .form-check-label {
    margin-left: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--col-text);
}

/* Enhanced login button */
.btn-login {
    background: linear-gradient(135deg, var(--col-primary) 0%, var(--col-secondary) 100%);
    border: none;
    color: white;
    padding: 14px;
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 149, 137, 0.3);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 159, 130, 0.5);
    color: white;
}

.btn-login:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46, 159, 130, 0.4);
}

.btn-login i {
    margin-right: 8px;
}

/* Alert styling */
.login-body .alert {
    border-radius: 10px;
    border: none;
    animation: slideDown 0.3s ease-out;
}

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

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

.login-body .alert-danger {
    background-color: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-card {
        margin: 15px;
        max-width: 100%;
    }

    .login-header {
        padding: 30px 20px;
    }

    .login-body {
        padding: 30px 25px;
    }

    .login-header h3 {
        font-size: 1.3rem;
    }
}

/* =========================================
   Public Layout Styles
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

.navbar {
    background-color: var(--primary-color);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--col-highlight) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--col-highlight);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.btn-public-login {
    background-color: var(--col-highlight);
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 30px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s;
}

.btn-public-login:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.hero-section {
    background: linear-gradient(rgba(0, 97, 89, 0.9), rgba(0, 97, 89, 0.8)), url('/images/college-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    margin-bottom: 50px;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--secondary-color);
}

.card {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.public-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.public-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    margin-bottom: 0.5rem;
}

.public-footer a:hover {
    color: var(--col-highlight);
}

.public-footer .footer-title {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* =========================================
   Public News & Gallery Styles
   ========================================= */
.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

.transition-all {
    transition: all 0.3s ease;
}

.object-fit-cover {
    object-fit: cover;
}

/* =========================================
   Dashboard Styles
   ========================================= */
:root {
    /* Mapping Dashboard Variables to Project Palette */
    --dash-primary: var(--col-text);
    --dash-secondary: var(--col-hover);
    --dash-accent: var(--col-accent);
    --dash-success: var(--col-success);
    --dash-warning: var(--col-info);
    /* Mapped to Info/Teal */
    --dash-danger: var(--col-sidebar-bg);
    /* Mapped to Dark Teal */
    --dash-light: var(--col-light-bg);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-container {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--col-light-bg);
    padding-bottom: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--col-sidebar-bg);
    margin: 0;
}

.page-subtitle {
    color: var(--col-text);
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    border-left: 4px solid var(--col-accent);
}

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

.stat-card.primary {
    border-left-color: var(--col-accent);
}

.stat-card.success {
    border-left-color: var(--col-success);
}

.stat-card.warning {
    border-left-color: var(--col-info);
}

.stat-card.danger {
    border-left-color: var(--col-sidebar-bg);
}

.stat-card.info {
    border-left-color: var(--col-mint);
}

.stat-card.dark {
    border-left-color: var(--col-text);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--col-sidebar-bg);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--col-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Cards */
.chart-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--col-hover);
    margin: 0;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container-large {
    height: 400px;
}

/* Tables */
.table-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--col-light-bg);
    background-color: white;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--col-light-bg);
    color: var(--col-hover);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--col-light-bg);
}

.table td {
    vertical-align: middle;
    color: var(--col-text);
}

.badge-custom {
    padding: 0.5em 0.8em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.badge-active {
    background-color: var(--col-light-bg);
    color: var(--col-success);
}

.badge-graduated {
    background-color: #eaf2f8;
    color: var(--col-accent);
}

.badge-dropped {
    background-color: #fdedec;
    color: var(--col-sidebar-bg);
}

.badge-class {
    background-color: #f4f6f6;
    color: var(--col-text);
    border: 1px solid #bdc3c7;
}

/* =========================================
   Footer Styles
   ========================================= */
.dashboard-footer {
    margin-left: var(--sidebar-width);
    margin-top: 0;
    padding: 15px 20px;
    text-align: center;
    background-color: #fff;
    color: var(--col-text);
    border-top: 1px solid var(--col-light-bg);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed~.main-wrapper .dashboard-footer {
    margin-left: var(--sidebar-collapsed-width);
}

/* =========================================
   Responsive Styles
   ========================================= */

/* Lock body scroll when mobile sidebar is open */
body.sidebar-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    }

    /* Better sidebar brand on mobile */
    .sidebar-brand {
        padding: 12px 15px;
        font-size: 16px;
    }

    .sidebar-brand #mobileSidebarClose {
        opacity: 1;
        padding: 4px 8px;
    }

    /* Larger touch targets on mobile */
    .sidebar-menu a {
        padding: 14px 20px;
        font-size: 15px;
    }

    .submenu a {
        padding: 12px 20px 12px 52px;
        font-size: 14px;
    }

    .submenu a.active {
        padding-left: 49px;
    }

    .topbar {
        left: 0 !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 12px;
    }

    .dashboard-footer {
        margin-left: 0 !important;
    }

    /* Overlay for mobile drawer */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    /* Form responsiveness */
    .card-body {
        padding: 1rem !important;
    }

    /* Better table scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Stack stat cards */
    .stat-card {
        margin-bottom: 1rem;
    }

    /* Dashboard container padding */
    .dashboard-container {
        padding: 1rem;
    }

    /* Page header mobile */
    .page-title {
        font-size: 1.35rem;
    }

    /* Topbar adjustments */
    .topbar {
        padding: 0 12px;
    }

    .topbar-right {
        gap: 8px;
    }

    .topbar-right .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .topbar-right .img-profile {
        width: 32px !important;
        height: 32px !important;
    }

    .topbar-right span.text-muted {
        display: none;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .sidebar {
        width: 260px;
    }

    .main-content {
        padding: 8px;
    }

    .dashboard-container {
        padding: 0.75rem;
    }

    .chart-container {
        height: 220px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.2rem;
    }
}

/* =========================================
   Component Styles
   ========================================= */
.card {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Fix pagination arrow size */
.pagination .page-link {
    font-size: 1rem !important;
    padding: 0.375rem 0.75rem !important;
}

.pagination .page-link svg {
    width: 1rem !important;
    height: 1rem !important;
}

/* =========================================
   Seating Plan Print Styles
   ========================================= */
.seating-plan-page {
    font-family: Arial, sans-serif;
    font-size: 11px;
    background-color: white !important;
}

@media print {
    .seating-plan-page .no-print {
        display: none !important;
    }

    .seating-plan-page .page-break {
        page-break-after: always;
    }

    .seating-plan-page {
        font-size: 10pt;
    }
}

.seating-plan-page .page-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
    color: black;
}

.seating-plan-page .page-number {
    font-size: 12px;
    float: right;
}

.seating-plan-page .room-section {
    margin-bottom: 15px;
    border: 2px solid #000;
    padding: 8px;
    page-break-inside: avoid;
}

.seating-plan-page .room-title {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    background: #000;
    color: #fff;
    padding: 4px;
}

.seating-plan-page .roll-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    margin-bottom: 5px;
}

.seating-plan-page .roll-cell {
    border: 1px solid #333;
    padding: 3px 2px;
    text-align: center;
    font-weight: bold;
    font-size: 11px;
    background: #f8f9fa;
    line-height: 1.2;
}

.seating-plan-page .student-name {
    font-size: 6px;
    font-weight: normal;
    color: #555;
    margin-top: 1px;
    line-height: 1;
}

.seating-plan-page .year-divider {
    grid-column: 1 / -1;
    background: #6c757d;
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 3px;
    margin: 5px 0;
    font-size: 11px;
}

.seating-plan-page .room-stats {
    text-align: right;
    font-size: 10px;
    margin-top: 5px;
    font-weight: bold;
}

/* =========================================
   ID Card Print Styles
   ========================================= */
.id-card-page {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    font-family: 'Outfit', sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.id-card-page .page {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
    margin: 10mm auto;
    background: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5mm;
    box-sizing: border-box;
}

.id-card-page .id-card {
    width: 85.6mm;
    height: 54mm;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    background: white;
    page-break-inside: avoid;
}

.id-card-page .id-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 100%;
    background: var(--col-primary);
    clip-path: polygon(0 0, 100% 0, 65% 100%, 0% 100%);
    z-index: 0;
}

.id-card-page .id-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40%;
    height: 40%;
    background: var(--col-accent);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    opacity: 0.2;
    z-index: 0;
}

.id-card-page .header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: 3mm 3mm 0 3mm;
}

.id-card-page .logo {
    width: 12mm;
    height: 12mm;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 2mm;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.id-card-page .logo img {
    width: 8mm;
}

.id-card-page .college-name {
    flex: 1;
}

.id-card-page .college-name h1 {
    margin: 0;
    font-size: 9pt;
    color: #000;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
}

.id-card-page .college-name span {
    font-size: 6pt;
    color: var(--col-accent);
    font-weight: 600;
}

.id-card-page .content {
    position: relative;
    z-index: 1;
    display: flex;
    padding: 3mm;
    margin-top: 1mm;
}

.id-card-page .photo-area {
    width: 22mm;
    margin-right: 3mm;
    text-align: center;
}

.id-card-page .photo-box {
    width: 22mm;
    height: 26mm;
    border: 2px solid var(--col-accent);
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
    margin-bottom: 1mm;
}

.id-card-page .photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.id-card-page .student-id {
    font-size: 7pt;
    font-weight: bold;
    color: var(--col-primary);
    background: #eef2f7;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
}

.id-card-page .details-area {
    flex: 1;
}

.id-card-page .student-name {
    margin: 0 0 1mm 0;
    font-size: 11pt;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    line-height: 1.1;
}

.id-card-page .info-row {
    display: flex;
    margin-bottom: 1mm;
    font-size: 7.5pt;
    line-height: 1.2;
}

.id-card-page .label {
    width: 18mm;
    color: #666;
    font-weight: 500;
}

.id-card-page .value {
    flex: 1;
    color: #000;
    font-weight: 600;
}

.id-card-page .footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6mm;
    background: var(--col-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3mm;
    box-sizing: border-box;
    color: white;
    font-size: 6pt;
    z-index: 1;
}

.id-card-page .principal-sign {
    position: absolute;
    bottom: 8mm;
    right: 3mm;
    text-align: center;
    width: 25mm;
}

.id-card-page .principal-sign img {
    height: 6mm;
    display: block;
    margin: 0 auto 1mm auto;
}

.id-card-page .principal-sign .name {
    font-size: 5.5pt;
    color: #000;
    font-weight: 600;
    display: block;
    margin-bottom: 1px;
}

.id-card-page .principal-sign span {
    font-size: 5pt;
    color: #666;
    border-top: 1px solid #999;
    display: block;
    width: 100%;
    padding-top: 1px;
}

.id-card-page .barcode-area {
    position: absolute;
    bottom: 1mm;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.id-card-page .barcode-area img {
    width: 25mm;
    height: auto;
    display: block;
    margin: 0 auto;
    transform: scaleY(0.4);
}

.id-card-page .barcode-area span {
    font-size: 5pt;
    color: #333;
    display: block;
    margin-top: 1px;
}

@media print {
    .id-card-page .no-print {
        display: none !important;
    }

    .id-card-page {
        margin: 0;
        padding: 0;
        background: white;
    }

    .id-card-page .page {
        margin: 0;
        padding: 0;
        box-shadow: none;
        width: auto;
        min-height: auto;
    }
}

/* =========================================
   Report Print Utilities
   ========================================= */
@media print {
    .print-hidden-body * {
        visibility: hidden;
    }

    .print-visible-area,
    .print-visible-area * {
        visibility: visible;
    }

    .print-visible-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .print-hide-ui .btn,
    .print-hide-ui .d-flex-ui,
    .print-hide-ui nav,
    .print-hide-ui footer,
    .print-hide-ui .card-shadow {
        display: none !important;
    }

    .print-clean-card {
        border: none !important;
        box-shadow: none !important;
    }

    .print-table-bordered {
        width: 100% !important;
        border: 1px solid #000 !important;
    }

    .print-badge {
        border: 1px solid #000;
        color: #000 !important;
        background: none !important;
        font-weight: normal;
    }
}

/* Bootstrap Overrides */
/* Only override buttons and specific elements, not utility classes that are used for icons */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

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

/* Override bg-primary only for sections, not for icon containers */
section.bg-primary,
.page-header.bg-primary,
.hero-section.bg-primary {
    background-color: var(--primary-color) !important;
}