/* ==========================================
   CUSTOM CSS - SPP SMK Jambi Medan
   ========================================== */

:root {
    --primary-color: #2ecc71;
    --secondary-color: #27ae60;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --success-color: #27ae60;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* ==========================================
   LOGIN PAGE STYLES
   ========================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: var(--gradient-success);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.login-body {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
}

.form-control {
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
    outline: none;
}

.btn-login {
    background: var(--gradient-success);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.alert {
    border-radius: 10px;
    border: none;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ==========================================
   DASHBOARD STYLES
   ========================================== */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-brand {
    padding: 25px 20px;
    background: rgba(0,0,0,0.2);
    text-align: center;
}

.sidebar-brand h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #b8c7ce;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 4px solid var(--primary-color);
}

.sidebar-menu a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: all 0.3s ease;
}

/* Top Navbar */
.top-navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-color);
    margin-right: 20px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-success);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Content Area */
.content-area {
    padding: 30px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--gradient-success);
}

.stat-card.success::before { background: var(--gradient-success); }
.stat-card.primary::before { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.info::before { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
.stat-card.warning::before { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-title {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card.success .stat-icon { background: rgba(46, 204, 113, 0.1); color: var(--success-color); }
.stat-card.primary .stat-icon { background: rgba(102, 126, 234, 0.1); color: #667eea; }
.stat-card.info .stat-icon { background: rgba(52, 152, 219, 0.1); color: var(--info-color); }
.stat-card.warning .stat-icon { background: rgba(243, 156, 18, 0.1); color: var(--warning-color); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #95a5a6;
}

/* Cards */
.card-custom {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-header-custom {
    padding: 20px 25px;
    border-bottom: 2px solid #f5f7fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-custom h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
}

.card-body-custom {
    padding: 25px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Table */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom thead {
    background: var(--dark-color);
    color: white;
}

.table-custom th,
.table-custom td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.table-custom tbody tr:hover {
    background: #f8f9fa;
}

/* Badge */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

/* Form Elements */
.form-control, .form-select {
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
    outline: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .top-navbar {
        padding: 15px;
    }
    
    .navbar-right .user-info span {
        display: none;
    }
}

@media (max-width: 576px) {
    .login-header {
        padding: 30px 20px;
    }
    
    .login-body {
        padding: 30px 20px;
    }
    
    .card-header-custom,
    .card-body-custom {
        padding: 15px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded-lg { border-radius: 15px !important; }

.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }
.p-3 { padding: 1rem; }


/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9, .col-md-12,
.col-sm-6, .col-sm-12 {
    padding: 10px;
}

.col-md-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; }
.col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }

.col-sm-12 { flex: 0 0 100%; max-width: 100%; }
.col-sm-6 { flex: 0 0 50%; max-width: 50%; }

@media (max-width: 768px) {
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Text Center */
.text-center { text-align: center !important; }
.text-muted { color: #95a5a6 !important; }

/* Py-4 */
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

/* w-100 */
.w-100 { width: 100% !important; }

/* mb-2, mb-3 */
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-3 { margin-top: 1rem !important; }

/* btn-sm */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tambahan untuk Tabel & Tombol Aksi */
.table-custom .btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.table-custom td {
    vertical-align: middle;
}

/* Perbaikan Grid Padding di dalam Card */
.card-body-custom .row {
    margin: -10px;
}
.card-body-custom .row > div {
    padding: 10px;
}

/* Efek Hover pada Sidebar di Mobile */
@media (max-width: 768px) {
    .sidebar.active {
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    }
    
    .stat-value {
        font-size: 24px !important;
    }
}