/* ============================================
   Sistem Mutasi Siswa - Custom Styles
   Dinas Pendidikan Kota Pontianak
   ============================================ */

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --primary-dark: #0e3a54;
    --secondary: #2c3e50;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #3498db;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --sidebar-width: 260px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    overflow-x: hidden;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 30px;
    text-align: center;
    color: #fff;
}

.login-header img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.login-header h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.login-header p {
    font-size: 12px;
    opacity: 0.85;
}

.login-body {
    padding: 30px;
}

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

.login-body .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.login-body .btn-login {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.login-body .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 82, 118, 0.3);
}

.login-body .input-group-text {
    border-radius: 10px 0 0 10px;
    background: var(--light);
    border: 2px solid #e0e0e0;
    border-right: none;
    color: var(--primary);
}

.login-body .input-group .form-control {
    border-radius: 0 10px 10px 0;
    border-left: none;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
}

.sidebar-header h6 {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.sidebar-header small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
}

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

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #fff;
}

.sidebar-menu li a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
}

.sidebar-menu .menu-header {
    padding: 15px 20px 5px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.topbar {
    background: #fff;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar .user-info .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.topbar .user-info .user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

.topbar .user-info .user-role {
    font-size: 11px;
    color: #999;
}

.content-wrapper {
    padding: 25px;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 25px;
}

.page-header h4 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.page-header .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.page-header .breadcrumb-item a {
    color: var(--primary-light);
    text-decoration: none;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: #fff;
    border-bottom: 2px solid #f0f0f0;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 20px;
}

/* ============================================
   STAT CARDS (Dashboard)
   ============================================ */
.stat-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.stat-card .stat-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    opacity: 0.15;
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.stat-card.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.stat-card.bg-success-gradient {
    background: linear-gradient(135deg, #1a8a4a 0%, var(--success) 100%);
}

.stat-card.bg-warning-gradient {
    background: linear-gradient(135deg, #d68910 0%, var(--warning) 100%);
}

.stat-card.bg-danger-gradient {
    background: linear-gradient(135deg, #c0392b 0%, var(--accent) 100%);
}

.stat-card.bg-info-gradient {
    background: linear-gradient(135deg, #2178b5 0%, var(--info) 100%);
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 15px;
    border: none;
    white-space: nowrap;
}

.table tbody td {
    padding: 10px 15px;
    vertical-align: middle;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: #f8f9ff;
}

.table .badge {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

/* ============================================
   FORMS
   ============================================ */
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--dark);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.form-control.is-invalid {
    border-color: var(--accent);
}

/* ============================================
   STATUS BADGES
   ============================================ */
.badge-pending {
    background: #ffeaa7;
    color: #d68910;
}

.badge-draft {
    background: #0984e3;
    color: #ffffff;
}

.badge-diverifikasi {
    background: #dfe6e9;
    color: #636e72;
}

.badge-surat-dibuat {
    background: #00cec9;
    color: #ffffff;
}

.badge-diajukan {
    background: #a29bfe;
    color: #4834d4;
}

.badge-disetujui {
    background: #55efc4;
    color: #00b894;
}

.badge-ditolak {
    background: #fab1a0;
    color: #d63031;
}

.badge-aktif {
    background: #55efc4;
    color: #00b894;
}

.badge-keluar {
    background: #fab1a0;
    color: #d63031;
}

.badge-lengkap {
    background: #55efc4;
    color: #00b894;
}

.badge-tidak-lengkap {
    background: #fab1a0;
    color: #d63031;
}

/* ============================================
   SURAT PRINT STYLE
   ============================================ */
.surat-preview {
    background: #fff;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    font-family: 'Times New Roman', serif;
    font-size: 13px;
    line-height: 1.6;
}

.surat-preview .kop-surat {
    text-align: center;
    border-bottom: 3px double #000;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.surat-preview .kop-surat img {
    width: 70px;
    float: left;
    margin-right: 15px;
}

.surat-preview .kop-surat h3 {
    font-size: 14px;
    margin-bottom: 2px;
}

.surat-preview .kop-surat h2 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 2px;
}

.surat-preview .kop-surat p {
    font-size: 11px;
    margin: 0;
}

.surat-preview .data-table td {
    padding: 2px 10px;
    vertical-align: top;
    font-size: 13px;
}

.surat-preview .data-table td:first-child {
    width: 180px;
    white-space: nowrap;
}

.surat-preview .data-table td:nth-child(2) {
    width: 10px;
}

/* ============================================
   LAPORAN PRINT
   ============================================ */
.laporan-wrapper {
    background: #fff;
    padding: 30px;
}

.laporan-wrapper .table thead th {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    font-size: 12px;
    text-align: center;
}

.laporan-wrapper .table tbody td {
    border: 1px solid #000;
    font-size: 12px;
    padding: 6px 8px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */
.sidebar-toggled .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-toggled .main-content {
    margin-left: 0;
}

@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.show {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 15px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* ============================================
   MISC
   ============================================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 15px;
    color: #ddd;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 8px;
}

.file-preview {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 12px;
    margin: 2px;
}

.file-preview a {
    color: var(--primary);
    text-decoration: none;
}

.file-preview a:hover {
    text-decoration: underline;
}

/* Print styles */
@media print {

    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }

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

    .content-wrapper {
        padding: 0 !important;
    }

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

/* ============================================
   CUSTOM MODAL PREVIEW ANIMATION
   ============================================ */
@keyframes pulse-anim {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(0.98);
    }
}

.animate-pulse {
    animation: pulse-anim 1.8s infinite ease-in-out;
    display: inline-block;
}

#previewContent img {
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#previewContent img:hover {
    transform: scale(1.015);
}