/* assets/css/admin.css */
/* Stylesheet untuk Panel Admin Kos Management */

/* ===== VARIABLES & RESET ===== */
:root {
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #4dabf7;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --border-color: #dee2e6;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    line-height: 1.6;
    color: #333;
}

/* ===== LAYOUT UTAMA ===== */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h2 i {
    color: var(--accent-color);
}

.sidebar-collapsed .sidebar-header h2 span {
    display: none;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--accent-color);
}

.menu-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--accent-color);
}

.menu-item i {
    width: 20px;
    margin-right: 15px;
    font-size: 1.1rem;
}

.menu-item span {
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .menu-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* ===== MAIN CONTENT ===== */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed .admin-main {
    margin-left: var(--sidebar-collapsed-width);
}

/* ===== HEADER ===== */
.admin-header {
    background: white;
    padding: 0 30px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.toggle-sidebar:hover {
    color: var(--primary-color);
    background-color: var(--light-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background-color: var(--light-color);
    border-radius: 20px;
}

.admin-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.admin-details {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-role {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.btn-logout {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* ===== CONTENT AREA ===== */
.admin-content {
    padding: 30px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header p {
    color: var(--gray-color);
    font-size: 1rem;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: white;
    font-size: 1.5rem;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-detail {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.stat-detail.kosong {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.stat-detail.terisi {
    background-color: #e3f2fd;
    color: #1565c0;
}

.stat-detail.maintenance {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quick-actions h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    background: var(--light-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    text-align: center;
}

.action-card:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.2);
}

.action-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.action-card span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== TABEL ===== */
.data-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.table-header {
    padding: 20px 25px;
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: between;
    align-items: center;
}

.table-header h3 {
    color: var(--primary-color);
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* ===== BADGES ===== */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background-color: #fff3e0;
    color: #ef6c00;
}

.badge-danger {
    background-color: #ffebee;
    color: #c62828;
}

.badge-info {
    background-color: #e3f2fd;
    color: #1565c0;
}

.badge-secondary {
    background-color: #f5f5f5;
    color: #666;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--gray-color);
}

.btn-outline:hover {
    background-color: var(--light-color);
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== ACTIVITY FEED ===== */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary-color);
}

.activity-content p {
    font-weight: 500;
    margin-bottom: 5px;
}

.activity-content small {
    color: var(--gray-color);
    font-size: 0.8rem;
}

/* ===== WARNINGS & ALERTS ===== */
.warning-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.warning-item {
    display: flex;
    padding: 15px;
    border-radius: 8px;
    align-items: center;
    border-left: 4px solid;
}

.warning-item i {
    font-size: 1.5rem;
    margin-right: 15px;
}

.warning-content strong {
    display: block;
    margin-bottom: 5px;
}

.warning-item.overdue {
    background-color: #ffebee;
    border-left-color: var(--danger-color);
}

.warning-item.overdue i {
    color: var(--danger-color);
}

.warning-item.pending {
    background-color: #fff3e0;
    border-left-color: var(--warning-color);
}

.warning-item.pending i {
    color: var(--warning-color);
}

.warning-item.empty {
    background-color: #e8f5e9;
    border-left-color: var(--success-color);
}

.warning-item.empty i {
    color: var(--success-color);
}

.warning-item.all-good {
    background-color: #e3f2fd;
    border-left-color: var(--accent-color);
}

.warning-item.all-good i {
    color: var(--accent-color);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray-color);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar-mobile-open .admin-sidebar {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-collapsed .admin-main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-right {
        gap: 10px;
    }
    
    .admin-info .admin-details {
        display: none;
    }
}

@media (max-width: 480px) {
    .admin-content {
        padding: 15px;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.p-0 { padding: 0; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.d-flex { display: flex; }
.d-none { display: none; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== PRINT STYLES ===== */
@media print {
    .admin-sidebar,
    .admin-header,
    .btn,
    .table-actions {
        display: none !important;
    }
    
    .admin-main {
        margin-left: 0 !important;
    }
    
    .admin-content {
        padding: 0;
    }
    
    .stat-card,
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}