/**
 * RUHONDO BEACH RESORT HMS + POS System
 * Main Stylesheet - FIXED LAYOUT VERSION
 * Developer: JOACHIM'S INNOTECH
 * Version: 1.0.0
 */

/* =============================================
   RESET & BASE STYLES
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    --font-family-sans: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    --border-radius: 0.25rem;
    --box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    
    /* Sidebar width */
    --sidebar-width: 250px;
}

body {
    font-family: var(--font-family-sans);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-100);
    overflow-x: hidden;
    min-height: 100vh;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* =============================================
   LAYOUT - FIXED FOR ADMIN LTE
   ============================================= */
.wrapper {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.content-wrapper {
    background-color: var(--gray-100);
    padding: 1.5rem;
    min-height: calc(100vh - 3.5rem);
    transition: margin-left 0.3s ease-in-out;
}

/* Main Header */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 3.5rem;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

/* Main Footer */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-300);
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* =============================================
   SIDEBAR - FIXED POSITIONING
   ============================================= */
.main-sidebar {
    background: var(--dark-color);
    color: var(--white);
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1035;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

/* Brand link in sidebar */
.brand-link {
    display: block;
    padding: 0.8125rem 0.5rem;
    font-size: 1.25rem;
    line-height: 1.5;
    text-align: center;
    border-bottom: 1px solid #4b545c;
    color: var(--white);
    background-color: var(--dark-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User panel in sidebar */
.user-panel {
    padding: 1rem;
    border-bottom: 1px solid #4b545c;
}

.user-panel .info {
    color: var(--white);
}

/* Sidebar navigation */
.nav-sidebar {
    padding: 0.5rem 0;
}

.nav-sidebar .nav-item {
    position: relative;
    margin: 0;
}

.nav-sidebar .nav-link {
    color: #c2c7d0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.nav-sidebar .nav-link:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
}

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

.nav-sidebar .nav-link .nav-icon {
    margin-right: 0.5rem;
    width: 1.5rem;
    text-align: center;
}

.nav-sidebar .nav-link p {
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-sidebar .nav-link p .right {
    float: right;
}

/* Treeview menu (nested) */
.nav-treeview {
    padding-left: 0;
    list-style: none;
    background-color: rgba(0, 0, 0, 0.2);
}

.nav-treeview .nav-item {
    position: relative;
}

.nav-treeview .nav-link {
    padding-left: 2.5rem;
}

.nav-treeview .nav-link .nav-icon {
    margin-left: -0.5rem;
    width: 1.5rem;
    font-size: 0.8rem;
}

/* Content wrapper margin when sidebar is visible */
.content-wrapper {
    margin-left: var(--sidebar-width);
}

/* Sidebar collapsed state */
.sidebar-collapse .main-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-collapse .content-wrapper {
    margin-left: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .main-sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    
    .content-wrapper {
        margin-left: 0 !important;
    }
    
    .sidebar-open .main-sidebar {
        transform: translateX(0);
    }
}

/* =============================================
   CARDS - ENHANCED
   ============================================= */
.card {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    width: 100%;
}

.card-header {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-300);
    padding: 1rem 1.25rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Stat Cards */
.small-box {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    color: var(--white);
    transition: var(--transition);
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.small-box .inner {
    padding: 1.5rem;
}

.small-box h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    white-space: nowrap;
}

.small-box p {
    font-size: 1rem;
    margin-bottom: 0;
}

.small-box .icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 4rem;
    opacity: 0.3;
    color: rgba(0,0,0,0.2);
    transition: var(--transition);
}

.small-box:hover .icon {
    font-size: 4.5rem;
}

.small-box-footer {
    display: block;
    padding: 0.5rem;
    text-align: center;
    background: rgba(0,0,0,0.1);
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.small-box-footer:hover {
    background: rgba(0,0,0,0.2);
    color: var(--white);
}

/* =============================================
   TABLES
   ============================================= */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background: var(--white);
    border-collapse: collapse;
}

.table th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-300);
    padding: 0.75rem;
    font-weight: 600;
    text-align: left;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-300);
}

.table-hover tbody tr:hover {
    background: var(--gray-100);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 1rem;
}

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

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--white);
    border: 1px solid var(--gray-400);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--white);
}

.btn-info {
    background: var(--info-color);
    border-color: var(--info-color);
    color: var(--white);
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: var(--gray-900);
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--white);
}

/* =============================================
   BADGES
   ============================================= */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--border-radius);
}

.badge-success { background: var(--success-color); color: var(--white); }
.badge-warning { background: var(--warning-color); color: var(--gray-900); }
.badge-danger { background: var(--danger-color); color: var(--white); }
.badge-info { background: var(--info-color); color: var(--white); }
.badge-primary { background: var(--primary-color); color: var(--white); }

/* =============================================
   PROGRESS BARS
   ============================================= */
.progress {
    display: flex;
    height: 0.75rem;
    overflow: hidden;
    font-size: 0.625rem;
    background: var(--gray-200);
    border-radius: var(--border-radius);
}

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

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: var(--gray-200);
    border-radius: var(--border-radius);
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    float: left;
    padding-right: 0.5rem;
    color: var(--gray-600);
    content: "/";
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.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: #ffeeba;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* =============================================
   LIST GROUP
   ============================================= */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 0.75rem 1.25rem;
    margin-bottom: -1px;
    background-color: var(--white);
    border: 1px solid var(--gray-300);
}

.list-group-item:first-child {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.list-group-item:last-child {
    margin-bottom: 0;
    border-bottom-right-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

/* =============================================
   TIMELINE
   ============================================= */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline-item {
    position: relative;
    padding-bottom: 1rem;
    padding-left: 2rem;
    border-left: 2px solid var(--gray-300);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item .time {
    position: absolute;
    left: -0.5rem;
    top: 0;
    color: var(--gray-600);
    font-size: 0.75rem;
    white-space: nowrap;
}

.timeline-item .timeline-body {
    padding: 0.5rem 0 0 1rem;
}

/* =============================================
   DASHBOARD SPECIFIC FIXES
   ============================================= */
.small-box .inner h3 {
    font-size: 2rem;
    font-weight: bold;
}

.small-box .inner p {
    font-size: 1rem;
    margin: 0;
}

/* Fix for dashboard cards layout */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-md-3, .col-md-4, .col-md-6, .col-md-8 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (min-width: 768px) {
    .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%; }
}

/* Fix for table display */
.table td, .table th {
    vertical-align: middle;
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }
    
    .small-box h3 {
        font-size: 1.5rem;
    }
    
    .small-box .icon {
        font-size: 3rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Background colors */
.bg-info { background-color: var(--info-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-dark { background-color: var(--dark-color) !important; }