/* JobBoss2 Style CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #4A90E2;
    --dark-blue: #357ABD;
    --light-blue: #E8F2FA;
    --header-gray: #E6E6E6;
    --sidebar-bg: #F5F5F5;
    --border-gray: #CCCCCC;
    --text-dark: #333333;
    --text-light: #666666;
    --row-blue: #D6E9F8;
    --row-white: #FFFFFF;
    --row-gray: #E0E0E0;
    --success-green: #5CB85C;
    --danger-red: #D9534F;
    --warning-orange: #F0AD4E;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    color: var(--text-dark);
    background: #F8F8F8;
}

/* =================================================================
   TOP HEADER BAR
   ================================================================= */
.top-header {
    height: 60px;
    background: var(--header-gray);
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #2C5AA0;
}

.jobboss-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.company-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.company-name {
    font-weight: 600;
}

.company-code {
    color: var(--text-light);
}

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

.header-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.header-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-dark);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.user-menu:hover {
    background: rgba(0,0,0,0.05);
}

.user-menu i {
    color: var(--primary-blue);
}

/* =================================================================
   MAIN CONTAINER & SIDEBAR
   ================================================================= */
.main-container {
    display: flex;
    margin-top: 60px;
    height: calc(100vh - 60px);
}

.sidebar {
    width: 200px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-gray);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 0;
}

.nav-item {
    border-bottom: 1px solid var(--border-gray);
    cursor: pointer;
    position: relative;
}

.nav-item > a,
.nav-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.2s;
}

.nav-item:hover > a,
.nav-item:hover > .nav-label {
    background: #E0E0E0;
}

.nav-item.active > a,
.nav-item.active > .nav-label {
    background: var(--light-blue);
    border-left: 3px solid var(--primary-blue);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    margin-right: 10px;
    color: var(--primary-blue);
}

.nav-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-light);
}

.nav-submenu {
    display: none;
    background: #FAFAFA;
    border-top: 1px solid var(--border-gray);
}

.nav-expandable.active .nav-submenu {
    display: block;
}

.nav-subitem {
    display: block;
    padding: 10px 15px 10px 45px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.2s;
}

.nav-subitem:hover {
    background: #E8E8E8;
}

.nav-subitem.active {
    background: var(--light-blue);
    font-weight: 600;
    color: var(--dark-blue);
}

.sidebar-toggle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    text-align: center;
    background: #E0E0E0;
    cursor: pointer;
    border-top: 1px solid var(--border-gray);
}

.sidebar-toggle:hover {
    background: #D0D0D0;
}

/* =================================================================
   MAIN CONTENT AREA
   ================================================================= */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: white;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.alert-success {
    background: #DFF0D8;
    border: 1px solid #D6E9C6;
    color: #3C763D;
}

.alert-error {
    background: #F2DEDE;
    border: 1px solid #EBCCD1;
    color: #A94442;
}

.alert-info {
    background: #D9EDF7;
    border: 1px solid #BCE8F1;
    color: #31708F;
}

.close-alert {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.close-alert:hover {
    opacity: 1;
}

/* =================================================================
   BREADCRUMBS & PAGE HEADER
   ================================================================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-gray);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-light);
}

/* Action Buttons */
.page-actions {
    display: flex;
    gap: 10px;
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

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

.btn-primary:hover {
    background: var(--dark-blue);
}

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

.btn-success:hover {
    background: #4CAE4C;
}

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

.btn-danger:hover {
    background: #C9302C;
}

.btn-secondary {
    background: #777;
    color: white;
}

.btn-secondary:hover {
    background: #666;
}

.btn-light {
    background: #F8F8F8;
    border: 1px solid var(--border-gray);
    color: var(--text-dark);
}

.btn-light:hover {
    background: #E8E8E8;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* =================================================================
   FORMS & INPUTS
   ================================================================= */
.form-section {
    margin-bottom: 25px;
}

.section-header {
    background: var(--light-blue);
    padding: 10px 15px;
    border-bottom: 2px solid var(--primary-blue);
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-blue);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.form-control {
    padding: 6px 10px;
    border: 1px solid var(--border-gray);
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

select.form-control {
    cursor: pointer;
    background: white;
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* =================================================================
   DATA GRIDS / TABLES
   ================================================================= */
.grid-container {
    margin-top: 15px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    overflow: hidden;
}

.grid-toolbar {
    background: #F5F5F5;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-grid thead {
    background: #E0E0E0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-grid th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-right: 1px solid var(--border-gray);
    border-bottom: 2px solid var(--border-gray);
    color: var(--text-dark);
    font-size: 12px;
}

.data-grid tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

/* Blue/White Alternating Rows - JobBoss2 Style */
.data-grid tbody tr:nth-child(odd) {
    background: var(--row-white);
}

.data-grid tbody tr:nth-child(even) {
    background: var(--row-blue);
}

.data-grid tbody tr:hover {
    background: #FFF8DC !important;
}

.data-grid tbody tr.selected {
    background: #B8D4F1 !important;
}

.data-grid td {
    padding: 8px 12px;
    border-right: 1px solid #DDD;
    border-bottom: 1px solid #DDD;
}

.data-grid td:last-child,
.data-grid th:last-child {
    border-right: none;
}

.no-data-row {
    padding: 40px;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    background: var(--row-gray) !important;
}

/* Editable Grid */
.grid-editable tbody tr:hover {
    background: #FFFACD !important;
}

.grid-cell-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--primary-blue);
    font-size: 13px;
    font-family: inherit;
}

/* =================================================================
   TABS (for alternate sections layout if needed)
   ================================================================= */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border-gray);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    background: #F0F0F0;
    border: 1px solid var(--border-gray);
    border-bottom: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
}

.tab:hover {
    background: #E0E0E0;
}

.tab.active {
    background: white;
    color: var(--primary-blue);
    border-top: 3px solid var(--primary-blue);
}

.tab-content {
    display: none;
}

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

/* =================================================================
   PRICING TABLE (Estimate Quantities)
   ================================================================= */
.pricing-table {
    margin-top: 15px;
}

.pricing-table table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table th {
    background: var(--light-blue);
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-gray);
}

.pricing-table td {
    padding: 6px 10px;
    border: 1px solid var(--border-gray);
}

.pricing-table input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--border-gray);
    text-align: right;
    font-size: 13px;
}

.pricing-table tr:nth-child(odd) td {
    background: var(--row-white);
}

.pricing-table tr:nth-child(even) td {
    background: var(--row-blue);
}

.pricing-table tr:first-child td {
    background: var(--light-blue) !important;
}

/* =================================================================
   LOGIN PAGE
   ================================================================= */
.login-page {
    background: linear-gradient(135deg, #AED6F1 0%, #2874A6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-large {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.logo-large .logo-text {
    font-size: 36px;
}

.logo-large .jobboss-text {
    font-size: 28px;
}

.login-header h2 {
    font-size: 18px;
    color: var(--text-light);
    font-weight: 400;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form button {
    margin-top: 10px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

.login-footer p {
    margin: 5px 0;
}

/* =================================================================
   DASHBOARD
   ================================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-card {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dashboard-card-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-blue);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-blue);
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

/* =================================================================
   UTILITIES
   ================================================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-primary { color: var(--primary-blue); }
.text-success { color: var(--success-green); }
.text-danger { color: var(--danger-red); }

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

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 1rem; }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -200px;
        transition: left 0.3s;
        z-index: 999;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .content {
        margin-left: 0;
    }
    
    .form-row {
        flex-direction: column;
    }
}
