/* ==========================================
   Local css
   ========================================== */

:root {
    --header-height: 60px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
    --primary-color: #4099ff;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --border-color: #ddd;
    --header-bg: #ffffff;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --sidebar-hover: #34495e;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

a {
    color: #D97D55;
}

a:visited {
    color: #D97D55;
}

a:hover {
    color: #c06844;
}

a:active {
    color: #D97D55;
}

/* ==========================================
   Header Styles
   ========================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-nav {
    display: flex;
    list-style: none;
    gap: 15px;
}

.header-nav a {
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 14px;
}

.header-nav a:hover {
    background-color: var(--bg-color);
}

/* ==========================================
   Sidebar Styles
   ========================================== */

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-collapsed-width);
    height: calc(100vh - var(--header-height));
    background-color: var(--header-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    padding: 20px 0;
    transition: width 0.3s ease;
}

.sidebar:hover {
    width: var(--sidebar-width);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: 5px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
    font-size: 14px;
}

.sidebar-menu-link span:not(.sidebar-menu-icon) {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover .sidebar-menu-link span:not(.sidebar-menu-icon) {
    opacity: 1;
}

.sidebar-menu-link:hover {
    background-color: var(--header-bg);
}

.sidebar-menu-link.active {
    background-color: var(--primary-color);
}

.sidebar-menu-icon {
    margin-right: 12px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
    min-width: 20px;
    display: inline-flex;
    justify-content: center;
}

.sidebar-section-title {
    padding: 20px 20px 10px;
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.sidebar:hover .sidebar-section-title {
    opacity: 1;
}

/* ==========================================
   Main Content Area
   ========================================== */

.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-collapsed-width);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   Responsive Design
   ========================================== */

#mobile-sidebar-toggle {
    display: none;
}

.mobile-nav-item {
    display: none;
}

@media (max-width: 768px) {
    .mobile-nav-item {
        display: block;
    }
    #mobile-sidebar-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-width);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header-left {
        gap: 10px;
    }

    .header-nav {
        display: none;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6FA4AF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #5a8a94;
}

/* ==========================================
   Scrollbar Styling (Optional)
   ========================================== */

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   Bootstrap-compatible Grid & Components
   ========================================== */

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

[class*="col-"] {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Card Component (already defined but adding card-header and card-body) */
.card-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-control, input[type="text"], input[type="email"], input[type="password"], textarea {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(64, 153, 255, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Table */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    vertical-align: top;
    border-top: 1px solid var(--border-color);
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
}

.table tbody + tbody {
    border-top: 2px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 12px 20px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.text-c-red {
    color: var(--danger, #FF5370);
}

.mb-2 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.w-25 { width: 25%; }
.w-100 { width: 100%; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-color);
}

.btn-icon:hover {
    background-color: var(--bg-color);
    border-radius: 4px;
}

/* Progress Bar */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    background-color: #e9ecef;
    border-radius: 4px;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    text-align: center;
    background-color: var(--primary-color);
    transition: width 0.6s ease;
}

.progress-bar-label {
    font-size: 12px;
}

/* Tabs */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.nav-item {
    margin-bottom: -1px;
}

.nav-link {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid transparent;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.nav-link:hover {
    border-color: var(--border-color) var(--border-color) transparent;
}

.nav-link.active {
    color: var(--primary-color);
    background-color: white;
    border-color: var(--border-color) var(--border-color) white;
}

.tab-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane.show {
    display: block;
}
