/* SIM MBG Custom Styles - AdminLTE Inspired */
:root {
    --primary-red: #dc2626;
    --primary-red-dark: #b91c1c;
    --primary-red-light: #f87171;
    --creamy-bg: #fefcf9;
    --creamy-light: #fffef7;
    --text-dark: #374151;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--creamy-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 220px;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    border-radius: 0 1px 1px 0;
}

.sidebar-header {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.2;
}

.sidebar-header small {
    opacity: 0.8;
    font-size: 0.8rem;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu .nav-item:first-child {
    border-top: none;
}

.nav-menu .nav-item:last-child {
    border-bottom: none;
}

.nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    line-height: 1.3;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--creamy-light);
    text-decoration: none;
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* Submenu Styles */
.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-sublink {
    padding: 6px 15px 6px 35px;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
}

.nav-sublink:hover,
.nav-sublink.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: var(--creamy-light);
}

/* Main Content */
.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    padding: 12px 25px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 1px 1px;
}

.header-content {
    display: flex;
    justify-content: between;
    align-items: center;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-red);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Content Area */
.content {
    flex: 1;
    padding: 20px;
    background-color: var(--creamy-bg);
}

.content-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: var(--text-light);
}

.breadcrumb-item.active {
    color: var(--primary-red);
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--creamy-light);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-red-dark);
    border-color: var(--primary-red-dark);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: 0;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-dark);
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    vertical-align: top;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--creamy-light);
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(220, 38, 38, 0.05);
}

/* Dashboard Stats */
.stats-card {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: white;
    padding: 25px;
    border-radius: 1px;
    border: 1px solid var(--primary-red);
    margin-bottom: 20px;
    text-align: center;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stats-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background: white;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar,
    .compact-sidebar .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 250px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content,
    .compact-sidebar .main-content {
        margin-left: 0;
    }

    .content {
        padding: 15px;
    }

    .header {
        padding: 15px;
    }
}

/* Grid System */
.container { 
    width: 100%; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

.row { 
    display: flex; 
    flex-wrap: wrap; 
    margin: 0 -15px; 
}

.col, .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
    padding: 0 15px;
    flex: 1;
}

.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 768px) {
    .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

/* Compact Layout for Management Pages */
.compact-sidebar .sidebar {
    width: 200px;
}

.compact-sidebar .main-content {
    margin-left: 200px;
}

.compact-sidebar .nav-link {
    padding: 6px 12px;
    font-size: 0.85rem;
    line-height: 1.2;
}

.compact-sidebar .nav-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    font-size: 0.8rem;
}

.compact-sidebar .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.compact-sidebar .sidebar-header {
    padding: 12px 8px;
}

.compact-sidebar .sidebar-header h3 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.compact-sidebar .sidebar-header small {
    font-size: 0.75rem;
}

/* Compact table and cards */
.compact-sidebar .card-body {
    padding: 15px;
}

.compact-sidebar .card-header {
    padding: 15px;
}

.compact-sidebar .table th,
.compact-sidebar .table td {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.compact-sidebar .content {
    padding: 15px;
}

.compact-sidebar .content-header {
    margin-bottom: 15px;
}

/* Extra tight spacing for menu items */
.nav-menu .nav-item + .nav-item {
    margin-top: 0;
}

.compact-sidebar .nav-menu .nav-item {
    margin: 0;
}

/* Remove any potential gaps */
.sidebar ul, .sidebar li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar .nav-menu li {
    margin-bottom: 0;
    margin-top: 0;
}

/* Ensure no browser default spacing */
.sidebar * {
    box-sizing: border-box;
}

/* Tighter line spacing for nav text */
.nav-link {
    white-space: nowrap;
    overflow: hidden;
}

.compact-sidebar .nav-link {
    white-space: nowrap;
    overflow: hidden;
}

/* Ultra-compact mode for management pages */
.ultra-compact .nav-link {
    padding: 6px 12px;
    font-size: 0.85rem;
    line-height: 1.1;
}

.ultra-compact .nav-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    font-size: 0.75rem;
}

.ultra-compact .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.ultra-compact .sidebar-header {
    padding: 10px 8px;
}

.ultra-compact .sidebar-header h3 {
    font-size: 0.95rem;
    margin-bottom: 1px;
    line-height: 1.1;
}

.ultra-compact .sidebar-header small {
    font-size: 0.7rem;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-light); }
.text-primary { color: var(--primary-red); }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }

/* Spacing */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Flex utilities */
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }

/* Width utilities */
.w-25 { width: 25%; }
.w-50 { width: 50%; }
.w-75 { width: 75%; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Alert Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 1px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}