﻿/* =====================================================
   Medzup — Global Design System
   ===================================================== */

/* ---- Custom Properties ---- */
:root {
    --bg:             #f4f6f9;
    --sidebar-bg:     #0E8388;
    --sidebar-hover:  #09666A;
    --accent:         #FF7A59;
    --accent-light:   rgba(203, 228, 222, 0.22);
    --primary:        #0E8388;
    --secondary:      #CBE4DE;
    --action-accent:  #FF7A59;
    --text:           #333333;
    --text-muted:     #6b7280;
    --white:          #ffffff;
    --border:         #e5e7eb;
    --sidebar-width:  250px;
    --transition:     0.28s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

a    { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }


/* =====================================================
   OVERLAY  — mobile sidebar backdrop
   ===================================================== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.overlay.active { opacity: 1; visibility: visible; }


/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.sidebar::-webkit-scrollbar          { width: 4px; }
.sidebar::-webkit-scrollbar-track    { background: transparent; }
.sidebar::-webkit-scrollbar-thumb    { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* — Logo — */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}
.logo-icon {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-icon svg {
    width: 18px; height: 18px;
    stroke: #fff; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.logo-text {
    font-size: 18px; font-weight: 700;
    color: var(--white); letter-spacing: 0.3px;
}
.logo-badge {
    margin-left: auto;
    font-size: 10px; font-weight: 700;
    color: var(--accent);
    background: rgba(203, 228, 222, 0.22);
    padding: 2px 7px; border-radius: 20px;
    letter-spacing: 0.6px;
}

/* — Nav sections — */
.sidebar-nav { flex: 1; padding: 10px 0 16px; }

.nav-section-label {
    padding: 14px 18px 4px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.4px;
    color: rgba(255, 255, 255, 0.28);
    user-select: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.60);
    font-size: 13.5px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: background var(--transition),
                color var(--transition),
                border-color var(--transition);
}
.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    border-left-color: rgba(255, 122, 89, 0.7);
}
.sidebar-nav li.active > a {
    background: var(--accent-light);
    color: var(--white);
    border-left-color: var(--accent);
}

.nav-icon {
    width: 17px; height: 17px;
    flex-shrink: 0;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* — Sidebar Footer — */
.sidebar-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}
.sidebar-footer-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    color: var(--white); flex-shrink: 0;
}
.sidebar-footer-name {
    font-size: 13px; font-weight: 600; color: var(--white);
}
.sidebar-footer-role {
    font-size: 11px; color: rgba(255,255,255,0.38); margin-top: 1px;
}


/* =====================================================
   MAIN WRAPPER
   ===================================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}


/* =====================================================
   HEADER
   ===================================================== */
.header {
    position: sticky; top: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px; gap: 14px;
    z-index: 50;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

/* Burger button — hidden on desktop */
.burger-btn {
    display: none;
    align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--radius);
    color: var(--text);
    transition: background var(--transition);
    flex-shrink: 0;
}
.burger-btn:hover { background: var(--bg); }
.burger-btn svg {
    width: 22px; height: 22px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round;
}

/* Breadcrumb */
.header-breadcrumb {
    display: flex; align-items: center;
    gap: 8px; flex: 1; min-width: 0;
    overflow: hidden;
}
.header-app {
    font-size: 13px; color: var(--text-muted);
    font-weight: 500; white-space: nowrap;
    flex-shrink: 0;
}
.header-sep   { color: var(--border); font-size: 15px; }
.header-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}

/* Actions */
.header-actions {
    display: flex; align-items: center;
    gap: 8px; margin-left: auto; flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.header-icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius);
    color: var(--text-muted);
    position: relative;
    transition: background var(--transition), color var(--transition);
}
.header-icon-btn:hover { background: var(--bg); color: var(--text); }
.header-icon-btn svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.notif-dot {
    position: absolute; top: 7px; right: 7px;
    width: 7px; height: 7px;
    background: #ef4444; border-radius: 50%;
    border: 2px solid var(--white);
}
.header-divider { width: 1px; height: 24px; background: var(--border); }
.header-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    transition: opacity var(--transition);
    flex-shrink: 0;
}
.header-avatar:hover { opacity: 0.85; }


/* =====================================================
   CONTENT AREA
   ===================================================== */
.content { padding: 32px; flex: 1; }

.page-header { margin-bottom: 28px; }
.page-header h1 {
    font-size: 26px; font-weight: 700;
    color: var(--text); line-height: 1.2;
}
.page-header p {
    margin-top: 6px; font-size: 14px;
    color: var(--text-muted);
}


/* =====================================================
   RESPONSIVE — Mobile ≤ 768 px
   ===================================================== */
@media (max-width: 768px) {
    /* Sidebar off-canvas */
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
    .sidebar.open { transform: translateX(0); }

    /* Reset main margin */
    .main-wrapper { margin-left: 0; }

    /* Show burger button */
    .burger-btn { display: flex; }

    .header  { padding: 0 16px; }
    .content { padding: 20px 16px; }
}

@media (max-width: 640px) {
    .header {
        padding: 0 12px;
        gap: 10px;
    }

    .header-breadcrumb {
        flex: 0 1 auto;
    }

    .header-app,
    .header-sep {
        display: none;
    }

    .header-title {
        max-width: 120px;
    }

    .header-actions {
        gap: 6px;
    }

    .header-icon-btn,
    .header-avatar {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 480px) {
    .header-divider { display: none; }
}
