/* ========================================
   DESIGN SYSTEM - SIDEBAR LAYOUT
   ======================================== */

:root {
    /* PRIMARY COLORS */
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #10b981;
    --accent: #06b6d4;
    --warning: #f59e0b;
    
    /* NEUTRAL COLORS */
    --dark: #1e293b;
    --gray-600: #4b5563;
    --gray-400: #94a3b8;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --white: #ffffff;
    
    /* SHADOWS */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* SPACING */
    --radius: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--white);
    color: var(--dark);
    line-height: 1.6;
}

/* ========================================
   NAVBAR - MINIMAL TOP BAR
   ======================================== */

.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
    color: white !important;
    margin-left: 1rem;
}

.navbar-brand i {
    margin-right: 8px;
}

.navbar a {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: color 0.3s;
    margin: 0 8px;
}

.navbar a:hover {
    color: white !important;
}

.navbar-text {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 6px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */

.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid var(--gray-200);
    padding: 30px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-section {
    padding: 0 20px;
    margin-bottom: 40px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
}

.sidebar-menu a i {
    margin-right: 10px;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.sidebar-menu a:not(.active) {
    color: #475569;
}

.sidebar-menu a:not(.active):hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.sidebar-divider {
    border-top: 1px solid var(--gray-200);
    margin: 30px 0;
    padding-top: 30px;
}

.sidebar-profile {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    margin-bottom: 12px;
}

.sidebar-profile-label {
    font-size: 12px;
    color: var(--gray-400);
    margin: 0 0 6px 0;
}

.sidebar-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 12px 0;
}

.sidebar-profile-badge {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.main-content {
    margin-left: 280px;
    padding: 40px;
    background: white;
}

/* ========================================
   FORMS - CLEAN STYLING
   ======================================== */

.form-control, .form-select {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    font-size: 14px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    padding: 10px 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--accent) 0%, #0891b2 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline-primary {
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 15px;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    border: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-header h5 {
    margin: 0;
    font-size: 16px;
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   TABLES
   ======================================== */

.table {
    margin-bottom: 0;
    overflow-x: auto;
}

.table thead {
    background: var(--gray-100);
}

.table thead th {
    border: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 13px;
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.3s;
}

.table tbody tr:hover {
    background: var(--gray-100);
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    font-size: 14px;
}

/* Responsive table wrapper */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table {
        font-size: 13px;
    }
    
    .table thead th {
        padding: 8px;
        font-size: 11px;
    }
    
    .table tbody td {
        padding: 8px;
        font-size: 12px;
    }
    
    /* Hide less important columns on mobile */
    .table th:nth-child(n+4),
    .table td:nth-child(n+4) {
        display: none;
    }
    
    /* Show action buttons */
    .table th:last-child,
    .table td:last-child {
        display: table-cell;
    }
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    border: none;
    border-radius: var(--radius);
    border-left: 4px solid;
}

.alert-info {
    background: #f0f9ff;
    border-left-color: var(--accent);
    color: #0c4a6e;
}

.alert-success {
    background: #f0fdf4;
    border-left-color: var(--secondary);
    color: #14532d;
}

.alert-warning {
    background: #fffbeb;
    border-left-color: var(--warning);
    color: #78350f;
}

.alert-danger {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #7f1d1d;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

.bg-success {
    background: var(--secondary) !important;
}

.bg-danger {
    background: #ef4444 !important;
}

.bg-warning {
    background: var(--warning) !important;
}

.bg-info {
    background: var(--accent) !important;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-muted {
    color: var(--gray-400) !important;
}

.text-dark {
    color: var(--dark) !important;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Sidebar Overlay */
.sidebar-overlay {
    display: none !important;
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 998 !important;
}

.sidebar-overlay.active {
    display: block !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile First - ALL screens below 1024px */
@media (max-width: 1024px) {
    #theme-sidebar,
    .sidebar {
        position: fixed !important;
        left: -100vw !important;
        top: 56px !important;
        width: 70vw !important;
        max-width: 280px !important;
        height: calc(100vh - 56px) !important;
        background: white !important;
        border-right: 1px solid #e2e8f0 !important;
        padding: 20px 0 !important;
        margin: 0 !important;
        overflow-y: auto !important;
        z-index: 999 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: block !important;
    }
    
    #theme-sidebar.active,
    .sidebar.active {
        left: 0 !important;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2) !important;
    }
    
    .navbar-toggler-custom {
        display: block !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .sidebar-overlay.active {
        display: block !important;
    }
}

/* All Small Screens - Tablet and Below (max 992px) */
@media (max-width: 992px) {
    #theme-sidebar,
    .sidebar {
        left: -100vw !important;
    }
    
    #theme-sidebar.active,
    .sidebar.active {
        left: 0 !important;
    }
    
    .navbar-toggler-custom {
        display: block !important;
    }
}

/* iPad & Small Tablets (768px -  1024px) */
@media (max-width: 768px) {
    .navbar-toggler-custom {
        display: block !important;
    }
}

/* Smartphone - Portrait (max 576px) */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    .navbar {
        padding: 10px 12px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
    }
    
    .navbar-brand {
        font-size: 16px !important;
        margin-left: 0 !important;
    }
    
    .navbar a {
        margin: 0 4px !important;
        font-size: 12px !important;
    }
    
    .navbar-toggler-custom {
        display: block !important;
    }
    
/* Sidebar Mobile */
    #theme-sidebar,
    .sidebar {
        position: fixed !important;
        left: -100vw !important;
        top: 56px !important;
        width: 75vw !important;
        max-width: 280px !important;
        height: calc(100vh - 56px) !important;
        background: white !important;
        border-right: 1px solid #e2e8f0 !important;
        padding: 20px 0 !important;
        overflow-y: auto !important;
        z-index: 999 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0) !important;
    }
    
    #theme-sidebar.active,
    .sidebar.active {
        left: 0 !important;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    #sidebarOverlay,
    .sidebar-overlay {
        display: none !important;
    }
    
    #sidebarOverlay.active,
    .sidebar-overlay.active {
        display: block !important;
    }
    
    /* Containers */
    .main-content,
    .pemeriksaan-main,
    .page-main,
    .dashboard-main {
        padding: 12px !important;
        overflow-y: auto !important;
        flex: 1 !important;
        width: 100% !important;
    }
    
    .pemeriksaan-container,
    .page-container,
    .dashboard-container {
        display: flex !important;
        flex-direction: column !important;
        min-height: calc(100vh - 56px) !important;
    }
    
    /* Typography */
    h1 {
        font-size: 20px !important;
        margin-bottom: 10px !important;
    }
    
    h2 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }
    
    h3 {
        font-size: 14px !important;
        margin-bottom: 6px !important;
    }
    
    p {
        font-size: 13px !important;
    }
    
    /* Tables responsive */
    .table {
        font-size: 11px !important;
        width: 100% !important;
    }
    
    .table thead th {
        padding: 6px !important;
        font-size: 10px !important;
    }
    
    .table tbody td {
        padding: 6px !important;
        font-size: 11px !important;
    }
    
    /* Cards responsive */
    .card {
        margin-bottom: 10px !important;
    }
    
    .card-body {
        padding: 12px !important;
    }
    
    .card-header {
        padding: 10px !important;
    }
    
    .card-header h5 {
        font-size: 13px !important;
    }
    
    /* Forms responsive */
    .form-control,
    .form-select {
        font-size: 16px !important;
        padding: 10px !important;
        margin-bottom: 10px !important;
        width: 100% !important;
    }
    
    label {
        font-size: 13px !important;
        margin-bottom: 4px !important;
    }
    
    /* Buttons responsive */
    .btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        width: 100% !important;
        margin-bottom: 8px !important;
        display: block !important;
    }
    
    .btn-sm {
        padding: 5px 8px !important;
        font-size: 11px !important;
        width: auto !important;
        display: inline-block !important;
        margin: 4px 4px 4px 0 !important;
    }
    
    .btn-lg {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    /* Grids - stack vertically */
    .stats-grid,
    .quick-actions-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    [style*="grid-template-columns: repeat"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Flexbox */
    [style*="display: flex"] {
        flex-wrap: wrap !important;
    }
    
    /* Alerts & Messages */
    .alert {
        font-size: 12px !important;
        padding: 10px !important;
        border-left-width: 3px !important;
    }
    
    /* Badges */
    .badge {
        font-size: 10px !important;
        padding: 3px 5px !important;
    }
    
    /* Sidebar menu */
    .sidebar-section {
        padding: 0 12px !important;
    }
    
    .sidebar-title {
        font-size: 10px !important;
    }
    
    .sidebar-menu a {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
    
    /* Full width elements */
    [style*="width: 280px"],
    [style*="width:280px"] {
        margin-left: 0 !important;
    }
}

/* Extra Small Devices (max 360px) */
@media (max-width: 360px) {
    .navbar-brand {
        font-size: 14px !important;
    }
    
    h1 {
        font-size: 18px !important;
    }
    
    .btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    .form-control {
        font-size: 14px !important;
        padding: 8px !important;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   RESPONSIVE UTILITY CLASSES
   ======================================== */

.flex-mobile-column {
    display: flex;
}

.gap-mobile-sm {
    gap: 10px;
}

.d-md-inline {
    display: inline;
}

@media (max-width: 576px) {
    .flex-mobile-column {
        flex-direction: column;
    }
    
    .d-md-inline {
        display: none;
    }
}

