/* ============================================================
   Udforske Opgavestyring – Stylesheet
   Simpelt responsivt design uden framework
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:   #1a56db;
    --color-success:   #057a55;
    --color-danger:    #c81e1e;
    --color-warning:   #c27803;
    --color-bg:        #f9fafb;
    --color-surface:   #ffffff;
    --color-border:    #e5e7eb;
    --color-text:      #111827;
    --color-muted:     #6b7280;
    --radius:          6px;
    --shadow:          0 1px 3px rgba(0,0,0,.1);
}

body { font-family: system-ui, sans-serif; background: var(--color-bg); color: var(--color-text); line-height: 1.6; }

/* Utilities */
.text-muted { color: var(--color-muted); font-size: .9rem; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); padding: .75rem 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-logo { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--color-primary); }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a { text-decoration: none; color: var(--color-text); }
.site-nav a:hover { color: var(--color-primary); }
.nav-user { color: var(--color-muted); font-size: .9rem; }

main.container { padding-top: 2rem; padding-bottom: 3rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--color-border); padding: 1rem 0; color: var(--color-muted); font-size: .85rem; text-align: center; }

/* Flash messages */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.flash--error   { background: #fde8e8; color: var(--color-danger); border: 1px solid #f8b4b4; }
.flash--success { background: #def7ec; color: var(--color-success); border: 1px solid #84e1bc; }
.flash--info    { background: #e1effe; color: var(--color-primary); border: 1px solid #a4cafe; }

/* Buttons */
.btn { display: inline-block; padding: .45rem 1rem; border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font-size: .9rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--color-bg); }
.btn--primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn--primary:hover { background: #1648c0; }
.btn--success { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn--danger  { background: var(--color-danger);  color: #fff; border-color: var(--color-danger); }
.btn--full    { width: 100%; text-align: center; }
.btn--sm      { padding: .3rem .75rem; font-size: .85rem; }
.btn-link     { background: none; border: none; color: var(--color-muted); cursor: pointer; font-size: inherit; padding: 0; }
.btn-link:hover { color: var(--color-danger); }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .3rem; font-size: .9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: .5rem .75rem; border: 1px solid var(--color-border);
    border-radius: var(--radius); font-size: 1rem; background: var(--color-surface);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }
.task-form, .login-form { max-width: 600px; }

/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.login-container h1 { margin-bottom: 1.5rem; font-size: 1.3rem; text-align: center; }

/* Tables */
.task-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.task-table th, .task-table td { padding: .6rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); font-size: .9rem; }
.task-table th { background: var(--color-bg); font-weight: 600; }
.task-table tr:last-child td { border-bottom: none; }
.table-link { font-weight: 500; text-decoration: none; color: var(--color-primary); }
.table-link:hover { text-decoration: underline; }

/* Status badges */
.status { display: inline-block; padding: .2rem .6rem; border-radius: 9999px; font-size: .8rem; font-weight: 600; }
.status--draft            { background: #e5e7eb; color: #374151; }
.status--pending_approval { background: #fef3c7; color: var(--color-warning); }
.status--approved         { background: #def7ec; color: var(--color-success); }
.status--rejected         { background: #fde8e8; color: var(--color-danger); }
.status--completed        { background: #dbeafe; color: var(--color-primary); }
.status--active           { background: #def7ec; color: var(--color-success); }
.status--archived         { background: #e5e7eb; color: #374151; }
.status--pending          { background: #fef3c7; color: var(--color-warning); }

/* Badge (inline count) */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: 9999px; font-size: .8rem; font-weight: 700; }
.badge--warning { background: #fef3c7; color: var(--color-warning); }
.badge--danger  { background: #fde8e8; color: var(--color-danger); }
.badge--success { background: #def7ec; color: var(--color-success); }

/* Task detail */
.task-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.task-header h1 { font-size: 1.5rem; }
.task-meta { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin-bottom: 2rem; max-width: 600px; }
.task-meta dt { font-weight: 600; color: var(--color-muted); font-size: .9rem; }
.task-meta dd { font-size: .9rem; }
.task-description { margin-bottom: 2rem; }
.task-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* Approvals */
.approvals { margin-top: 2rem; }
.approval-list { list-style: none; margin-top: .75rem; }
.approval-item { padding: .5rem .75rem; border-radius: var(--radius); margin-bottom: .5rem; font-size: .9rem; }
.approval-item--approved { background: #def7ec; border-left: 3px solid var(--color-success); }
.approval-item--rejected  { background: #fde8e8; border-left: 3px solid var(--color-danger); }
.approval-item--pending   { background: #fef3c7; border-left: 3px solid var(--color-warning); }
.approval-item time { float: right; color: var(--color-muted); font-size: .8rem; }

/* Activity log */
.activity-log { margin-top: 2rem; }
.activity-list { list-style: none; margin-top: .75rem; }
.activity-list li { padding: .4rem 0; border-bottom: 1px solid var(--color-border); font-size: .85rem; }
.activity-list time { float: right; color: var(--color-muted); font-size: .8rem; }

/* Project customer label */
.project-customer { color: var(--color-muted); font-size: .9rem; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 1rem; font-size: .9rem; color: var(--color-muted); }
.breadcrumb a { color: var(--color-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Dashboard ────────────────────────────────────────────────────── */

.dashboard-greeting { margin-bottom: 1.5rem; }
.dashboard-greeting h1 { font-size: 1.5rem; margin-bottom: .15rem; }

/* Stat cards row */
.dashboard-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.stat-card {
    flex: 1 1 140px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-card--warning { border-left: 3px solid var(--color-warning); }
.stat-card--success { border-left: 3px solid var(--color-success); }
.stat-card--danger  { border-left: 3px solid var(--color-danger); }
.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}
.stat-label {
    display: block;
    font-size: .8rem;
    color: var(--color-muted);
    margin-top: .2rem;
}

.dashboard-section { margin-bottom: 2.5rem; }
.dashboard-section h2 { margin-bottom: 1rem; }

/* Project cards grid */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: border-color .15s, box-shadow .15s;
}
.project-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(26,86,219,.12);
}
.project-card__header { margin-bottom: .75rem; }
.project-card__header h3 { font-size: 1.05rem; margin-bottom: .15rem; }
.project-card__customer { font-size: .85rem; color: var(--color-muted); }
.project-card__stats {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}
.project-card__stat { text-align: center; flex: 1 1 0; }
.project-card__stat-number { display: block; font-size: 1.2rem; font-weight: 700; }
.project-card__stat-number--warning { color: var(--color-warning); }
.project-card__stat-number--success { color: var(--color-success); }
.project-card__stat-number--danger  { color: var(--color-danger); }
.project-card__stat-label { display: block; font-size: .7rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .03em; }

/* Project list (fallback simple list) */
.project-list { list-style: none; }
.project-item { padding: .5rem 0; border-bottom: 1px solid var(--color-border); }
.project-item a { font-weight: 500; text-decoration: none; color: var(--color-primary); }
.project-desc { font-size: .9rem; color: var(--color-muted); margin-top: .2rem; }

/* Project detail header */
.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.project-header h1 { font-size: 1.5rem; }
.project-description { margin-bottom: 1.5rem; color: var(--color-text); font-size: .95rem; line-height: 1.7; }
.project-meta { margin-top: 2rem; font-size: .85rem; }

/* Section header with action */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

/* Reject form */
.reject-form {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    max-width: 600px;
}
.reject-form .form-group { margin-bottom: .75rem; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-stats { gap: .5rem; }
    .stat-card { padding: .75rem; }
    .stat-number { font-size: 1.3rem; }
    .project-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .task-table { font-size: .8rem; }
    .task-table th, .task-table td { padding: .4rem .6rem; }
    .task-meta { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }
    .project-header { flex-direction: column; }
    .section-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
}
