@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #ec4899;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --white: #ffffff;
    --danger: #ef4444;
    
    /* Neomorphic / Glass tokens */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    /* Fluid animated gradient for the entire portal */
    background: linear-gradient(120deg, #f0f9ff, #e0e7ff, #fce7f3, #fdf4ff);
    background-size: 300% 300%;
    animation: gradientBG 15s ease infinite;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Background Geometry Objects - Floating Glass Orbs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 10s ease-in-out infinite alternate;
}
body::before {
    background: rgba(99, 102, 241, 0.2);
    width: 400px; height: 400px;
    top: -100px; left: -100px;
}
body::after {
    background: rgba(236, 72, 153, 0.2);
    width: 500px; height: 500px;
    bottom: -150px; right: -100px;
    animation-direction: alternate-reverse;
    animation-duration: 15s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.1); }
}

/* Auth Page specific override for a massive 'Wow' effect */
.auth-body {
    background: linear-gradient(135deg, #0f172a, #1e1b4b, #312e81, #000000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-body::before, .auth-body::after {
    filter: blur(90px);
    opacity: 0.6;
}
.auth-body::before { background: rgba(56, 189, 248, 0.3); }
.auth-body::after { background: rgba(167, 139, 250, 0.3); }

.auth-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 3.5rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    color: white;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.auth-header p { color: rgba(255,255,255,0.7); font-size: 0.95rem; }

.auth-container label { color: rgba(255,255,255,0.9); font-weight: 500; font-size: 0.85rem;}
.auth-container .form-control {
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important;
    border-radius: 14px;
}
.auth-container .form-control:focus {
    background: rgba(255,255,255,0.05) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3) !important;
}
.auth-container i { color: rgba(255,255,255,0.5); }
.auth-container .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border-radius: 14px;
    margin-top: 1.5rem;
    padding: 1rem;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}
.auth-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.6);
}

/* Forms & Inputs Dashboard */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid rgba(255,255,255,0.8);
    border-radius: 14px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    color: var(--dark);
    font-weight: 500;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: 100%;
    letter-spacing: 0.02em;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.4);
}

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

.sidebar {
    width: 270px;
    background: rgba(15, 23, 42, 0.85); /* Deep dark glass sidebar */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 10;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
    padding: 2.5rem 1.5rem;
    font-size: 1.6rem;
    font-weight: 800;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.02em;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-brand i {
    -webkit-text-fill-color: initial;
    color: #60a5fa;
    filter: drop-shadow(0 0 8px rgba(96,165,250,0.5));
}

.sidebar-nav {
    padding: 1.5rem 0;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: var(--transition);
    gap: 1.2rem;
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0.3rem 1rem;
    border-radius: 12px;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    box-shadow: inset 2px 0 0 0 #60a5fa;
}
.nav-link.active {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.15) 0%, transparent 100%);
    box-shadow: inset 4px 0 0 0 #60a5fa;
}
.nav-link.active i {
    color: #60a5fa;
    filter: drop-shadow(0 0 8px rgba(96,165,250,0.6));
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar-footer .nav-link {
    color: #fca5a5;
}
.sidebar-footer .nav-link:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: inset 4px 0 0 0 #ef4444;
}

.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 2.5rem 3.5rem;
    max-width: calc(100vw - 270px);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: rgba(255,255,255,0.4);
    padding: 1.2rem 2rem;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-weight: 700;
    color: var(--dark);
}
.user-avatar {
    width: 50px; height: 50px;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 8px 15px rgba(96, 165, 250, 0.4);
    transform: rotate(-5deg);
}

/* Glass Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    padding: 2.2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: linear-gradient(90deg, #60a5fa, #c084fc);
    opacity: 0; transition: var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px 0 rgba(31, 38, 135, 0.12);
    border: 1px solid #ffffff;
}
.card:hover::before { opacity: 1; }

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--dark);
    letter-spacing: -0.01em;
}
.card-title i {
    color: var(--primary);
    margin-right: 0.8rem;
    font-size: 1.4rem;
    background: rgba(79, 70, 229, 0.1);
    padding: 0.6rem;
    border-radius: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Stunning Glass Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 14px;
    background: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.5);
}
table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
th, td {
    padding: 1.2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
th {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(5px);
    font-weight: 800;
    color: var(--dark-light);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    position: sticky;
    top: 0;
}
tbody tr {
    transition: var(--transition);
}
tbody tr:hover {
    background: rgba(255,255,255,0.5);
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    z-index: 1;
    position: relative;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.badge-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.badge-primary { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.alert {
    padding: 1.2rem 1.8rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex; align-items: center; gap: 1.2rem;
    font-weight: 700;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.4);
}
.alert-danger { background: rgba(254, 226, 226, 0.85); color: #991b1b; }
.alert-success { background: rgba(209, 250, 229, 0.85); color: #065f46; }
.alert i { font-size: 1.4rem; }

/* Number input styling */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; margin: 0; 
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-wrapper { flex-direction: column; }
    
    .sidebar {
        width: 100%; height: 75px;
        bottom: 0; top: auto; flex-direction: row;
        border-right: none; border-top: 1px solid rgba(255,255,255,0.1);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.4);
        margin: 0;
    }
    .sidebar-brand { display: none; }
    .sidebar-nav { flex-direction: row; display: flex; width: 100%; padding: 0; flex: 1; }
    .sidebar-footer { padding: 0; display: flex; border-top: none; border-left: 1px solid rgba(255,255,255,0.1); flex: 0 0 auto; }
    
    .nav-link { 
        margin: 0; flex: 1; border-radius: 0;
        flex-direction: column; padding: 0.5rem; justify-content: center; gap: 0.4rem; 
        font-size: 0.75rem; text-align: center; font-weight: 700; 
    }
    .nav-link i { font-size: 1.3rem; }
    .sidebar-footer .nav-link { width: 85px; }

    .nav-link:hover, .nav-link.active {
        box-shadow: none;
        border-top: 4px solid #60a5fa;
        background: linear-gradient(180deg, rgba(96, 165, 250, 0.15) 0%, transparent 100%);
    }
    .nav-link.active i { transform: translateY(-2px) scale(1.1); filter: drop-shadow(0 0 6px #60a5fa); }

    .main-content { margin-left: 0; padding: 1.5rem; padding-bottom: 100px; max-width: 100vw; }
    
    .top-header { flex-direction: column; align-items: flex-start; gap: 1.5rem; border-radius: 18px; padding: 1.5rem; }
    .page-title { font-size: 1.8rem; }
    
    .auth-container { padding: 2.5rem 2rem; margin: 1rem; border-radius: 20px; }
    
    .card form[action=""] { flex-direction: column !important; align-items: stretch !important; }
    .card form[action=""] .btn { width: 100% !important; margin-top: 0.5rem; }
}

/* Formatted Printing */
@media print {
    body { background: white !important; }
    .sidebar, .top-header, .btn, form { display: none !important; }
    .main-content { margin: 0; padding: 0; max-width: 100%; }
    .card { box-shadow: none; border: none; background: white; backdrop-filter: none; padding: 0; }
    * { color: black !important; text-shadow: none !important; }
}
