﻿/* DASHBOARD CSS 
   Combined: Full Branding + Layout Constraints
*/

/* --- RESET & VARIABLES --- */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-gradient-hover: linear-gradient(135deg, #5a67d8 0%, #6b4292 100%);
    /* High Visibility Accent */
    --accent-color: #ff6b6b;
    --accent-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
    --bg-page: #f3f4f6;
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --radius: 0.75rem;
    --nav-height: 70px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 4px 14px 0 rgba(118, 75, 162, 0.39);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
}

/* --- UTILITIES --- */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.text-white {
    color: white !important;
}

.fw-bold {
    font-weight: 700;
}

.small {
    font-size: 0.875rem;
}

/* --- LAYOUT CONTAINERS (The Fix) --- */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 1. Main Dashboard Container - Constrained Width */
.dashboard-container {
    max-width: 1100px; /* Keeps dashboard elements from stretching */
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* 2. Original Container (For Landing Page/Nav) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* 3. Fluid Container */
.container-fluid {
    width: 100%;
    padding-right: 2rem;
    padding-left: 2rem;
    margin-right: auto;
    margin-left: auto;
}

.main-content {
    flex: 1;
}

/* --- NAVBAR --- */
.navbar {
    height: var(--nav-height);
    background: var(--primary-gradient);
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 3rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .nav-item:hover {
        background-color: rgba(255, 255, 255, 0.15);
        color: white;
    }

    .nav-item.active {
        background-color: rgba(255, 255, 255, 0.25);
        color: white;
    }

/* High Visibility Navbar Login Button */
.nav-btn-login {
    background: var(--accent-gradient);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

    .nav-btn-login:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.2);
        filter: brightness(1.1);
    }

/* --- HERO SECTION --- */
.hero-section {
    position: relative;
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 2rem 8rem;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    margin-bottom: -4rem;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- FEATURE GRID --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 10;
}

@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
}

    .feature-card:hover {
        transform: translateY(-5px);
    }

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.feature-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- CARDS & PANELS --- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 1.5rem;
}

/* Limited Width Card for Manual Forms */
.card-limited {
    max-width: 600px;
    margin: 0 auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Icon Colors */
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.icon-blue {
    background: #eff6ff;
    color: #3b82f6;
}

.icon-teal {
    background: #f0fdfa;
    color: #14b8a6;
}

.icon-purple {
    background: #faf5ff;
    color: #a855f7;
}

.icon-green {
    background: #f0fdf4;
    color: #22c55e;
}

/* --- FORMS --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.15s;
    height: 2.8rem;
}

    .form-control:focus, .form-select:focus {
        outline: 0;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    }

    .form-control:disabled, .form-control[readonly] {
        background-color: #f3f4f6;
        color: #6b7280;
    }

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
    border: none;
}

    .btn-primary:hover {
        background: var(--primary-gradient-hover);
        transform: translateY(-1px);
    }

.btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--text-main);
}

    .btn-secondary:hover {
        background: var(--bg-page);
    }

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-white {
    background: white;
    color: var(--primary);
}

    .btn-white:hover {
        background: #f8fafc;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

.btn-outline-white {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
}

    .btn-outline-white:hover {
        border-color: white;
        background: rgba(255,255,255,0.1);
    }

.btn-danger {
    background-color: #dc3545;
    color: white;
}

    .btn-danger:hover {
        background-color: #bb2d3b;
    }

.btn-success {
    background-color: #198754;
    color: white;
}

    .btn-success:hover {
        background-color: #157347;
    }

/* Grid for Actions (TimeSheet) */
.action-buttons-container {
    max-width: 900px;
    margin: 0 auto;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

    .footer a {
        color: var(--primary);
        text-decoration: none;
    }

        .footer a:hover {
            text-decoration: underline;
        }

/* --- LOGIN PAGE STYLES --- */
.login-page-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-page);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

    .login-header h1 {
        font-size: 2rem;
        font-weight: 800;
        margin-bottom: 0.5rem;
    }

.form-group-minimal {
    margin-bottom: 2rem;
    position: relative;
}

.input-icon-wrapper {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    padding-bottom: 2px;
}

.form-control-minimal {
    width: 100%;
    padding: 0.75rem 0.5rem 0.75rem 2rem;
    font-size: 1rem;
    color: var(--text-main);
    background-color: transparent;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    transition: border-color 0.2s ease-in-out;
}

    .form-control-minimal:focus {
        outline: none;
        border-bottom-color: var(--primary);
    }

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

    .login-link:hover {
        text-decoration: underline;
    }

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
}

    .btn-login:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
        background: linear-gradient(135deg, #ff4757 0%, #ff6b6b 100%);
    }

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- MODERN TABLES --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

    .modern-table th {
        background-color: #fff;
        color: #6b7280;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        padding: 1rem 1.5rem;
        text-align: left;
        border-bottom: 2px solid var(--border-color);
    }

    .modern-table td {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-main);
        background-color: #fff;
        vertical-align: middle;
    }

    .modern-table tr:last-child td {
        border-bottom: none;
    }

    .modern-table tr:hover td {
        background-color: #f8fafc;
    }

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

/* --- GRID SYSTEM SHIM --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.g-3 {
    margin-top: -1rem;
}

    .g-3 > * {
        padding-top: 1rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

.g-4 {
    margin-top: -1.5rem;
}

    .g-4 > * {
        padding-top: 1.5rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

[class^="col-"] {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (min-width: 768px) {
    .col-md-2 {
        flex: 0 0 auto;
        width: 16.666667%;
    }

    .col-md-3 {
        flex: 0 0 auto;
        width: 25%;
    }

    .col-md-4 {
        flex: 0 0 auto;
        width: 33.333333%;
    }

    .col-md-6 {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 auto;
        width: 25%;
    }

    .col-lg-4 {
        flex: 0 0 auto;
        width: 33.333333%;
    }

    .col-lg-5 {
        flex: 0 0 auto;
        width: 41.666667%;
    }

    .col-lg-7 {
        flex: 0 0 auto;
        width: 58.333333%;
    }

    .col-lg-8 {
        flex: 0 0 auto;
        width: 66.666667%;
    }

    .col-lg-12 {
        flex: 0 0 auto;
        width: 100%;
    }
}

.col-12 {
    flex: 0 0 auto;
    width: 100%;
}

/* --- MODALS (The Constraint Fix) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    opacity: 0.5;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

/* Fixes "Wide Modal" issue */
.modal-dialog-limited {
    max-width: 480px;
    margin: 1.75rem auto;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: none;
    border-radius: var(--radius);
    outline: 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    background-color: var(--primary); /* Force header color */
    color: white;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em .25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: .25rem;
    opacity: .5;
    cursor: pointer;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Utilities needed for layout and spacing */
.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.align-items-center {
    align-items: center !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

.w-100 {
    width: 100% !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.p-0 {
    padding: 0 !important;
}

.p-3 {
    padding: 1rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.ps-4 {
    padding-left: 1.5rem !important;
}

.pe-4 {
    padding-right: 1.5rem !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-success {
    color: #198754 !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.rounded-pill {
    border-radius: 50rem !important;
}

.border-bottom {
    border-bottom: 1px solid #dee2e6 !important;
}

.border-top {
    border-top: 1px solid #dee2e6 !important;
}
