/* Premium Theme with Glassmorphism */
:root {
    --primary: #f97316;       /* Vibrant Orange */
    --primary-hover: #ea580c;
    --secondary: #0ea5e9;     /* Teal/Cyan */
    --accent: #f59e0b;        /* Gold */
    --danger: #ef4444;
    --navy: #1e293b;          /* Dark Slate for "Master" */
    --bg-dark: #0f172a;       /* Slate 900 */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.4);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border: rgba(255, 255, 255, 0.15);
    --glass: rgba(255, 255, 255, 0.05);
    --radius: 16px;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font: 'Outfit', 'Inter', sans-serif;
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font);
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
}

/* Background aesthetic elements */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(40px);
}
body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    z-index: -1;
    filter: blur(40px);
}

#app {
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
}

.dashboard-layout {
    display: flex;
    gap: 0;
}

.sidebar {
    width: 350px;
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 2rem 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.nav-item i {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-item:hover i {
    opacity: 1;
    color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(14, 165, 233, 0.1));
    color: white;
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-item.active i {
    opacity: 1;
    color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1200px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.header-content {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    padding: 1.2rem 3.5rem;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border-left: 6px solid var(--primary);
}

.emblem {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: transparent;
    padding: 0;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emblem:hover {
    transform: scale(1.15) rotate(15deg);
    filter: drop-shadow(0 15px 30px rgba(249, 115, 22, 0.4));
}

.brand-text {
    text-align: left;
}

h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: white;
    margin: 0;
}

h1 span {
    color: var(--primary);
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
    text-transform: lowercase;
}

/* Header Actions Container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* User Guide Button */
.btn-guide-float {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 100px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.btn-guide-float:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-guide-float i {
    width: 18px;
    height: 18px;
    color: var(--primary);
    transition: color 0.3s;
}

.btn-guide-float:hover i {
    color: white;
}

.btn-guide-float.admin-btn {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
}

.btn-guide-float.admin-btn i {
    color: var(--secondary);
}

.btn-guide-float.admin-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

/* Guide Modal */
.guide-modal-content {
    max-width: 600px;
    text-align: left;
}

.guide-scroll-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
    margin-top: 1rem;
}

.guide-section {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.guide-section:hover {
    background: rgba(15, 23, 42, 0.5);
    border-color: var(--primary);
}

.guide-section h3 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.guide-section h3 i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.guide-section ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.guide-section li {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
    position: relative;
    padding-left: 1.5rem;
}

.guide-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 800;
}

.guide-section strong {
    color: var(--text-main);
}

/* Custom Scrollbar for Guide */
.guide-scroll-container::-webkit-scrollbar {
    width: 6px;
}
.guide-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
.guide-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Cards & Layout */
.card {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.flex-2 {
    flex: 2;
    min-width: 250px;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent);
    text-transform: uppercase;
}

input, select {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
    cursor: pointer;
}

option {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 0.5rem;
}

option:hover, option:checked {
    background-color: #f97316;
    color: #ffffff;
}

input:focus, select:focus {
    border-color: var(--primary);
    background: #0f172a;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Sub inputs for Classes Taken */
.sub-input {
    display: flex;
    gap: 0.5rem;
}
.sub-input input {
    flex: 1;
    min-width: 80px;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: var(--font);
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    flex-shrink: 0;
}
.btn-icon:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.8rem 2rem;
    height: 52px;
    white-space: nowrap;
    border-radius: 12px;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid var(--border);
    padding: 0.8rem 1.2rem;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

.btn-small {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}
.btn-small:hover { background: rgba(255,255,255,0.2); }

/* Lists */
.data-list-container {
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.tag.small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}
.tag button {
    background: transparent;
    color: #fff;
    opacity: 0.7;
    padding: 0;
}
.tag button:hover { opacity: 1; color: var(--danger); }

.data-cards {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.data-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
}
.data-card h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}
.data-card .charge { font-size: 0.85rem; color: var(--accent); }
.data-card p { font-size: 0.85rem; color: var(--text-muted); }
.btn-del {
    background: transparent;
    color: var(--text-muted);
}
.btn-del:hover { color: var(--danger); }

/* Modern Section Titles */
.section-title {
    margin: 4rem 0 2rem;
    padding-left: 1.5rem;
    border-left: 4px solid var(--primary);
    background: linear-gradient(to right, rgba(249, 115, 22, 0.1), transparent);
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-radius: 0 8px 8px 0;
}
.section-title h2 {
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.output-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.output-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}
.output-card label { margin-bottom: 0.5rem; }
.output-card select { width: 100%; text-align: center; }
.output-card button { width: 100%; }

/* Mobile Adjustments */
@media (max-width: 1100px) {
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); padding: 1.5rem; }
    .main-content { padding: 1.5rem; }
}

@media (max-width: 768px) {
    .header-content { flex-direction: column; padding: 1.5rem; border-radius: var(--radius); }
    h1 { font-size: 1.5rem; }
    .row { flex-direction: column; align-items: stretch; }
    .btn-icon { width: 100%; margin-top: 1rem; }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}
.modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.modal-content {
    margin: auto;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Summary Widget Refined for Sidebar */
#teacher-summary-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Teacher Workload Table in Sidebar */
.workload-section {
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
    margin-top: 1rem;
}

.workload-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workload-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    flex-shrink: 0;
}

.workload-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.workload-row:hover {
    background: rgba(249, 115, 22, 0.07);
    border-color: rgba(249, 115, 22, 0.2);
}

.workload-teacher-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.workload-badge {
    background: rgba(14, 165, 233, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    white-space: nowrap;
}

/* ── Breakdown rows inside each teacher card ── */
.workload-breakdown {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workload-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
}

.wl-subject {
    flex: 1;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-class {
    font-size: 0.65rem;
    color: var(--secondary);
    background: rgba(14,165,233,0.1);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
}

.wl-periods {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    min-width: 28px;
    text-align: right;
}

/* ── Total footer per teacher card ── */
.workload-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 5px 6px;
    border-top: 1px dashed rgba(249,115,22,0.3);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wl-total-num {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0;
}

/* ── No-work placeholder ── */
.workload-empty, .wl-empty {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.6rem 0;
    font-style: italic;
    display: block;
}

.summary-widget {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    max-height: none;
    overflow: visible;
}

.summary-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.summary-widget h3::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Data Cards & Tags */
.data-list-container {
    margin-top: 1.5rem;
}

.data-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
}

.data-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.data-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: var(--shadow);
}

.card-info {
    flex: 1;
}

.card-info strong {
    display: block;
    font-size: 1.1rem;
    color: var(--light);
    margin-bottom: 0.25rem;
}

.card-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge.secondary { background: rgba(14, 165, 233, 0.1); color: var(--secondary); border: 1px solid rgba(14, 165, 233, 0.2); }

/* Sidebar Stats */
.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    padding: 0.5rem 0;
}

/* Modals */
.modal {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Premium Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #ea580c);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.btn-icon.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Forms */
input, select, textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--light);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Animations */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Pro Admin Dashboard */
.admin-header-pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.admin-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-title i {
    color: var(--secondary);
    width: 28px;
    height: 28px;
}

.admin-title h2 {
    font-size: 1.5rem;
    letter-spacing: 1px;
    margin: 0;
}

.admin-status-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.db-status {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.db-status.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.admin-table th {
    background: rgba(14, 165, 233, 0.1) !important;
    color: var(--secondary) !important;
}

/* Countdown Styles */
.countdown-mini {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    display: none; /* Shown via JS */
    white-space: nowrap;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(1);
}

@keyframes pulse-simple {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.summary-table th {
    text-align: left;
    color: var(--text-muted);
    padding: 0.5rem 0.2rem;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-weight: 800;
}

.summary-table td {
    padding: 0.8rem 0.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: top;
}

.summary-table .sl-no { width: 30px; }
.summary-table .teacher-name { font-weight: 600; color: var(--primary); }

.subject-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.subject-name { color: var(--text-main); }
.subject-periods { color: var(--text-muted); font-weight: 600; }

/* Admin Dashboard Table Styles */
.admin-table {
    margin-top: 1rem;
    font-size: 0.85rem;
}

.admin-table th {
    background: rgba(15, 23, 42, 0.6);
    color: var(--secondary);
    padding: 1rem;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.admin-stats-grid .guide-section h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
}
/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 9999;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--danger);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

.total-row {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed var(--border);
    color: var(--secondary);
    font-weight: 800;
    text-align: right;
    font-size: 0.85rem;
}

/* Scrollbar styling for Chrome/Safari */
.summary-widget::-webkit-scrollbar {
    width: 4px;
}
.summary-widget::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

@media (max-width: 1300px) {
    #teacher-summary-container {
        position: static;
        margin-bottom: 2rem;
        display: flex;
        justify-content: center;
    }
    .summary-widget {
        width: 100%;
        max-width: 800px;
        max-height: none;
    }
}

/* Teacher Card Actions & Hover Effects */
.data-card {
    transition: all 0.3s ease;
    cursor: default;
}

.data-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    background: rgba(30, 41, 59, 0.6);
}

.data-card h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-card .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    background: rgba(249, 115, 22, 0.15);
    color: var(--primary);
    border: 1px solid rgba(249, 115, 22, 0.3);
    padding: 0.4rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.btn-del {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.4rem;
    border-radius: 6px;
}

.btn-del:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

/* Specific styling for name "touch" indicator */
.data-card h4 span {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.3s;
}

.data-card:hover h4 span {
    border-bottom-color: var(--primary);
}

/* Stylish Pro Subject Grid Table */
.subject-grid-wrapper {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.subject-grid-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.subject-grid-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent);
    padding: 1rem 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(249, 115, 22, 0.3);
    text-align: center;
}

.subject-grid-table th:first-child {
    text-align: left;
    border-radius: 8px 0 0 0;
}
.subject-grid-table th:last-child {
    border-radius: 0 8px 0 0;
}

.subject-grid-table td {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.02);
    vertical-align: middle;
    transition: all 0.2s ease;
}

.subject-grid-table tr {
    transition: background 0.3s ease;
}

.subject-grid-table tbody tr:hover {
    background: rgba(249, 115, 22, 0.05);
}

.subject-grid-table td:hover {
    background: rgba(14, 165, 233, 0.05);
}

.subject-grid-table .class-name {
    font-weight: 800;
    color: var(--primary);
    font-size: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.subject-grid-table .period-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    min-width: 50px;
    font-weight: 600;
    color: white;
    gap: 8px;
    transition: all 0.2s ease;
}

.subject-grid-table .period-badge:hover {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.3);
    transform: scale(1.05);
}

.subject-grid-table .btn-del-cell {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.subject-grid-table .btn-del-cell:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.subject-grid-table .empty-cell {
    color: var(--text-muted);
    opacity: 0.3;
}

/* --- Preview Modal & Anti-Screenshot --- */

.preview-modal-content {
    max-width: 90vw;
    width: 90%;
    max-height: 90vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
}

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

.preview-scroll-container {
    flex: 1;
    overflow: auto;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0; /* Removed padding to make calculation exact */
    position: relative;
    max-height: 242px; /* Exactly 4 rows of 60px (1 header + 3 days) + 2px borders */
    max-width: 602px;  /* Exactly 5 columns of 120px (1 header + 4 periods) + 2px borders */
    margin: 0 auto;
}

/* Timetable styling inside preview */
.preview-table {
    border-collapse: collapse;
    color: var(--text-main);
    table-layout: fixed;
}

.preview-table th, .preview-table td {
    border: 1px solid var(--border);
    padding: 0.5rem;
    box-sizing: border-box;
    height: 60px; /* Explicit height to guarantee 3 rows are visible */
    width: 120px; /* Explicit width to guarantee 4 periods are visible */
    min-width: 120px;
    max-width: 120px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-table th {
    background: rgba(249, 115, 22, 0.2);
    color: var(--primary);
    font-weight: 800;
}

.preview-table td {
    background: rgba(255, 255, 255, 0.02);
}

/* Watermark Overlay */
.watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* Click through */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='150px' width='300px'><text transform='translate(20, 100) rotate(-30)' fill='rgba(255,255,255,0.05)' font-size='30' font-family='Arial'>PREVIEW ONLY</text></svg>");
    z-index: 10;
}

/* Blurring utility triggered by JS */
.blur-content {
    filter: blur(20px);
    opacity: 0.1;
    transition: all 0.1s ease;
}

/* Hide on Print */
@media print {
    body {
        display: none !important;
    }
}
/* --- Payment Banner --- */
.payment-banner {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.5s ease forwards;
}

.payment-banner.valid {
    background: rgba(16, 185, 129, 0.2);
    border-left: 5px solid #10b981;
    color: #34d399;
}

.payment-banner.expired {
    background: rgba(239, 68, 68, 0.2);
    border-left: 5px solid #ef4444;
    color: #f87171;
}

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

/* --- Pro Web App Enhancements --- */

/* Pro Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: var(--glass-heavy);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    color: var(--light);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    pointer-events: auto;
    animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition: var(--transition);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--secondary); }

@keyframes toastIn {
    from { transform: translateX(100%) opacity(0); }
    to { transform: translateX(0) opacity(1); }
}

/* Sidebar Pro Badge Animation */
.pro-badge {
    position: relative;
    overflow: hidden;
}

.pro-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

/* Section Title Refinement */
.section-title h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--light);
    margin: 2.5rem 0 1.5rem;
}

.section-title h2 i {
    color: var(--primary);
    width: 24px;
    height: 24px;
}

/* Glassmorphism Refinement for Main Content Header */
header {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

/* Data Cards & Tags List Layout */
.data-list-container {
    margin-top: 1.5rem;
}

.data-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
}

.data-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.data-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: var(--shadow);
}

.card-info {
    flex: 1;
}

.card-info strong {
    display: block;
    font-size: 1.1rem;
    color: var(--light);
    margin-bottom: 0.25rem;
}

.card-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Badge System */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge.secondary { background: rgba(14, 165, 233, 0.1); color: var(--secondary); border: 1px solid rgba(14, 165, 233, 0.2); }

/* Sidebar Stats & Interactive Items */
.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-value {
    color: var(--secondary);
    font-weight: 700;
}

.pro-badge {
    margin-top: 1rem;
    padding: 12px;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 12px;
    text-align: center;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.75rem;
    border: 1px solid rgba(249, 115, 22, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Responsive Overrides for Pro Admin Dashboard */
@media (max-width: 768px) {
    .admin-header-pro {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .admin-status-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
    .admin-status-group button {
        width: 100%;
        margin: 0 !important;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .modal-content {
        padding: 1.5rem !important;
        border-radius: 16px !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAIR BADGES — Clubbed Subject Rule UI
══════════════════════════════════════════════════════ */
.pair-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pair-badge-1 {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.pair-badge-2 {
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.4);
    color: var(--secondary);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}




/* Clubbed Subjects UI tweaks */
#pref-second-pair-group {
    background: rgba(14, 165, 233, 0.05);
    border-radius: 12px;
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

#pref-second-pair-group label {
    color: var(--secondary);
}

#pref-second-pair-group select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

/* Sleek, attractive, medium sized generate button */
.btn-generate {
    background: linear-gradient(135deg, var(--primary) 0%, #f59e0b 50%, var(--secondary) 100%) !important;
    background-size: 200% auto !important;
    color: white !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    padding: 0.8rem 2.2rem !important;
    height: auto !important;
    min-height: 50px !important;
    border-radius: 50px !important; /* Premium rounded pill */
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35), 0 4px 20px rgba(14, 165, 233, 0.25) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-transform: uppercase !important;
    animation: btnPulseGlow 2.5s infinite ease-in-out !important;
}

.btn-generate:hover {
    background-position: right center !important;
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.55), 0 8px 30px rgba(14, 165, 233, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.btn-generate:active {
    transform: translateY(1px) scale(0.98) !important;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3) !important;
}

.btn-generate i {
    font-size: 1.15rem;
    transition: all 0.3s ease;
}

.btn-generate:hover i {
    animation: zapPulse 0.8s infinite alternate;
}

@keyframes btnPulseGlow {
    0% {
        box-shadow: 0 0 15px rgba(249, 115, 22, 0.35), 0 0 15px rgba(14, 165, 233, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(249, 115, 22, 0.55), 0 0 25px rgba(14, 165, 233, 0.35);
    }
    100% {
        box-shadow: 0 0 15px rgba(249, 115, 22, 0.35), 0 0 15px rgba(14, 165, 233, 0.2);
    }
}

@keyframes zapPulse {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 2px white);
    }
    100% {
        transform: scale(1.3) rotate(15deg);
        filter: drop-shadow(0 0 8px #f59e0b);
    }
}


/* Expandable lists Pro Style Buttons */
.btn-pro-expand {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(14, 165, 233, 0.15) 100%) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text-main) !important;
    padding: 0.5rem 1.2rem !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    border-radius: 100px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    border-left: 3px solid var(--primary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    margin-bottom: 0.5rem;
}

.btn-pro-expand:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.3) 0%, rgba(14, 165, 233, 0.3) 100%) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    border-left-color: var(--secondary) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3) !important;
}

.btn-pro-expand:active {
    transform: translateY(1px) scale(0.98) !important;
}

.btn-pro-expand i {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease !important;
    color: var(--primary) !important;
}

.btn-pro-expand:hover i {
    color: var(--secondary) !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PRO ADMIN LOGS & MOBILE CARD TRANSFORM SYSTEM
   ───────────────────────────────────────────────────────────────────────────── */

/* Glassmorphic Log Control Bar */
.log-controls-bar {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.2rem;
    margin: 1.5rem 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    border-left: 4px solid var(--secondary);
}

.log-controls-bar .search-box {
    position: relative;
    flex: 1 1 280px;
}

.log-controls-bar .search-box input {
    width: 100%;
    height: 44px;
    padding-left: 2.8rem;
    padding-right: 1.2rem;
    font-size: 0.9rem;
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: var(--text-main) !important;
    transition: all 0.3s ease;
}

.log-controls-bar .search-box input:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
    background: rgba(15, 23, 42, 0.8) !important;
}

.log-controls-bar .search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--secondary);
    pointer-events: none;
    transition: color 0.3s;
}

.log-controls-bar .sort-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 240px;
}

.log-controls-bar .sort-box label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.log-controls-bar .sort-box select {
    width: 100%;
    height: 44px;
    font-size: 0.85rem;
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: var(--text-main) !important;
    padding: 0.5rem 2.5rem 0.5rem 1rem !important;
}

.log-controls-bar .sort-box select:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
}

.log-controls-bar .actions-box {
    display: flex;
    gap: 0.6rem;
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.log-controls-bar .actions-box button {
    height: 44px;
    padding: 0 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-refresh-logs {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text-main) !important;
}

.btn-refresh-logs:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px) !important;
}

.btn-clear-logs {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}

.btn-clear-logs:hover {
    background: #ef4444 !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35) !important;
}

/* Sortable Headers Styling */
.sortable-table th {
    transition: background 0.3s, color 0.3s;
    user-select: none;
}

.sortable-table th:hover {
    background: rgba(14, 165, 233, 0.15) !important;
    color: white !important;
}

.sort-indicator {
    display: inline-block;
    width: 12px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

/* Modern Rounded Trash Delete Button */
.btn-del-log {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    color: #ef4444 !important;
    padding: 8px !important;
    border-radius: 50% !important;
    width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    outline: none !important;
}

.btn-del-log:hover {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    transform: scale(1.15) rotate(5deg) !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.45) !important;
}

.btn-del-log i {
    width: 16px;
    height: 16px;
}

/* Mobile Transform Query (Under 768px Width) */
@media (max-width: 768px) {
    /* Adjust Control Bar layouts */
    .log-controls-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
        padding: 1rem !important;
    }
    
    .log-controls-bar .search-box, 
    .log-controls-bar .sort-box, 
    .log-controls-bar .actions-box {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
    
    .log-controls-bar .actions-box {
        justify-content: stretch !important;
    }
    
    .log-controls-bar .actions-box button {
        flex: 1 !important;
        justify-content: center !important;
    }

    /* Hide standard table headers */
    .sortable-table thead {
        display: none !important;
    }

    /* Turn table rows into modern separate cards */
    .sortable-table, 
    .sortable-table tbody, 
    .sortable-table tr, 
    .sortable-table td {
        display: block !important;
        width: 100% !important;
    }

    .sortable-table tbody tr {
        background: rgba(30, 41, 59, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 14px !important;
        padding: 1.2rem !important;
        margin-bottom: 1.2rem !important;
        position: relative !important;
        box-shadow: 0 6px 20px rgba(0,0,0,0.25) !important;
        transition: all 0.3s ease !important;
        border-left: 3px solid rgba(14, 165, 233, 0.4) !important;
    }
    
    .sortable-table tbody tr:hover {
        border-left-color: var(--primary) !important;
        background: rgba(30, 41, 59, 0.6) !important;
        transform: translateY(-3px) !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
    }

    /* Format table cells into key-value horizontal rows */
    .sortable-table tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        font-size: 0.9rem !important;
    }

    .sortable-table tbody td:last-child {
        border-bottom: none !important;
        padding-top: 1rem !important;
        justify-content: center !important; /* Center the actions row */
    }

    /* Map label string through attr */
    .sortable-table tbody td::before {
        content: attr(data-label) !important;
        font-weight: 700 !important;
        color: var(--accent) !important;
        text-transform: uppercase !important;
        font-size: 0.75rem !important;
        letter-spacing: 0.06em !important;
        text-align: left !important;
        display: inline-block !important;
    }
    
    /* Responsive tweaks for elements inside cards */
    .sortable-table td[data-label="School / Org"] {
        text-align: right !important;
    }
    
    .sortable-table td[data-label="Action"]::before {
        display: none !important; /* Hide action label, let the button stand out */
    }
}
