/* Tooltip Styles */
[title] {
  position: relative;
}
.sidebar.collapsed .menu-item[title]:hover::after,
.sidebar.collapsed .logout[title]:hover::after,
.sidebar.collapsed .collapse-toggle[title]:hover::after,
.sidebar.collapsed .sidebar-toggle-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%; /* Position to the right of the element */
  top: 50%;
  transform: translateY(-50%);
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
  margin-left: 10px;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
@media (max-width: 1024px) {
    .sidebar.collapsed .menu-item[title]:hover::after,
    .sidebar.collapsed .logout[title]:hover::after,
    .sidebar.collapsed .collapse-toggle[title]:hover::after,
    .sidebar.collapsed .sidebar-toggle-btn[title]:hover::after {
        display: none; /* Hide tooltips on mobile/tablet where touch is primary */
    }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40; /* Below sidebar (50) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Variables */
:root {
    font-size: 12px; /* User requested size 12 fonts */
    /* Aesthetic Pastel Palette */
    --primary: #d8b4fe;       /* Pastel Purple */
    --primary-hover: #c084fc; /* Slightly deeper purple */
    --secondary: #f9a8d4;     /* Pastel Pink */
    --success: #86efac;       /* Pastel Green */
    --warning: #fde047;       /* Pastel Yellow */
    --danger: #fda4af;        /* Pastel Red */
    --dark: #000000;          /* Black Text */
    --light: #fff5f7;         /* Very Light Pinkish White Background */
    --white: #ffffff;
    --border: #f0abfc;        /* Soft Pink-Purple Border */
    --text-main: #000000;     /* Black Text */
    --text-muted: #000000;    /* Black Text */
    
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;    /* Slightly taller for aesthetics */
    
    /* Soft Shadows */
    --shadow-sm: 0 2px 4px rgba(232, 121, 249, 0.1);
    --shadow: 0 4px 6px -1px rgba(232, 121, 249, 0.1), 0 2px 4px -1px rgba(232, 121, 249, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(192, 132, 252, 0.2), 0 4px 6px -2px rgba(192, 132, 252, 0.1);
}

/* Layouts with sidebars (internal to content) */
.layout-sidebar-right {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .layout-sidebar-right {
        grid-template-columns: 1fr;
    }
}

/* Base */
body {
    overflow-x: hidden; /* Prevent horizontal scrollbar when content is pushed */
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif; /* Poppins is cuter */
    background-color: #fdf2f8; /* Pink-50 */
    background-image: linear-gradient(135deg, #fdf2f8 0%, #f3e8ff 100%); /* Subtle Pink to Purple Gradient */
    background-attachment: fixed;
    color: #000000 !important;
    margin: 0;
}

* {
    color: inherit;
}

h1, h2, h3, h4, h5, h6, p, span, div, td, th, label, input, select, textarea, a {
    color: #000000;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
    transition: transform 0.3s ease; /* Add transition for smooth push */
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #fff0f5 0%, #f3e8ff 100%); /* Cute Gradient */
    border-right: 1px solid rgba(240, 171, 252, 0.3);
    box-shadow: 4px 0 25px rgba(192, 132, 252, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s ease; /* Bouncy transition */
}

.sidebar-top {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(240, 171, 252, 0.2);
    transition: padding 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--dark);
    text-decoration: none;
    cursor: pointer;
}

.brand-logo {
    height: 50px; /* Cute size */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); /* Soft shadow */
}

.brand-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-toggle-btn:hover {
    background-color: var(--light);
    color: var(--dark);
}

.sidebar.collapsed .sidebar-toggle-btn {
    justify-content: center;
    width: auto;
}

.sidebar-user {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s ease;
}

.sidebar-profile-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-thumb.profile-lg {
    width: 120px;
    height: 120px;
}

.sidebar-profile-thumb-placeholder {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background-color: #e0e7ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

/* Utility Classes for Object Fit and Sizing */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.h-auto { height: auto !important; }
.w-8 { width: 2rem !important; }
.h-8 { height: 2rem !important; }
.w-10 { width: 2.5rem !important; }
.h-10 { height: 2.5rem !important; }
.w-12 { width: 3rem !important; }
.h-12 { height: 3rem !important; }
.w-14 { width: 3.5rem !important; }
.h-14 { height: 3.5rem !important; }
.w-16 { width: 4rem !important; }
.h-16 { height: 4rem !important; }
.w-20 { width: 5rem !important; }
.h-20 { height: 5rem !important; }
.w-24 { width: 6rem !important; }
.h-24 { height: 6rem !important; }
.w-32 { width: 8rem !important; }
.object-cover { object-fit: cover !important; }
.object-contain { object-fit: contain !important; }
.rounded-full { border-radius: 9999px !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-xl { border-radius: 0.75rem !important; }
.rounded-2xl { border-radius: 1rem !important; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important; }

.sidebar-user-info {
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.2s ease;
    white-space: nowrap;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-company {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.2rem 0.75rem; /* Floating aesthetic */
    border-radius: 1rem; /* Rounded corners */
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.menu-item:hover {
    background-color: var(--white);
    color: var(--text-main);
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(216, 180, 254, 0.5);
}

.menu-item .icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item .label {
    transition: opacity 0.2s ease;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
    align-items: center;
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-top {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 1.5rem 0;
}

.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .menu-item .label,
.sidebar.collapsed .brand-text {
    display: none;
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .menu-item .icon {
    margin: 0;
}

.sidebar.collapsed .sidebar-toggle-btn span {
    display: none;
}

.sidebar.collapsed .sidebar-toggle-btn svg {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Main Content */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Content adjustment when sidebar collapsed */
.sidebar.collapsed + .content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.welcome {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.subtitle {
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

.time-badge {
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.85);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Glass Card Utility */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    border-radius: 1.25rem;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.25rem; /* 20px for aesthetic look */
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 1.25rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.85);
}

/* Responsive Table Wrap */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 1rem;
    position: relative;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    word-break: break-word;
    hyphens: auto;
}

th {
    background-color: var(--light);
    color: var(--dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #faf5ff; /* Very light purple hover */
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
}

/* Utility / Tailwind-ish classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.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)); }
.md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-gray-500 { color: var(--text-muted); }
.text-gray-400 { color: #000000; }
.text-gray-900 { color: var(--dark); }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.object-cover { object-fit: cover; }
.border { border-width: 1px; border-color: var(--border); }
.border-b { border-bottom-width: 1px; border-color: var(--border); }
.border-gray-200 { border-color: #e5e7eb; }
.p-4 { padding: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.w-full { width: 100%; }
.w-8 { width: 2rem; }
.h-1\.5 { height: 0.375rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }
.bg-gray-50 { background-color: var(--light); }
.bg-gray-200 { background-color: #e5e7eb; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.pb-1 { padding-bottom: 0.25rem; }
.tracking-wide { letter-spacing: 0.025em; }

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.input, .textarea, .select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background-color: #ffffff;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

.input:focus, .textarea:focus, .select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--light);
}

.input::placeholder, .textarea::placeholder {
    color: #000000;
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Input Customization */
input[type="file"] {
    padding: 0.5rem;
    background: #faf5ff;
}

input[type="file"]::file-selector-button {
    margin-right: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-hover);
}

/* Controls Row */
.controls-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Stat Card Mini */
.stat-card-mini {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s;
}
.stat-card-mini:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}
.stat-card-mini .num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-card-mini .muted-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* File Badge */
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--light);
    color: var(--primary);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.file-badge:hover {
    background-color: var(--white);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    justify-content: center;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(192, 132, 252, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(192, 132, 252, 0.4);
}
.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-main);
}
.btn-outline:hover {
    background-color: var(--light);
    border-color: var(--primary);
}
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}
.btn-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
}

/* Loader */
.loader-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--white); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s;
}
.loader-logo { width: 64px; height: 64px; object-fit: contain; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Global Image Fixes */
img {
    max-width: 100%;
    height: auto;
}

.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

.avatar, .profile-pic, .user-photo {
    object-fit: cover;
}

.logo, .signature-img {
    object-fit: contain;
}

/* Mobile Topbar */
.topbar {
    display: none;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background-color: var(--light);
}

.topbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

@media (max-width: 1024px) {
    .topbar {
        display: flex;
    }
    .sidebar { 
        transform: translateX(-100%);
        box-shadow: var(--shadow-md); 
        position: fixed; /* Ensure it stays fixed during push */
    }
    .sidebar.open { 
        transform: translateX(0); 
    }
    .content { 
        margin-left: 0; 
        width: 100%; 
        padding: 1rem; 
        transition: transform 0.3s ease; /* Smooth transform transition */
    }
    body.sidebar-open-mobile .content { /* When sidebar is open, push content */
        transform: translateX(var(--sidebar-width));
    }
    .sidebar.collapsed + .content { margin-left: 0; width: 100%; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile Small & General Mobile Improvements */
@media (max-width: 768px) {
    /* Layout */
    .content { padding: 0.75rem !important; }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    .welcome { display: none !important; }
    .subtitle { font-size: 0.85rem !important; }
    
    /* Stats & Grids */
    .stats-row { 
        grid-template-columns: 1fr !important; 
        gap: 0.75rem !important;
    }
    .grid-dashboard-2 {
        grid-template-columns: 1fr !important;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Cards */
    .card {
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    .btn-sm, .btn-xs {
        width: auto;
        margin-bottom: 0;
    }
    /* Toolbar buttons (next to each other) */
    .flex .btn { 
        width: auto; 
        margin-bottom: 0;
    }
    
    /* Tables: Stack rows as cards */
    .table:not(.no-mobile-stack) thead {
        display: none;
    }
    .table:not(.no-mobile-stack) tbody tr {
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-sm);
    }
    .table:not(.no-mobile-stack) tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0 !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        text-align: right;
        width: 100%;
    }
    .table:not(.no-mobile-stack) tbody td:last-child {
        border-bottom: none !important;
    }
    .table:not(.no-mobile-stack) tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
        margin-right: 1rem;
        flex: 1;
        white-space: nowrap;
    }
    
    /* Student Cell Special Handling */
    .table tbody td[data-label="Student"],
    .table tbody td[data-label="Name"] {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        border-bottom: 1px solid #e2e8f0 !important;
        padding-bottom: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    .table tbody td[data-label="Student"]::before,
    .table tbody td[data-label="Name"]::before { display: none; }
    .table tbody td[data-label="Student"] > *,
    .table tbody td[data-label="Name"] > * { justify-content: flex-start; text-align: left; }
    
    /* Modal adjustments */
    .modal-dialog {
        width: 95%;
        padding: 1rem;
        max-height: 95vh;
    }
}

@media (max-width: 768px) {
    .stats-row { grid-template-columns: 1fr; }
    .content-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .grid-cols-2 { grid-template-columns: 1fr; }
    .md\:grid-cols-2 { grid-template-columns: 1fr; }
}

/* Spaced Table (Coordinator Dashboard) */
.table-spaced {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}
.table-spaced tbody tr {
    background: #f9fafb; /* Light gray fallback */
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.table-spaced tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
    border: 1px solid var(--border);
}
.table-spaced td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}
.table-spaced td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.table-spaced td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

/* Utility Classes */
.w-35 { width: 35%; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.min-w-150 { min-width: 150px; }

/* Modal */
.modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.5); 
    z-index: 9999; /* Increased significantly */
    display: none; 
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(2px);
    pointer-events: auto; /* Ensure it captures events */
}
.modal.open { display: flex; }
.modal-dialog {
    background: var(--white); 
    width: 90%; 
    max-width: 600px;
    max-height: 90vh; 
    overflow-y: auto;
    border-radius: 1rem; 
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    position: relative;
    z-index: 10000;
    pointer-events: auto; /* Explicitly allow clicks inside */
}

.chart-container-lg { position: relative; height: 300px; width: 100%; }
.chart-container-sm { position: relative; height: 250px; width: 100%; }

/* Evaluation Specific Styles */
.evaluation-paper {
    background: #fff;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}
.part-header {
    background: var(--light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    border-left: 4px solid var(--primary);
}
.part-number {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.8rem;
}
.eval-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    background: var(--light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.eval-field-group { display: flex; flex-direction: column; }
.eval-label {
    font-size: 0.75rem; text-transform: uppercase;
    color: #000000; letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.eval-value { font-weight: 600; color: var(--dark); }

/* Rating Items */
.rating-item-formal {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}
.rating-item-formal:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}
.rating-score-box {
    background: var(--primary);
    color: white;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-weight: 700; font-size: 1.1rem;
}
.comment-box-formal {
    background: #fdfdfd;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    font-style: italic;
    color: var(--text-main);
    line-height: 1.6;
}
.ratings-grid-formal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.rating-scale-legend {
    display: flex; flex-wrap: wrap; gap: 1rem;
    background: var(--light); padding: 1rem;
    border-radius: 8px; margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.scale-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.scale-score { font-weight: 700; min-width: 30px; }
.scale-desc { color: var(--text-muted); }

/* Signature */
.sig-image-container img {
    max-width: 100%; max-height: 100px; object-fit: contain;
}
#signature_pad { width: 100%; height: 150px; }

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.col-span-full {
    grid-column: 1 / -1;
}

/* Badges */
.badge { 
    display: inline-flex; align-items: center; padding: 0.5em 1em; 
    font-size: 0.75rem; font-weight: 600; line-height: 1; 
    border-radius: 2rem; white-space: nowrap;
    transition: all 0.2s;color: #000000;
}

.badge-success { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-warning { background-color: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.badge-danger { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-info { background-color: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.badge-secondary { background-color: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.avatar-initials { 
    display: flex; align-items: center; justify-content: center; 
    background-color: var(--light); color: var(--primary); 
    border-radius: 50%; font-weight: 700; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-info { background-color: #bae6fd !important; }
.text-2xl { font-size: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-8 { margin-top: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.tracking-wider { letter-spacing: 0.05em; }
.no-underline { text-decoration: none; }
.hover\:underline:hover { text-decoration: underline; }

@media (max-width: 768px) {
    /* Make form controls and selects fill width on very small screens */
    .input, .select, .textarea { width: 100% !important; }
    /* So long labels don't cause overflow */
    th, td { padding: 0.65rem 0.25rem; font-size: 0.95rem; }
    .table-wrap { margin: 0 -0.25rem; padding: 0 0.25rem; }
    .evaluation-paper { padding: 1.5rem; }
    .eval-header-grid { grid-template-columns: 1fr; }
    .rating-item-formal { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .rating-score-box { align-self: flex-end; }
}
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .content { margin: 0; padding: 0; width: 100%; }
    .evaluation-paper { box-shadow: none; border: none; padding: 0; }
    body { background: white; }
    .cal-cell { border: 1px solid #000 !important; }
    .day-num, .cal-hours { color: #000 !important; }
}

/* Modal Header */
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
    background: #f8fafc; /* Added from student_dashboard */
    padding: 1.25rem 1.5rem; /* Updated padding */
    border-radius: 16px 16px 0 0; /* Optional: round top corners if dialog has radius */
}

/* Student Dashboard Specifics */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    height: 100%;
}
.quick-action-card:hover {
    background: #fff;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    border-color: var(--primary);
}
.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}
.quick-action-card:hover .icon-circle {
    transform: scale(1.1) rotate(5deg);
}
.action-label {
    font-weight: 600;
    color: #000000;
    font-size: 0.95rem;
    transition: color 0.3s;
}
.quick-action-card:hover .action-label {
    color: var(--primary);
}

/* Modal Polish */
.modal-backdrop { backdrop-filter: blur(4px); background: rgba(0,0,0,0.4); }
.modal-dialog { border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); border: none; overflow-y: auto; }
.modal-body { padding: 1.5rem; }
.modal-title { font-weight: 700; font-size: 1.25rem; }

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .profile-grid {
        grid-template-columns: 280px 1fr;
        align-items: start;
    }
}
.profile-lg {
    width: 150px; height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf2f8;
}
::-webkit-scrollbar-thumb {
    background: #f0abfc;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d8b4fe;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.8em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
    line-height: 1;
    transition: all 0.2s;
}
.badge-success { background-color: #dcfce7; color: #000000; border: 1px solid #bbf7d0; } /* Keep standard success for clarity but maybe soften */
.badge-warning { background-color: #fef9c3; color: #000000; border: 1px solid #fde047; }
.badge-danger { background-color: #fee2e2; color: #000000; border: 1px solid #fecaca; }
.badge-info { background-color: #e0f2fe; color: #000000; border: 1px solid #bae6fd; }
.badge-neutral { background-color: #f3f4f6; color: #000000; border: 1px solid #e5e7eb; }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }

/* User List Styles */
.user-item {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.user-item:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f1f5f9;
}
.delete-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.delete-btn:hover {
    opacity: 1;
}
@media (max-width: 640px) {
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .user-item > div:first-child {
        width: 100%;
    }
    .user-item form {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        margin-top: 0.5rem;
        border-top: 1px solid #f1f5f9;
        padding-top: 0.5rem;
    }
    .delete-btn {
        width: 100%;
        text-align: center;
        background: #fee2e2;
        border-radius: 8px;
    }
}

/* Dashboard & Mobile Fixes */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Progress Bars */
.mini-progress {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
    width: 100%;
}

.mini-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.mini-progress-bar.bg-success { background: #86efac; }
.mini-progress-bar.bg-warning { background: #fde047; }
.mini-progress-bar.bg-danger { background: #fda4af; }
.mini-progress-bar.bg-primary { background: #d8b4fe; }

/* Stat Icons - Pastel Variants */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    font-size: 1.5rem; /* Ensure emoji icons are sized right */
}

.stat-card:hover .stat-icon {
    transform: scale(1.15) rotate(10deg);
    background: linear-gradient(135deg, #f9a8d4 0%, #d8b4fe 100%) !important;
    color: #000000 !important;
    box-shadow: 0 4px 12px rgba(249, 168, 212, 0.4);
    border: 2px solid #fff;
}
.stat-icon.purple { background: #f3e8ff; color: #000000; }
.stat-icon.pink { background: #fce7f3; color: #000000; }
.stat-icon.orange { background: #ffedd5; color: #000000; }
.stat-icon.green { background: #dcfce7; color: #000000; }

/* Soft Background Classes */
.bg-soft-success { background: #dcfce7; color: #000000; border: 1px solid #bbf7d0; }
.bg-soft-warning { background: #fef9c3; color: #000000; border: 1px solid #fde047; }
.bg-soft-danger { background: #fee2e2; color: #000000; border: 1px solid #fecaca; }
.bg-soft-gray { background: #f3f4f6; color: #000000; border: 1px solid #e5e7eb; }

/* User Badge & Avatar */
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left; /* Ensure text inside badge stays left-aligned relative to image */
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    background-color: #f3f4f6;
    flex-shrink: 0;
}

/* Bottom Navigation (Mobile Only) */
.bottom-nav {
    display: none;
}

@media (max-width: 640px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(8px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        padding: 0.5rem 0;
        justify-content: space-around;
        align-items: center;
        height: 64px;
        padding-bottom: env(safe-area-inset-bottom, 0.5rem); /* iOS Safe Area */
    }

    .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;
        gap: 4px;
        flex: 1;
        background: none;
        border: none;
        padding: 4px 0;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .bottom-nav-item span {
        display: block;
        text-align: center;
        line-height: 1.1;
        padding: 0 2px;
        word-break: break-word;
    }

    .bottom-nav-item:active {
        transform: scale(0.95);
    }

    .bottom-nav-item.active {
        color: var(--primary);
        font-weight: 600;
    }
    
    .bottom-nav-item.active::after {
        content: '';
        position: absolute;
        top: 0;
        width: 40%;
        height: 2px;
        background: var(--primary);
        border-radius: 0 0 4px 4px;
    }
    
    .bottom-nav-item .icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 2px;
    }

    .bottom-nav-item .icon svg {
        width: 22px;
        height: 22px;
        stroke-width: 2px;
    }
    
    /* Ensure content isn't hidden behind nav */
    .content {
        padding-bottom: 80px !important; 
    }
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}
.cal-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}
.cal-cell {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 100px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}
.cal-cell.present {
    border-color: #bbf7d0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.cal-cell.today {
    outline: 2px dashed #cbd5e1;
    outline-offset: -4px;
}
.day-num {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
}
.cal-hours {
    margin-top: auto;
    align-self: flex-end;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: #f5f3ff;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
}
.cal-photo {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 1px solid #e5e7eb;
}
.cal-cell.empty {
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10b981;
}

@media (max-width: 640px) {
    .calendar-grid { gap: 0.25rem; }
    .cal-header { font-size: 0.7rem; padding: 0.4rem 0; }
    .cal-cell { min-height: 72px; padding: 0.35rem; border-radius: 8px; }
    .day-num { font-size: 0.75rem; }
    .cal-hours { font-size: 0.65rem; padding: 0.15rem 0.35rem; }
    .cal-photo { height: 36px; border-radius: 6px; }
    .dot { width: 6px; height: 6px; }
}

@media (max-width: 380px) {
    .calendar-grid { gap: 2px; }
    .cal-cell { min-height: 60px; padding: 1px; border-radius: 6px; }
    .cal-header { font-size: 0.65rem; padding: 0.3rem 0; }
    .day-num { font-size: 0.6rem; }
    .cal-hours { font-size: 0.6rem; padding: 0.1rem 0.3rem; }
    .cal-photo { height: 28px; border-radius: 5px; }
    .dot { width: 5px; height: 5px; }
}

/* Small Mobile Navigation Adjustments */
@media (max-width: 380px) {
    .bottom-nav-item {
        font-size: 0.6rem;
    }
    .bottom-nav-item .icon svg {
        width: 18px;
        height: 18px;
    }
     .bottom-nav-item span {
        display: none;
    }
}

/* PLATFORM / LANDING & AUTH STYLES (Added for consistency) */

/* Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes floatShape {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(50px, 50px) rotate(20deg); }
}

/* Auth / Landing Body Layout */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  /* Ensure background matches standard body if not overridden */
  background: linear-gradient(135deg, #fdf2f8 0%, #f3e8ff 100%);
}

/* Background Shapes */
.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
  animation: floatShape 20s infinite alternate;
}
.shape-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -150px;
  left: -150px;
}
.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  bottom: -100px;
  right: -100px;
  animation-delay: -7s;
}
.shape-3 {
  width: 300px;
  height: 300px;
  background: #a7f3d0; /* Pastel Green */
  top: 30%;
  right: 20%;
  opacity: 0.3;
  animation-duration: 25s;
  animation-delay: -12s;
}

/* Glassmorphism Card */
.glass-card {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 2.5rem;
  padding: 3.5rem;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
  transition: transform 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(31, 38, 135, 0.08);
}

/* Intro Title (Gradient Text) */
.intro-title {
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--primary-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
  line-height: 1.1;
}

/* Custom Buttons for Landing/Auth */
.btn-custom-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 1.2rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
  transition: all 0.3s;
  letter-spacing: 0.5px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.btn-custom-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--text-muted) 100%);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(139, 92, 246, 0.5);
  color: white;
}

.btn-custom-outline {
  background: rgba(255,255,255,0.5);
  border: 2px solid var(--primary);
  padding: 0.9rem 2.5rem;
  border-radius: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.3s;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.btn-custom-outline:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

/* Auth Form Control Override */
.auth-body .form-control {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1rem;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
}

.auth-body .form-control:focus {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(216, 180, 254, 0.25);
    border-color: var(--primary);
}

/* Mobile Adjustments for Auth/Landing */
@media (max-width: 576px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }
    .intro-title {
        font-size: 2.2rem;
    }
    .shape-1 { width: 250px; height: 250px; top: -50px; left: -50px; }
    .shape-2 { width: 200px; height: 200px; bottom: -50px; right: -50px; }
    
    .btn-custom-primary, .btn-custom-outline {
        width: 100%;
        padding: 0.8rem;
    }
}

/* Letter Layout */
.letter-body {
    background: #f3f4f6;
    color: #000;
}
.letter-container {
    width: 8.5in;
    min-height: 11in;
    background: #fff;
    margin: 24px auto;
    padding: 1in;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    line-height: 1.6;
    font-family: "Times New Roman", Times, serif;
    position: relative;
}
.letter-header {
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #000;
}
.school-name {
    font-weight: 700;
    font-size: 1.5rem;
}
.dept-name {
    font-size: 1rem;
}
.letter-content {
    margin-top: 0.5rem;
    font-size: 12pt;
}
.letter-date {
    text-align: right;
    margin-bottom: 1rem;
}
.letter-recipient {
    margin-top: 1rem;
    white-space: pre-line;
}
.letter-subject {
    text-align: center;
    margin: 1.25rem 0 1rem 0;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.body-text p {
    margin: 0 0 1rem 0;
    text-align: justify;
}
.letter-closing {
    margin-top: 2rem;
}
.signature-grid {
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    margin-top: 2.5rem;
}
.signature-block {
    min-width: 45%;
}
.sig-name {
    margin-top: 2.5rem;
    display: inline-block;
    padding-top: 4px;
    border-top: 1px solid #000;
    font-weight: 700;
}
.sig-title {
    display: block;
    font-size: 0.9rem;
    color: #000;
}
.sig-note {
    margin-bottom: 2rem;
    font-weight: 600;
}
.letter-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    border-top: 1px solid #ddd;
    padding-top: 0.5rem;
}

@media screen and (max-width: 900px) {
    .letter-container {
        width: 100%;
        padding: 1.25rem;
        min-height: auto;
    }
    .signature-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media print {
    @page {
        size: A4;
        margin: 1in;
    }
    body.letter-body {
        background: #ffffff !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
        margin: 0;
    }
    .letter-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
        width: auto;
        min-height: auto;
        font-family: "Times New Roman", Times, serif;
        color: #000;
    }
    .letter-header {
        border-color: #000;
    }
    .letter-footer {
        border-color: #000;
        color: #000;
    }
}
