/* ── Ganthea Web App — Ascot-branded ── */
:root {
    --primary: #15803d;
    --primary-light: #22c55e;
    --primary-dark: #166534;
    --bg: #f4f6f4;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e2e4e2;
    --red: #dc2626;
    --yellow: #f59e0b;
    --green: #16a34a;
    --sidebar-w: 240px;
    --radius: 4px;
    --accent: #15803d;
}
.dark {
    --bg: #0d1610;
    --surface: #14201a;
    --text: #e0e8e2;
    --text-muted: #8a9e8e;
    --border: #243328;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: #112218; color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-header { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.sidebar-header .subtitle { font-size: .72rem; opacity: .55; margin-top: 2px; }
.sidebar nav { flex: 1; padding: 8px 0; }
.sidebar nav a {
    display: block;
    padding: 9px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .85rem;
    transition: background .12s, color .12s;
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.95); }
.sidebar nav a.active {
    background: rgba(255,255,255,.11);
    color: #fff;
    border-left-color: var(--primary-light);
    padding-left: 17px;
    font-weight: 600;
}
/* Tooltip pill — visible on mobile when sidebar is collapsed */
.sidebar nav a[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 64px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20,35,24,.97);
    color: #e0e8e2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
    border: 1px solid rgba(255,255,255,.12);
    opacity: 0;
    transition: opacity .12s;
}
@media (max-width: 768px) {
    .sidebar nav a[data-tooltip]:hover::after { opacity: 1; }
}
.sidebar-footer { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer .user-info { display: flex; flex-direction: column; margin-bottom: 8px; }
.sidebar-footer .user-name { font-weight: 600; font-size: .82rem; }
.sidebar-footer .user-email { font-size: .68rem; opacity: .6; }
.logout-btn { color: rgba(255,255,255,.6); text-decoration: none; font-size: .78rem; margin-right: 10px; }
.logout-btn:hover { color: #fff; }
.dark-toggle { background: none; border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.8); cursor: pointer; border-radius: var(--radius); padding: 2px 8px; font-size: .82rem; transition: border-color .12s; }
.dark-toggle:hover { border-color: rgba(255,255,255,.5); color: #fff; }

/* Main content */
.content { margin-left: var(--sidebar-w); flex: 1; padding: 24px 28px; max-width: 1400px; }
h2 { margin-bottom: 16px; color: var(--primary); font-size: 1.25rem; font-weight: 700; }
h3 { margin-bottom: 10px; font-size: 1rem; font-weight: 600; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-align: center; cursor: pointer; transition: border-color .12s; }
.stat-card:hover { border-color: var(--primary); }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: .75rem; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.stat-green .stat-value { color: var(--green); }
.stat-yellow .stat-value { color: var(--yellow); }
.stat-red .stat-value { color: var(--red); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table th { background: #112218; color: rgba(255,255,255,.85); text-align: left; padding: 8px 12px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: .82rem; }
.data-table tbody tr:hover { background: rgba(21,128,61,.04); }
.data-table .empty { text-align: center; color: var(--text-muted); padding: 28px; font-size: .82rem; }
.mono { font-family: monospace; font-size: .8rem; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: .7rem; font-weight: 600; text-transform: uppercase; }
.badge-active, .badge-signed { background: #dcfce7; color: #166534; }
.badge-prospect { background: #dbeafe; color: #1e40af; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-high { background: #fee2e2; color: #991b1b; }
.badge-low { background: #e0f2fe; color: #075985; }
.badge-open { background: #fef3c7; color: #92400e; }
.badge-handled { background: #dcfce7; color: #166534; }
.badge-beindigd, .badge-opgezegd { background: #fee2e2; color: #991b1b; }
.badge-onderhandeling { background: #fef3c7; color: #92400e; }

/* Urgency row colors */
.urgency-high, .urgency-red { background: rgba(220,38,38,.06); }
.urgency-medium, .urgency-yellow { background: rgba(245,158,11,.06); }
.urgency-low, .urgency-green { background: rgba(22,163,106,.06); }

/* Buttons */
.btn { display: inline-block; padding: 8px 16px; border-radius: var(--radius); font-size: .85rem; text-decoration: none; border: none; cursor: pointer; font-weight: 500; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-microsoft { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; font-size: 1rem; }

/* Login (legacy — see login-page section above for glassmorphism style) */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px; text-align: center; max-width: 400px; }
.login-logo { font-size: 3rem; margin-bottom: 10px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 24px; }
.mock-login-form { text-align: left; margin-top: 20px; }
.mock-login-form label { display: block; margin-bottom: 10px; font-size: .85rem; }
.mock-login-form input { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; margin-top: 4px; }
.login-note { margin-top: 16px; font-size: .75rem; color: var(--text-muted); }

/* ── Login Page (glassmorphism dark theme) ── */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #0a0f1a;
    color: #e0e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}
.login-page .login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #0a0f1a 0%, #0d1a2d 40%, #112218 100%);
}
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}
.login-orb-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #15803d 0%, transparent 70%);
    top: 10%; left: 15%;
}
.login-orb-2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #059669 0%, transparent 70%);
    bottom: 15%; right: 20%;
}
.login-orb-3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, #047857 0%, transparent 70%);
    top: 50%; left: 60%;
}
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.login-card-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.login-card-glass .login-logo {
    margin-bottom: 8px;
}
.login-card-glass .login-ascot-logo {
    height: 2.5rem;
    width: auto;
    filter: brightness(0) invert(1) opacity(0.9);
}
.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 4px;
}
.login-card-glass .login-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 32px;
}
.login-card-glass .btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    background: #fff;
    color: #1a1a2e;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.login-card-glass .btn-microsoft:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}
.login-card-glass .btn-microsoft:active {
    transform: translateY(0);
}
.login-card-glass .login-note {
    margin-top: 24px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}
.login-card-glass .denied-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}
.login-card-glass .mock-login-form {
    text-align: left;
    margin-top: 20px;
}
.login-card-glass .mock-login-form h3 {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}
.login-card-glass .mock-login-form label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}
.login-card-glass .mock-login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.9rem;
    margin-top: 4px;
}
.login-card-glass .mock-login-form input:focus {
    outline: none;
    border-color: #15803d;
    box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.3);
}
@media (max-width: 480px) {
    .login-card-glass {
        padding: 32px 24px;
        border-radius: 16px;
    }
    .login-title {
        font-size: 1.5rem;
    }
}

/* Filters */
.filters { margin-bottom: 16px; }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-form select, .filter-form input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: .85rem; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn { padding: 8px 16px; background: none; border: none; cursor: pointer; font-size: .85rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Detail */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.detail-item label { display: block; font-size: .75rem; color: var(--text-muted); text-transform: uppercase; }
.detail-item span { font-size: .95rem; }
.detail-notes { margin-bottom: 20px; }
.detail-notes label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; }

/* Contract form */
.contract-form { max-width: 800px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.contract-form label { display: block; font-size: .85rem; margin-bottom: 8px; }
.contract-form input, .contract-form select, .contract-form textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-size: .85rem; background: var(--surface); color: var(--text); }
.form-actions { margin-top: 16px; display: flex; gap: 8px; }

/* Timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline-item { position: relative; padding: 12px 0; border-left: 2px solid var(--border); }
.timeline-marker { position: absolute; left: -22px; top: 14px; font-size: 1rem; }
.timeline-date { font-weight: 600; font-size: .85rem; }
.timeline-title { display: block; font-size: .95rem; text-decoration: none; color: var(--text); }
.timeline-title:hover { color: var(--primary); }
.timeline-type { font-size: .8rem; color: var(--text-muted); }
.timeline-desc { font-size: .8rem; color: var(--text-muted); margin: 4px 0; }

/* Milestones */
.milestone-timeline { display: flex; flex-direction: column; gap: 8px; }
.milestone { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); border-left: 4px solid var(--border); }
.milestone-green { border-left-color: var(--green); background: rgba(22,163,106,.05); }
.milestone-yellow { border-left-color: var(--yellow); background: rgba(245,158,11,.05); }
.milestone-red { border-left-color: var(--red); background: rgba(220,38,38,.05); }
.milestone-date { font-weight: 600; font-size: .8rem; min-width: 80px; }
.milestone-label { font-size: .85rem; text-decoration: none; color: var(--text); }
.milestone-days { font-size: .75rem; color: var(--text-muted); }

/* Gantt milestones */
.gantt-milestones { display: flex; flex-direction: column; gap: 6px; }
.gantt-milestone { padding: 6px 10px; border-radius: 4px; font-size: .85rem; }
.gantt-milestone a { text-decoration: none; color: var(--text); }
.milestone-red a { color: var(--red); }
.milestone-yellow a { color: #92400e; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb > *:not(:last-child)::after { content: '›'; margin-left: 6px; opacity: .5; }

/* Section */
.section { margin-bottom: 20px; }

/* Flash */
.flash { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .85rem; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }

/* Status row highlight */
.status-active { }
.status-prospect { opacity: .8; }
.status-beindigd { opacity: .5; }
.status-opgezegd { opacity: .5; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 56px; overflow: hidden; }
    .sidebar-header h1, .sidebar-header .subtitle, .sidebar nav a span, .sidebar-footer .user-info, .sidebar-footer .logout-btn { display: none; }
    .sidebar nav a { padding: 10px 0; display: flex; align-items: center; justify-content: center; border-left-width: 0; border-bottom: 2px solid transparent; }
    .sidebar nav a.active { border-left-width: 0; border-bottom-color: var(--primary-light); }
    .content { margin-left: 56px; padding: 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Ascot Logo */
.sidebar-logo {
    height: 1.25rem;
    width: auto;
    vertical-align: middle;
    margin-right: 0.25rem;
}
.dark .sidebar-logo {
    filter: brightness(0) invert(1);
}
.login-ascot-logo {
    height: 2rem;
    width: auto;
    margin-bottom: 0.5rem;
}
.dark .login-ascot-logo {
    filter: brightness(0) invert(1);
}
