@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
    --primary: #6366f1; /* Indigo 500 */
    --primary-hover: #4f46e5; /* Indigo 600 */
    --bg-body: #f8fafc; /* Slate 50 */
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --sidebar-bg: #0f172a; /* Slate 900 - Premium Dark */
    --sidebar-text: #94a3b8; /* Slate 400 */
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: #1e293b; /* Slate 800 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1); /* Subtle depth */
}

/* Sidebar Logo Area */
.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.3s;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition:
        margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed State */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding: 2rem 1rem;
    align-items: center; /* Center items when collapsed */
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.sidebar-collapsed .logo-text,
.sidebar-collapsed .nav-item a span {
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar-collapsed .logo {
    justify-content: center;
    width: 100%;
}

.sidebar-collapsed .btn-toggle-sidebar {
    position: absolute;
    top: 2rem;
    right: 50%; /* Center strictly */
    transform: translateX(50%);
    display: none; /* Hide toggle inside sidebar, maybe move to header or keep?
                   * Actually keeping it in sidebar is tricky if it collapses.
                   * Let's keep it but adjust position or assume user clicks header toggle if exists.
                   * For now, let's just center it below logo or hide text.
                   */
    display: flex;
    margin-top: 40px; /* Push down */
}

.sidebar-collapsed .nav-item a {
    justify-content: center;
    padding: 0.75rem;
    width: 48px; /* Fixed square for icon */
    height: 48px;
    margin: 0 auto;
}

.sidebar-collapsed .nav-item a svg {
    margin-right: 0;
    width: 24px;
    height: 24px;
}

.btn-toggle-sidebar {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #fff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.header {
    height: var(--header-height);
    background: #ffffff;
    /* border-bottom: 1px solid var(--border); remove border for cleaner shadow look */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow); /* Premium shadow */
}

.content-wrapper {
    padding: 2rem;
    flex: 1;
}

/* Typography */
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.025em;
}
h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
p {
    color: var(--text-muted);
}

.section-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Tables */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden; /* For rounded corners on table */
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    padding: 0;
}

/* Form Cards */
.card.p-6 {
    padding: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th {
    background: #f8fafc;
    text-align: left;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background-color: #f8fafc;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-active {
    background: #e0e7ff; /* Indigo 100 */
    color: #4338ca; /* Indigo 700 */
    border: 1px solid #c7d2fe;
}

.badge-planned {
    background: #f8fafc; /* Slate 50 */
    color: #475569; /* Slate 600 */
    border: 1px solid #e2e8f0;
}

.badge-done {
    background: #dcfce7; /* Green 100 */
    color: #15803d; /* Green 700 */
    border: 1px solid #bbf7d0;
}

.badge-onhold {
    background: #ffedd5; /* Orange 100 */
    color: #c2410c; /* Orange 700 */
    border: 1px solid #fed7aa;
}

.badge-closed {
    background: #f1f5f9; /* Slate 100 */
    color: #64748b; /* Slate 500 */
    border: 1px solid #cbd5e1;
}

.badge-todo {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.badge-high {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-medium {
    background: #ffedd5;
    color: #c2410c;
}

/* Links */
a.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
a.link:hover {
    text-decoration: underline;
}

/* Sidebar */
.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.nav-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text-hover);
}
.nav-item a.active {
    background: var(--primary); /* Use primary color for active */
    color: white;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.nav-item a svg {
    margin-right: 0.75rem;
    width: 20px;
    height: 20px;
    transition: margin 0.3s;
}

/* User Profile in Header */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748b;
}

/* Progress */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.progress-bar {
    width: 80px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
}
.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mono {
    font-family:
        "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.8em;
    color: #6b7280;
}

.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
    background-color: #fff;
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid transparent;
}

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

.btn-secondary {
    background-color: white;
    border-color: #d1d5db;
    color: #374151;
}
.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #c0c4cc; /* Slightly darker border on hover */
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}
.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem; /* Reduced gap */
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.75rem; /* Slightly smaller radius */
    padding: 1.25rem; /* Reduced padding */
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-title {
    font-size: 0.75rem; /* Smaller, sharper */
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem; /* Professional size, not too huge */
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-icon {
    width: 32px;
    height: 32px;
    font-size: 0.875rem; /* Smaller icon inside */
    border-radius: 6px;
    background: #eef2ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SDLC Stepper */
.stepper-wrapper {
    margin-top: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

/* Scrum Board */
.scrum-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    height: calc(100vh - 250px);
    overflow-x: auto;
}

.scrum-column {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    color: var(--text-main);
}

.header-todo {
    border-color: #cbd5e1;
}
.header-inprogress {
    border-color: #3b82f6;
}
.header-review {
    border-color: #f59e0b;
}
.header-done {
    border-color: #22c55e;
}

.count-badge {
    background: white;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

.task-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.task-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: grab;
    transition:
        transform 0.1s,
        box-shadow 0.1s;
}
.task-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.task-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #1e293b;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.avatar-small {
    width: 24px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
}

.points {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.stepper-item::before {
    position: absolute;
    content: "";
    border-bottom: 4px solid #e2e8f0;
    width: 100%;
    top: 20px; /* Center with circle height 40px/2 */
    left: -50%;
    z-index: 2;
}

.stepper-item::after {
    position: absolute;
    content: "";
    border-bottom: 4px solid #e2e8f0;
    width: 100%;
    top: 20px;
    left: 50%;
    z-index: 2;
}

.stepper-item:first-child::before {
    content: none;
}

.stepper-item:last-child::after {
    content: none;
}

.stepper-item.completed .step-counter {
    background-color: var(--primary);
    color: white;
    z-index: 3;
}

.step-counter {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 6px;
    border: 4px solid #fff; /* whitespace around circle */
}

.step-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
}

/* Helper to color lines if needed, for now simple static */
.stepper-item.active .step-counter {
    background-color: var(--primary);
    color: white;
}

/* Drag and Drop Styles */
.scrum-column.drag-over {
    background: #f1f5f9;
    border: 2px dashed #94a3b8;
}

.task-card.dragging {
    opacity: 0.5;
    border: 2px dashed #cbd5e1;
}

.cursor-grab {
    cursor: grab;
}

.cursor-grab:active {
    cursor: grabbing;
}

/* Badge specific colors */
.badge-todo {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.badge-inprogress {
    background: #e0e7ff; /* Indigo 100 - Same as active */
    color: #4338ca;      /* Indigo 700 */
    border: 1px solid #c7d2fe;
}
.badge-review {
    background-color: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}
.badge-done {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.badge-blocked {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.badge-secondary {
    background-color: #f3f4f6;
    color: #6b7280;
}
.badge-high {
    background: #fee2e2;
    color: #b91c1c;
}
.badge-medium {
    background: #ffedd5;
    color: #c2410c;
}


