/* ============================================================
   MedEquip — Sky Blue & White Medical Theme
   ============================================================ */

:root {
    --primary:       #0288d1;
    --primary-dark:  #01579b;
    --primary-light: #4fc3f7;
    --sky-50:        #e1f5fe;
    --sky-100:       #b3e5fc;
    --white:         #ffffff;
    --bg:            #f0f8ff;
    --text:          #1a2e44;
    --muted:         #546e7a;
    --border:        #cde8f7;
    --success:       #2e7d32;
    --success-bg:    #e8f5e9;
    --warning:       #e65100;
    --warning-bg:    #fff3e0;
    --danger:        #c62828;
    --danger-bg:     #ffebee;
    --shadow:        0 4px 24px rgba(2, 136, 209, 0.10);
    --shadow-hover:  0 8px 32px rgba(2, 136, 209, 0.18);
    --radius:        14px;
    --radius-sm:     8px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    box-shadow: 0 2px 16px rgba(1, 87, 155, 0.25);
    padding: .8rem 0;
}

.navbar-custom .navbar-brand {
    color: #fff;
    font-size: 1.35rem;
    letter-spacing: -.3px;
    text-decoration: none;
}
.navbar-custom .navbar-brand:hover { color: var(--sky-50); }

.brand-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.2);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}

.navbar-custom .nav-link {
    color: rgba(255,255,255,.85) !important;
    border-radius: var(--radius-sm);
    padding: .45rem .8rem;
    transition: background .2s, color .2s;
    font-size: .92rem;
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    background: rgba(255,255,255,.18);
    color: #fff !important;
}
.navbar-custom .navbar-toggler { border-color: rgba(255,255,255,.4); }
.navbar-custom .navbar-toggler-icon { filter: invert(1); }

.user-chip {
    display: flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.15);
    border-radius: 20px;
    padding: .35rem .9rem;
    color: #fff;
    font-size: .85rem;
}
.badge-service {
    background: rgba(255,255,255,.25);
    color: #fff;
    border-radius: 12px;
    padding: .15rem .55rem;
    font-size: .75rem;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content { flex: 1; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--white);
}
.card-header {
    background: linear-gradient(90deg, var(--sky-50), var(--white));
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 1rem 1.5rem;
}

/* ── Stat cards ───────────────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.stat-card .stat-value { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: var(--muted); font-size: .88rem; margin-top: .3rem; }

.stat-blue   { background: linear-gradient(135deg, var(--sky-50), #daf0ff); color: var(--primary-dark); }
.stat-orange { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #bf360c; }
.stat-green  { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); color: #1b5e20; }
.stat-red    { background: linear-gradient(135deg, #ffebee, #ffcdd2); color: #b71c1c; }

.stat-blue   .stat-icon { background: rgba(2,136,209,.15); color: var(--primary); }
.stat-orange .stat-icon { background: rgba(230,81,0,.12); color: #e65100; }
.stat-green  .stat-icon { background: rgba(46,125,50,.12); color: #2e7d32; }
.stat-red    .stat-icon { background: rgba(198,40,40,.12); color: #c62828; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-outline-primary {
    color: var(--primary); border-color: var(--primary);
    border-radius: var(--radius-sm);
}
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ── Badges ───────────────────────────────────────────────── */
.urgency-faible   { background: #e8f5e9 !important; color: var(--success) !important; border: 1px solid #a5d6a7; }
.urgency-moyenne  { background: #fff3e0 !important; color: var(--warning) !important; border: 1px solid #ffcc80; }
.urgency-critique { background: var(--danger-bg) !important; color: var(--danger) !important; border: 1px solid #ef9a9a; }

/* ── Tables ───────────────────────────────────────────────── */
.table {
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th {
    background: var(--sky-50);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .9rem 1rem;
    border-bottom: 2px solid var(--sky-100);
}
.table tbody tr {
    transition: background .15s;
}
.table tbody tr:hover { background: #f5fbff; }
.table tbody td {
    padding: .85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--sky-50);
    font-size: .9rem;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: .55rem .9rem;
    font-size: .92rem;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2,136,209,.12);
}
.form-label { font-weight: 500; color: var(--text); font-size: .9rem; margin-bottom: .4rem; }
.form-text  { color: var(--muted); font-size: .8rem; }

/* ── Alert ────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-sm);
    border-left-width: 4px;
    font-size: .9rem;
}
.alert-success { border-left-color: var(--success); }
.alert-danger  { border-left-color: var(--danger); }
.alert-warning { border-left-color: #e65100; }
.alert-info    { border-left-color: var(--primary); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    margin-bottom: 1.8rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sky-50);
}
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}
.page-header p { color: var(--muted); margin: .3rem 0 0; font-size: .92rem; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.2rem 0;
    font-size: .85rem;
}

/* ── Hero (homepage) ──────────────────────────────────────── */
.hero-section {
    min-height: calc(100vh - 72px);
    background: linear-gradient(145deg, #01579b 0%, #0288d1 45%, #4fc3f7 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M50 50c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10zM10 10c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10S0 25.523 0 20s4.477-10 10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; color: #fff; }
.hero-content h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; }
.hero-content .lead { font-size: 1.15rem; opacity: .9; max-width: 540px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(255,255,255,.15); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 20px; padding: .4rem 1rem;
    font-size: .85rem; margin-bottom: 1.5rem;
}
.hero-visual {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(8px);
}
.hero-visual .icon-ring {
    width: 80px; height: 80px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
}
.feature-pill {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px; padding: .6rem 1rem;
    font-size: .85rem; margin: .3rem;
    cursor: default;
}

/* ── Request detail timeline ──────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute; left: .6rem; top: 0; bottom: 0;
    width: 2px; background: var(--sky-100);
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before {
    content: '';
    position: absolute; left: -1.48rem; top: .3rem;
    width: 12px; height: 12px;
    background: var(--primary); border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-date { font-size: .78rem; color: var(--muted); margin-bottom: .2rem; }
.timeline-body { background: var(--sky-50); border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: .88rem; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sky-50); }
::-webkit-scrollbar-thumb { background: var(--sky-100); border-radius: 3px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-section { padding: 3rem 0; text-align: center; }
    .hero-content .lead { margin: 0 auto; }
    .stat-card .stat-value { font-size: 1.8rem; }
}

/* ── Login page ───────────────────────────────────────────── */
.login-wrapper {
    min-height: calc(100vh - 72px);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #e1f5fe 0%, #f0f8ff 100%);
    padding: 2rem 1rem;
}
.login-card {
    width: 100%; max-width: 440px;
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(2,136,209,.15);
    overflow: hidden;
}
.login-card .card-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    text-align: center; padding: 2rem;
    border-radius: 20px 20px 0 0 !important;
}
.login-logo {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.2);
    border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #fff; margin-bottom: 1rem;
}
