/* ============ RESET + BASE ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; margin: 0; padding: 0; background: #f3f4f6; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: #111827;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============ APP SHELL ============ */
.app-shell {
    display: flex;
    min-height: 100vh;
}
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ============ TOP BAR ============ */
.top-bar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 30;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Menu toggle (hamburguesa) ---- */
.menu-toggle {
    width: 38px; height: 38px;
    display: inline-flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 4px;
    border-radius: 8px;
    transition: background .15s;
}
.menu-toggle:hover { background: #f1f5f9; }
.menu-toggle span {
    display: block;
    width: 20px; height: 2px;
    background: #475569;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}

/* ---- Título / breadcrumb ---- */
.top-bar .page-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
}
.top-bar .page-breadcrumb {
    font-size: 12px;
    color: #64748b;
    margin: 2px 0 0 0;
}
.top-bar .page-breadcrumb span {
    color: #38bdf8;
    font-weight: 600;
}

/* ---- Campana de notificaciones ---- */
.notification-container { position: relative; }
.notification-bell {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    font-size: 18px;
    position: relative;
    transition: background .15s, transform .1s;
}
.notification-bell:hover { background: #f1f5f9; }
.notification-bell:active { transform: scale(0.96); }
.notification-badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}
.notification-badge.show { display: inline-flex; }

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-height: 420px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.12);
    display: none;
    overflow: hidden;
    flex-direction: column;
}
.notification-panel.show { display: flex; }
.notification-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.notification-header h3 { font-size: 14px; color: #0f172a; }
.btn-clear-notifications {
    font-size: 12px;
    color: #38bdf8;
    font-weight: 600;
}
.btn-clear-notifications:hover { text-decoration: underline; }

.notification-list {
    overflow-y: auto;
    flex: 1;
}
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9CA3AF;
}
.notification-empty-icon { font-size: 32px; margin-bottom: 12px; }

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}
.notification-item:hover { background: #f8fafc; }
.notification-item .nt-title { font-size: 13px; font-weight: 600; color: #0f172a; }
.notification-item .nt-text  { font-size: 12px; color: #64748b; margin-top: 2px; }
.notification-item .nt-time  { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* ---- User info ---- */
.user-info { position: relative; }
.user-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    transition: background .15s;
}
.user-profile-btn:hover { background: #f1f5f9; }
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.user-details {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.user-email {
    font-size: 11px;
    color: #64748b;
}
.dropdown-arrow {
    font-size: 9px;
    color: #94a3b8;
    margin-left: 4px;
    transition: transform .2s;
}
.user-profile-btn.open .dropdown-arrow { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.12);
    padding: 6px;
    display: none;
    flex-direction: column;
}
.user-dropdown.show { display: flex; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #0f172a;
    font-size: 13px;
    text-align: left;
    width: 100%;
}
.dropdown-item:hover { background: #f1f5f9; }
.dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 2px;
}
.logout-item { color: #ef4444; }
.logout-item:hover { background: #fef2f2; }

/* Responsivo */
@media (max-width: 720px) {
    .user-details { display: none; }
    .top-bar .page-breadcrumb { display: none; }
    .notification-panel { width: 280px; right: -40px; }
}

/* ============ CONTENT ============ */
.app-content {
    padding: 22px;
    flex: 1;
}
/* Separación automática entre bloques hijos directos */
.app-content > * + * { margin-top: 0; }
.card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #e5e7eb;
}
.card h2 { margin-bottom: 8px; color: #0f172a; }
.card p  { color: #64748b; }

/* Tarjeta de bienvenida */
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
}
.muted { color: #64748b; }

/* Responsivo */
@media (max-width: 900px) {
    .app-content { padding: 14px; }
}
