/* Base & Variables */
:root {
    --primary-color: #4A7FA7;
    --primary-hover: #1A3D63;
    --secondary-color: #EBF3FA;
    --text-main: #0A1931;
    --text-muted: #4A7FA7;
    --bg-main: #F6FAFD;
    --bg-card: #ffffff;
    --border-color: #B3CFE5;
    
    --sidebar-bg: linear-gradient(180deg, #0A1931 0%, #1A3D63 100%);
    --sidebar-text: #F6FAFD;
    --sidebar-muted: #B3CFE5;
    --sidebar-hover: rgba(179, 207, 229, 0.2);
    --sidebar-active: rgba(179, 207, 229, 0.3);
    --sidebar-border: #1A3D63;
    
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #4A7FA7;
    
    --shadow-sm: 0 1px 2px 0 rgba(26, 61, 99, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(26, 61, 99, 0.1), 0 2px 4px -2px rgba(26, 61, 99, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(26, 61, 99, 0.1), 0 4px 6px -4px rgba(26, 61, 99, 0.05);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

[data-theme="dark"] {
    --primary-color: #4A7FA7;
    --primary-hover: #B3CFE5;
    --secondary-color: #1A3D63;
    --text-main: #F6FAFD;
    --text-muted: #B3CFE5;
    --bg-main: #060e1c;
    --bg-card: #0A1931;
    --border-color: #1A3D63;
    
    --sidebar-bg: #060e1c;
    --sidebar-text: #F6FAFD;
    --sidebar-muted: #4A7FA7;
    --sidebar-hover: rgba(74, 127, 167, 0.15);
    --sidebar-active: rgba(74, 127, 167, 0.25);
    --sidebar-border: #1A3D63;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Utilities */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.p-4 { padding: 1.5rem; }
.ml-3 { margin-left: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary-color); }
.text-blue { color: var(--info); }
.small { font-size: 0.875rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.border-top { border-top: 1px solid var(--border-color); }
.bg-light { background-color: var(--secondary-color); }
.rounded { border-radius: var(--radius-md); }

/* Layout */
/* Layout */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    height: 100vh;
    position: fixed;
    z-index: 100;
}

.sidebar-header {
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    text-align: center;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ffffff;
}

.logo i {
    font-size: 2.2rem;
}

.logo h2 {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.md-hidden { display: none; background: none; border: none; color: white; cursor: pointer; font-size: 1.5rem; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--sidebar-muted);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav li:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.sidebar-nav li.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text);
    border-left: 4px solid white;
}

.sidebar-nav li i {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: var(--transition);
}

.top-header {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-btn, .theme-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.menu-btn:hover, .theme-btn:hover {
    background-color: var(--secondary-color);
}

.menu-btn { display: none; }

.datetime-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
}

.datetime-display i {
    color: var(--primary-color);
}

.content-area {
    padding: 2rem;
    flex: 1;
    position: relative;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.page.active {
    display: block;
}

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

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.blue::before { background-color: var(--primary-color); }
.stat-card.green::before { background-color: var(--success); }
.stat-card.purple::before { background-color: #8b5cf6; }
.stat-card.pink::before { background-color: #ec4899; }

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.blue .stat-icon { background-color: rgba(59, 130, 246, 0.1); color: var(--primary-color); }
.stat-card.green .stat-icon { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card.purple .stat-icon { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.stat-card.pink .stat-icon { background-color: rgba(236, 72, 153, 0.1); color: #ec4899; }

/* Dashboard Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stats-list {
    list-style: none;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.badge {
    background-color: var(--secondary-color);
    color: var(--text-main);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

/* Forms */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.form-group {
    flex: 1;
    margin-bottom: 1.25rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

input[type="text"], 
select, 
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

input[type="text"]:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.readonly-input {
    background-color: var(--secondary-color) !important;
    cursor: not-allowed;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 2.5rem;
}

.input-with-icon i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.file-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--secondary-color);
    cursor: pointer;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--secondary-color);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.upload-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.upload-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    font-weight: 600;
}

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

.upload-area img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 10;
}

.d-none { display: none !important; }

.fee-box {
    background-color: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
}

.fee-box strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--secondary-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.student-info-cell {
    vertical-align: middle;
}

.student-info-cell > span {
    display: block;
}

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

.student-pob {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.table-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--border-color);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    padding-left: 2.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Settings Toggle */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-info h4 {
    margin-bottom: 0.25rem;
}

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

/* Switch Component */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: var(--shadow-sm);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Profile Elements */
.profile-container .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.styled-list {
    list-style: none;
    padding-left: 0.5rem;
}

.styled-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.styled-list li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.program-list {
    padding-left: 1.25rem;
}

.program-list li {
    margin-bottom: 1rem;
}

.program-list li p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.row-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.row-lists h4 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--primary-color);
}

/* Profil Enhancements */
.vision-mission {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.vision-box, .mission-box {
    background: var(--bg-main);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    height: 100%;
}
.vm-icon {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}
.vision-box h3, .mission-box h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}
.program-list {
    list-style: none;
    padding-left: 0;
}
.program-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border-color);
}
.program-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.program-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.program-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    font-size: 1.05rem;
}
.program-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Contact Card Updates */
.contact-card {
    background: linear-gradient(135deg, #1A3D63, #4A7FA7);
    color: white;
    border: none;
    box-shadow: 0 10px 25px -5px rgba(26, 61, 99, 0.4);
}
[data-theme="dark"] .contact-card {
    background: linear-gradient(135deg, #0A1931, #1A3D63);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
.contact-card .card-header {
    border-bottom: none;
    padding-bottom: 0.5rem;
}
.contact-card .card-header h3 {
    color: white;
    font-size: 1.25rem;
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: white;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.contact-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}
.contact-icon {
    width: 40px;
    height: 40px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.contact-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
    font-weight: 600;
}
.contact-info span {
    font-size: 0.85rem;
    opacity: 0.9;
}
.opacity-80 { opacity: 0.8; }
.border-0 { border: none !important; }
.pb-0 { padding-bottom: 0 !important; }

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    transition: var(--transition);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 992px) {
    .profile-container .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    
    .main-content, .app-footer {
        margin-left: 0;
    }
    
    .menu-btn, .md-hidden {
        display: flex;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .header-left {
        gap: 0.5rem;
    }
    
    .datetime-display {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .datetime-display #current-date {
        display: none;
    }
    .top-header {
        padding: 0 1rem;
    }
    .content-area {
        padding: 1rem;
    }
    .row-lists {
        grid-template-columns: 1fr;
    }
}
