/* ============================================================
 * SIGAP BPS - Custom Stylesheet
 * Sistem Informasi Kenaikan Gaji Berkala Pegawai
 * Tema: Biru BPS dengan glassmorphism effects
 * ============================================================ */

/* ============================================================
 * Import Google Fonts
 * ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
 * CSS Variables (Design Tokens)
 * ============================================================ */
:root {
    /* Warna Utama BPS */
    --primary: #1B4F72;
    /* Biru tua BPS */
    --primary-light: #2E86C1;
    /* Biru muda */
    --primary-dark: #154360;
    /* Biru gelap */
    --secondary: #F39C12;
    /* Emas/kuning aksen */
    --secondary-light: #F5B041;
    --accent: #27AE60;
    /* Hijau untuk sukses */
    --danger: #E74C3C;
    --warning: #F39C12;
    --info: #3498DB;

    /* Background */
    --bg-gradient: linear-gradient(135deg, #1B4F72 0%, #2E86C1 50%, #154360 100%);
    --bg-sidebar: linear-gradient(180deg, #1B4F72 0%, #154360 100%);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.15);

    /* Text */
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #FFFFFF;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(46, 134, 193, 0.3);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transition */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar Width */
    --sidebar-width: 260px;
}

/* ============================================================
 * Reset & Base Styles
 * ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F0F3F8;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ============================================================
 * Login Page Styles
 * ============================================================ */
.login-page {
    min-height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated background circles */
.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 6s infinite ease-in-out;
}

.login-page::before {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

.login-page::after {
    width: 300px;
    height: 300px;
    bottom: -80px;
    left: -80px;
    animation-delay: 3s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.login-container {
    display: flex;
    width: 900px;
    max-width: 95%;
    min-height: 500px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

/* Sisi kiri - Form Login */
.login-left {
    flex: 1;
    background: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.login-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E8ECF0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: #F8FAFC;
}

.login-form .form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(46, 134, 193, 0.15);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Sisi kanan - Statistik KGB */
.login-right {
    flex: 1;
    background: var(--bg-gradient);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.stats-content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
}

.stats-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stats-content .year-badge {
    display: inline-block;
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 4px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 25px 20px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
}

.stat-card .stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: 500;
}

.stat-card.total .stat-number {
    color: #F5B041;
}

.stat-card.completed .stat-number {
    color: #58D68D;
}

/* ============================================================
 * Sidebar Styles
 * ============================================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

/* Logo area di sidebar */
.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    width: 50px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-header small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
}

/* Menu items */
.sidebar-menu {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li {
    margin: 2px 8px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu li a i {
    width: 20px;
    margin-right: 12px;
    font-size: 1rem;
    text-align: center;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(3px);
}

.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--secondary);
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 10px 20px;
}

/* User info di sidebar bawah */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    color: white;
}

.sidebar-footer .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 12px;
    color: var(--primary-dark);
}

.sidebar-footer .user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-footer .user-role {
    font-size: 0.72rem;
    opacity: 0.7;
}

.sidebar-footer .btn-logout {
    display: block;
    margin-top: 10px;
    padding: 8px;
    text-align: center;
    background: rgba(231, 76, 60, 0.2);
    color: #E74C3C;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-footer .btn-logout:hover {
    background: rgba(231, 76, 60, 0.4);
    color: white;
}

/* ============================================================
 * Main Content Area
 * ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

/* Top bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.topbar h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================================
 * Cards
 * ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 25px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 25px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFBFC;
}

.card-header h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.card-body {
    padding: 25px;
}

/* Dashboard stat cards */
.stat-card-dash {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.stat-card-dash:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.stat-card-dash.success {
    border-left-color: var(--accent);
}

.stat-card-dash.warning {
    border-left-color: var(--warning);
}

.stat-card-dash.info {
    border-left-color: var(--info);
}

.stat-card-dash .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.stat-card-dash .stat-icon.primary {
    background: rgba(27, 79, 114, 0.1);
    color: var(--primary);
}

.stat-card-dash .stat-icon.success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--accent);
}

.stat-card-dash .stat-icon.warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

/* ============================================================
 * Buttons
 * ============================================================ */
.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
}

.btn-primary-custom:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    color: white;
}

.btn-success-custom {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-success-custom:hover {
    background: #229954;
    color: white;
}

.btn-warning-custom {
    background: var(--warning);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger-custom {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

/* Action icon buttons */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
    margin: 0 2px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.action-btn.edit {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
}

.action-btn.edit:hover {
    background: var(--info);
    color: white;
}

.action-btn.send {
    background: rgba(39, 174, 96, 0.15);
    color: var(--accent);
}

.action-btn.send:hover {
    background: var(--accent);
    color: white;
}

.action-btn.view {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.action-btn.view:hover {
    background: var(--warning);
    color: white;
}

.action-btn.delete {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.action-btn.delete:hover {
    background: var(--danger);
    color: white;
}

.action-btn.approve {
    background: rgba(39, 174, 96, 0.15);
    color: var(--accent);
}

.action-btn.approve:hover {
    background: var(--accent);
    color: white;
}

.action-btn.reject {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.action-btn.reject:hover {
    background: var(--danger);
    color: white;
}

.action-btn.download {
    background: rgba(27, 79, 114, 0.15);
    color: var(--primary);
}

.action-btn.download:hover {
    background: var(--primary);
    color: white;
}

.action-btn.process {
    background: rgba(46, 134, 193, 0.15);
    color: var(--primary-light);
}

.action-btn.process:hover {
    background: var(--primary-light);
    color: white;
}

/* ============================================================
 * Status Badges
 * ============================================================ */
.badge-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-draft {
    background: #EBF5FB;
    color: #2E86C1;
}

.badge-menunggu-koordinator {
    background: #FEF9E7;
    color: #F39C12;
}

.badge-menunggu-kepala {
    background: #FDEBD0;
    color: #E67E22;
}

.badge-ditolak-koordinator {
    background: #FDEDEC;
    color: #E74C3C;
}

.badge-ditolak-kepala {
    background: #F9EBEA;
    color: #C0392B;
}

.badge-disetujui {
    background: #EAFAF1;
    color: #27AE60;
}

.badge-aktif {
    background: #EAFAF1;
    color: #27AE60;
}

.badge-nonaktif {
    background: #FDEDEC;
    color: #E74C3C;
}

/* ============================================================
 * Tables
 * ============================================================ */
.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead th {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.table-modern tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid #F0F0F0;
}

.table-modern tbody tr:hover {
    background: #F8FAFC;
}

.table-modern tbody td {
    padding: 12px 15px;
    font-size: 0.85rem;
    vertical-align: middle;
}

/* DataTable overrides */
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #E8ECF0;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: 'Inter', sans-serif;
}

.dataTables_wrapper .dataTables_length select {
    border: 2px solid #E8ECF0;
    border-radius: var(--radius-sm);
    padding: 6px 28px 6px 12px;
    font-family: 'Inter', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 70px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    cursor: pointer;
}

/* Icon-only header buttons */
.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.btn-icon-only:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-icon-only.btn-tambah {
    background: var(--primary);
    color: white;
}

.btn-icon-only.btn-tambah:hover {
    background: var(--primary-light);
    color: white;
}

.btn-icon-only.btn-template {
    background: var(--accent);
    color: white;
}

.btn-icon-only.btn-template:hover {
    background: #229954;
    color: white;
}

.btn-icon-only.btn-import {
    background: var(--warning);
    color: white;
}

.btn-icon-only.btn-import:hover {
    background: #d68910;
    color: white;
}

.btn-icon-only.btn-export {
    background: var(--info);
    color: white;
}

.btn-icon-only.btn-export:hover {
    background: #2980b9;
    color: white;
}

/* ============================================================
 * Flash Messages
 * ============================================================ */
.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-success {
    background: #EAFAF1;
    color: #27AE60;
    border-left: 4px solid #27AE60;
}

.flash-error {
    background: #FDEDEC;
    color: #E74C3C;
    border-left: 4px solid #E74C3C;
}

.flash-warning {
    background: #FEF9E7;
    color: #F39C12;
    border-left: 4px solid #F39C12;
}

.flash-info {
    background: #EBF5FB;
    color: #2E86C1;
    border-left: 4px solid #2E86C1;
}

/* ============================================================
 * Modal Custom Styles
 * ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 18px 25px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-right {
        padding: 30px 20px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

/* ============================================================
 * Utilities
 * ============================================================ */
.text-primary-custom {
    color: var(--primary) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.bg-primary-custom {
    background: var(--primary) !important;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

/* Print styles */
@media print {

    .sidebar,
    .topbar,
    .btn,
    .action-btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}