@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* Colors */
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --success: #1e8e3e;
    --warning: #f9ab00;
    --danger: #d93025;
    --dark: #202124;
    --secondary: #5f6368;
    --light: #f8f9fa;
    --white: #ffffff;

    /* Backgrounds */
    --bg-body: #f8f9fa;
    --bg-surface: #ffffff;

    /* Dimensions & Radius */
    --radius-card: 16px;
    --radius-btn: 50px;
    --navbar-height: 70px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* --- Base Setup --- */
body {
    background: var(--bg-body);
    color: var(--dark);
    font-family: 'Roboto', "Microsoft JhengHei", sans-serif;
    padding-top: 90px;
    font-size: 16px;
    line-height: 1.6;
}

body.body-login {
    padding-top: 0 !important;
    background: #f0f4f8;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.container-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;
}

/* --- Navbar --- */
.navbar-clean {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    height: var(--navbar-height);
    padding: 0;
    display: flex;
    align-items: center;
}

.navbar-clean .container-fluid,
.navbar-clean .container-main {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary) !important;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0;
    margin: 0;
}

.navbar-collapse {
    flex-grow: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-weight: 500;
    border-radius: var(--radius-btn);
    padding: 0 20px !important;
    transition: 0.2s;
    color: var(--secondary) !important;
}

.nav-link:hover {
    background: #e8f0fe;
    color: var(--primary) !important;
}

.nav-link.active {
    background: #e8f0fe;
    color: var(--primary) !important;
    font-weight: 700;
}

/* --- Cards & UI Elements --- */
.card-clean {
    background: var(--bg-surface);
    border: none;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 24px;
    transition: 0.3s;
}

.card-clean:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-float);
}

.btn {
    border-radius: var(--radius-btn);
    padding: 8px 24px;
    font-weight: 500;
}

.btn-sm {
    padding: 5px 15px;
    font-size: 14px;
}

.form-control,
.form-select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #dfe1e5;
    background: var(--white);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* --- Tables --- */
.table-clean {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-clean th {
    background: var(--bg-body);
    color: var(--secondary);
    font-weight: 600;
    padding: 12px 16px;
    text-transform: uppercase;
    font-size: 14px;
    border-bottom: 2px solid #eee;
}

.table-clean td {
    padding: 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.table-clean tr:hover td {
    background: #fdfdfd;
}

.scrollable-table {
    height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* --- Badges --- */
.badge-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.badge-pending {
    background: #fef7e0;
    color: #b06000;
    border: 1px solid #fce8b2;
}

.badge-success {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.badge-danger {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #fad2cf;
}

.badge-neutral {
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
}

/* --- Dashboard Specific --- */
.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    border-left: 4px solid transparent;
}

.kpi-primary {
    border-left-color: var(--primary);
}

.kpi-warning {
    border-left-color: var(--warning);
}

.kpi-success {
    border-left-color: var(--success);
    background: linear-gradient(to right, #fff, #f1f8f6);
}

.nav-pills .nav-link {
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 500;
    background: transparent;
    transition: all 0.2s;
}

.nav-pills .nav-link.active {
    background-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.4);
}

/* --- Global Gantt (Project Overview) --- */
.gantt-wrapper {
    position: relative;
    overflow-x: auto;
    background: #fff;
    border-radius: var(--radius-card);
    scrollbar-width: thin;
}

.timeline-header {
    display: flex;
    height: 48px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 20;
    min-width: 100%;
}

.month-marker {
    flex: 1;
    border-right: 1px solid #eee;
    text-align: center;
    line-height: 48px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
    min-width: 80px;
}

.proj-row {
    display: flex;
    height: 56px;
    border-bottom: 1px solid #f4f6f8;
    align-items: center;
    position: relative;
    min-width: 100%;
    transition: background 0.2s;
}

.proj-row:hover {
    background-color: #fafbfc;
}

/* [Moved from HTML style block] */
.proj-label {
    position: sticky;
    left: 0;
    width: 260px;
    background: #fff;
    z-index: 10;
    padding: 0 20px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--dark);
    border-right: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 56px;
    line-height: 56px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.proj-bar-area {
    flex: 1;
    position: relative;
    height: 100%;
}

/* [Moved from HTML style block] */
.grid-lines {
    position: absolute;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
    z-index: 0;
}

.grid-col {
    flex: 1;
    border-right: 1px dashed #f0f0f0;
}

.g-bar {
    position: absolute;
    top: 16px;
    height: 24px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.75rem;
    padding-left: 12px;
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    font-weight: 500;
}

.g-bar:hover {
    transform: scaleY(1.15) translateY(-1px);
    z-index: 15;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.status-running {
    background: linear-gradient(90deg, #34a853, #2e9649);
}

.status-planning {
    background: linear-gradient(90deg, #4285f4, #3371d6);
}

.status-closed {
    background: #9aa0a6;
    opacity: 0.6;
}

/* --- Project Detail Elements --- */
.gantt-container {
    overflow-x: auto;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
}

.timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid #e0e0e0;
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
}

.timeline-date {
    font-size: 13px;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-content {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.timeline-user {
    font-size: 12px;
    color: var(--primary);
    font-weight: bold;
    margin-right: 5px;
}

/* [Moved from HTML style block] - Task Item Hover */
.task-item {
    transition: background-color 0.2s;
    border: 1px solid transparent;
}

.task-item:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

/* [Moved from HTML style block] - Circular Icon Button */
.icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.2s;
    color: #6c757d;
    text-decoration: none;
}

.icon-btn:hover {
    background-color: #e9ecef;
    color: var(--primary);
}

.icon-btn.danger:hover {
    background-color: #fee2e2;
    color: var(--danger);
}

/* Login Card */
.login-card {
    width: 420px;
    background: #fff;
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.1);
    text-align: center;
}