:root {
    --primary-blue: #1e3a8a;
    --secondary-blue: #3b82f6;
    --light-blue: #dbeafe;
    --dark-blue: #1e40af;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    width: 80px;
    height: 80px;
    margin-right: 1rem;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.header-text p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Navigation */
.navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 500;
    padding: 1rem 0;
    display: block;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--secondary-blue);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background: var(--light-blue);
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h2 {
    color: var(--primary-blue);
    margin: 0;
    font-size: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

/* Table responsive untuk teks panjang */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Kolom khusus untuk teks panjang */
.table td.long-text {
    max-width: 300px;
    min-width: 150px;
}

.table th {
    background-color: var(--light-blue);
    color: var(--primary-blue);
    font-weight: 600;
    white-space: nowrap;
}

/* Status Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    min-width: 100px;
}

.badge-menunggu {
    background-color: #E4A11B;
    color: #ffffff;
}

.badge-disetujui {
    background-color: #14A44D;
    color: #ffffff;
}

.badge-ditolak {
    background-color: #DC4C64;
    color: #ffffff;
}

.badge-dijadwalkan {
    background-color: #007BFF;
    color: #ffffff;
}

.badge-selesai {
    background-color: #28A745;
    color: #ffffff;
}

.badge-dibatalkan {
    background-color: #6C757D;
    color: #ffffff;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

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

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

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

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

/* Footer */
.footer {
    background-color: var(--primary-blue);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.close {
    color: #6b7280;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.close:hover {
    color: #374151;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Notification */
.notification-badge {
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Error Styles */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control.error {
    border-color: #ef4444;
}

/* Success Styles */
.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Calendar Styles */
.calendar {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
    flex-grow: 1;
}

.btn-calendar-nav {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-calendar-nav:hover {
    background: var(--secondary-blue);
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day-header {
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
}

.calendar-day {
    background: white;
    padding: 0.5rem;
    min-height: 120px;
    font-size: 0.875rem;
    position: relative;
    border: 1px solid #e2e8f0;
}

.calendar-day.empty {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.calendar-day.today {
    background: var(--light-blue);
}

.calendar-date {
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: var(--primary-blue);
}

.calendar-day.today .calendar-date {
    color: var(--secondary-blue);
}

.calendar-event {
    background: var(--secondary-blue);
    color: white;
    padding: 0.25rem 0.5rem;
    margin-top: 0.25rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-time {
    font-size: 0.7rem;
    opacity: 0.9;
    margin-bottom: 0.1rem;
}

.event-title {
    font-weight: 500;
    max-width: 118px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-more {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.25rem;
    text-align: center;
    font-style: italic;
}

/* Availability Info Styles */
.availability-info {
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin: 2px 0;
    text-align: center;
    font-weight: bold;
}

.availability-info.available {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.availability-info.full {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Calendar Day Full State */
.calendar-day.full-day {
    background-color: #fef2f2;
    position: relative;
}

.calendar-day.full-day::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 90%, #fecaca 90%);
    pointer-events: none;
}

/* Event Details Modal */
.event-details {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.event-details-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.event-details-content h4 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 0.5rem;
}

.event-detail-item {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.event-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.event-detail-item strong {
    color: var(--primary-blue);
    display: inline-block;
    min-width: 120px;
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 768px) {
    /* Header Responsive */
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    /* Navigation Responsive */
    .nav-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-menu a {
        padding: 0.75rem 0;
        border-bottom: 1px solid #e2e8f0;
    }
    
    /* Table Responsive */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th, .table td {
        padding: 8px 6px;
        font-size: 0.875rem;
    }
    
    .table td.long-text {
        max-width: 200px;
        min-width: 120px;
    }
    
    /* Card Responsive */
    .card-body {
        padding: 1rem;
    }
    
    /* Stats Grid Responsive */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Calendar Responsive */
    .calendar {
        padding: 1rem;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .calendar-event {
        padding: 0.1rem 0.25rem;
        font-size: 0.65rem;
    }
    
    .event-time {
        display: none;
    }
    
    .calendar-date {
        font-size: 0.75rem;
    }
    
    .event-title {
        max-width: 70px;
    }
    
    /* Form Responsive */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 0.5rem 0.75rem;
    }
    
    /* Button Responsive */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Modal Responsive */
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header, .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    /* Calendar Mobile Layout */
    .calendar-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-day-header {
        display: none;
    }
    
    .calendar-day {
        min-height: auto;
        border: 1px solid #e2e8f0;
        margin-bottom: 0.5rem;
        border-radius: 6px;
        padding: 0.75rem;
    }
    
    .calendar-date {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .calendar-event {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        margin: 0.25rem 0;
    }
    
    .event-title {
        max-width: none;
        white-space: normal;
    }
    
    /* Header Text Mobile */
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .header-text p {
        font-size: 0.9rem;
    }
    
    /* Card Header Mobile */
    .card-header h2 {
        font-size: 1.3rem;
    }
    
    /* Stats Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Badge Mobile */
    .badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
}

/* Text Truncation Helper Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    white-space: normal;
    word-wrap: break-word;
}

/* Mobile-first helper classes */
.mobile-hidden {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
}