/* WAVO CMS: small additions on top of AdminLTE 4 */
:root {
  --wavo-ink: #0E1B33;
  --wavo-blue: #436aac;
  --wavo-accent: #c7dcff;
}

/* Sidebar in WAVO navy */
.app-sidebar { background-color: var(--wavo-ink) !important; }
.app-sidebar .sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.08); }
.app-sidebar .brand-image { background: #fff; border-radius: 50%; padding: 2px; }
.sidebar-menu .nav-link.active { background-color: var(--wavo-blue) !important; color: #fff !important; }
.sidebar-menu .nav-header { font-size: .72rem; letter-spacing: .06em; opacity: .65; }

/* User avatar (initial) in the header */
.user-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--wavo-blue); color: #fff; font-weight: 600; font-size: .85rem; }
.user-avatar-lg { width: 72px; height: 72px; font-size: 1.8rem; border: 3px solid rgba(255,255,255,.4); margin-bottom: .5rem; }
.user-header { text-align: center; padding: 1rem; }

/* Lists and forms */
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); white-space: nowrap; }
.thumb-sm { width: 80px; height: 50px; object-fit: cover; border-radius: 4px; background: var(--bs-tertiary-bg); }
.card-title { font-weight: 600; }
.form-label { font-weight: 600; font-size: .9rem; }
textarea.font-monospace { font-size: .85rem; }

/* Dashboard */
.info-box { min-height: 90px; }
.info-box .info-box-number { font-size: 1.6rem; }
.info-box a.stretched-link { position: static; }
.info-box a.stretched-link::after { z-index: 1; }

/* Sign-in page */
body.wavo-auth { background: linear-gradient(135deg, #0E1B33 0%, #16294A 55%, #436aac 100%); min-height: 100vh; }
body.wavo-auth .login-box { width: 380px; max-width: calc(100vw - 32px); }

/* Media library */
.media-drop { border: 2px dashed var(--bs-border-color); border-radius: .75rem; padding: 2rem 1rem; text-align: center; transition: background .2s, border-color .2s; }
.media-drop.drag { background: rgba(67,106,172,.08); border-color: var(--wavo-blue); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.media-tile { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .6rem; overflow: hidden; display: flex; flex-direction: column; }
.media-thumb { aspect-ratio: 4/3; background: var(--bs-tertiary-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb i { font-size: 2.6rem; color: var(--bs-secondary-color); }
.media-meta { padding: .5rem .6rem 0; }
.media-actions { padding: .4rem .6rem .6rem; display: flex; gap: .25rem; flex-wrap: wrap; }

/* Media picker (editor) */
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; max-height: 55vh; overflow-y: auto; padding: 2px; }
.picker-item { position: relative; border: 2px solid transparent; border-radius: .5rem; overflow: hidden; cursor: pointer; background: var(--bs-tertiary-bg); }
.picker-item .media-thumb { aspect-ratio: 1; }
.picker-item .name { font-size: .7rem; padding: .25rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item.selected { border-color: var(--wavo-blue); box-shadow: 0 0 0 3px rgba(67,106,172,.25); }
.picker-item .check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--wavo-blue); color: #fff; display: none; align-items: center; justify-content: center; font-size: .8rem; }
.picker-item.selected .check { display: flex; }
.tox-tinymce { border-radius: .5rem !important; }

/* =====================================================================
   FILE MANAGER (elFinder-style)
   ===================================================================== */
.fm{display:flex; flex-direction:column; height:calc(100vh - 210px); min-height:520px; outline:none; overflow:hidden;}
.fm-toolbar{display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:8px 10px; border-bottom:1px solid var(--bs-border-color); background:var(--bs-tertiary-bg);}
.fm-toolbar .btn span{margin-left:5px;}
.fm-toolbar .btn-light{border-color:var(--bs-border-color);}
.fm-search{position:relative;}
.fm-search i{position:absolute; left:9px; top:50%; transform:translateY(-50%); color:var(--bs-secondary-color); font-size:.8rem;}
.fm-search input{padding-left:28px; width:210px;}
.fm-body{flex:1; display:flex; min-height:0;}
.fm-tree{width:240px; flex-shrink:0; border-right:1px solid var(--bs-border-color); overflow:auto; padding:8px 4px; font-size:.9rem; display:flex; flex-direction:column;}
.fm-tree ul{list-style:none; margin:0; padding-left:14px;}
.fm-tree .fm-tree-root{padding-left:0;}
.fm-node{display:flex; align-items:center; gap:6px; padding:4px 6px; border-radius:6px; cursor:pointer; white-space:nowrap; user-select:none;}
.fm-node:hover{background:var(--bs-secondary-bg);}
.fm-node.active{background:var(--bs-primary-bg-subtle); color:var(--bs-primary-text-emphasis); font-weight:600;}
.fm-node .fm-label{overflow:hidden; text-overflow:ellipsis;}
.fm-tw{width:14px; display:inline-flex; justify-content:center; font-size:.7rem; color:var(--bs-secondary-color);}
.fm-tw i{transition:transform .15s;}
.fm-node.open .fm-tw i{transform:rotate(90deg);}
.fm-bin{margin-top:auto; border-top:1px solid var(--bs-border-color); border-radius:0; padding-top:8px;}
.fm-main{flex:1; display:flex; flex-direction:column; min-width:0; position:relative;}
.fm-pathbar{display:flex; align-items:center; gap:10px; padding:7px 12px; border-bottom:1px solid var(--bs-border-color); font-size:.9rem;}
.fm-crumbs{display:flex; flex-wrap:wrap; list-style:none; margin:0; padding:0; min-width:0;}
.fm-crumbs li{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:240px;}
.fm-crumbs li + li::before{content:"/"; padding:0 6px; color:var(--bs-secondary-color);}
.fm-crumbs a{text-decoration:none; border-radius:4px; padding:1px 3px;}
.fm-access{margin-left:auto; font-weight:500;}
.fm-items{flex:1; overflow:auto; padding:10px; outline:none; user-select:none; align-content:start;}
.fm-items.grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); gap:8px;}
.fm-items.grid .fm-item{display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 6px 8px; border-radius:8px; border:1px solid transparent; cursor:default; text-align:center;}
.fm-items.grid .fm-icon{position:relative; width:72px; height:64px; display:flex; align-items:center; justify-content:center; font-size:46px;}
.fm-items.grid .fm-icon img{max-width:72px; max-height:64px; object-fit:cover; border-radius:5px; box-shadow:0 1px 3px rgba(0,0,0,.2);}
.fm-items.grid .fm-name{font-size:.8rem; line-height:1.25; word-break:break-word; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
.fm-items.grid .fm-loc{font-size:.7rem; color:var(--bs-secondary-color); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%;}
.fm-item:hover{background:var(--bs-secondary-bg);}
.fm-item.selected{background:var(--bs-primary-bg-subtle); border-color:var(--bs-primary-border-subtle) !important;}
.fm-item.cut{opacity:.45;}
.fm-item.drop-over, .fm-node.drop-over, .fm-crumbs a.drop-over{outline:2px dashed var(--bs-primary); outline-offset:-2px; background:var(--bs-primary-bg-subtle);}
.fm-flag{position:absolute; right:4px; bottom:2px; font-size:.75rem; background:var(--bs-body-bg); border-radius:50%; width:18px; height:18px; display:flex; align-items:center; justify-content:center; box-shadow:0 0 0 1px var(--bs-border-color);}
.fm-items.list{display:block; padding:0;}
.fm-row{display:grid; grid-template-columns:minmax(200px,1fr) 90px 70px 150px 140px; align-items:center; gap:10px; padding:5px 12px; border-bottom:1px solid var(--bs-border-color-translucent); font-size:.875rem;}
[data-mode="bin"] .fm-row, [data-mode="search"] .fm-row{grid-template-columns:minmax(200px,1fr) 90px 70px 150px 140px minmax(120px,.6fr);}
.fm-row > *{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.fm-head{position:sticky; top:0; z-index:1; background:var(--bs-tertiary-bg); font-weight:600; font-size:.8rem;}
.fm-head button{all:unset; cursor:pointer;}
.fm-items.list .fm-c-name{display:flex; align-items:center; gap:8px; min-width:0;}
.fm-items.list .fm-icon{position:relative; font-size:1.15rem; width:22px; text-align:center;}
.fm-items.list .fm-flag{width:13px; height:13px; font-size:.55rem; right:-4px; bottom:-2px;}
.fm-items.list .fm-name{overflow:hidden; text-overflow:ellipsis;}
.fm-c-size{text-align:right;}
.fm-c-by, .fm-c-loc, .fm-c-modified, .fm-c-type{color:var(--bs-secondary-color);}
.fm-empty{grid-column:1/-1; text-align:center; color:var(--bs-secondary-color); padding:60px 20px;}
.fm-empty i{font-size:42px; display:block; margin-bottom:8px;}
.fm-dropzone{display:none; position:absolute; inset:44px 10px 10px; border:3px dashed var(--bs-primary); border-radius:12px; background:rgba(var(--bs-primary-rgb),.08); align-items:center; justify-content:center; flex-direction:column; gap:6px; pointer-events:none; font-size:1rem; color:var(--bs-primary-text-emphasis);}
.fm-dropzone i{font-size:46px;}
.fm.dragging-files .fm-dropzone{display:flex;}
.fm-status{display:flex; gap:16px; align-items:center; padding:5px 12px; border-top:1px solid var(--bs-border-color); font-size:.8rem; color:var(--bs-secondary-color); background:var(--bs-tertiary-bg);}
.fm-usage{display:flex; align-items:center; gap:8px;}
.fm-usage-bar{display:inline-block; width:110px; height:6px; border-radius:3px; background:var(--bs-secondary-bg); overflow:hidden;}
.fm-usage-bar span{display:block; height:100%; background:var(--bs-primary);}
.fm-usage-bar.full span{background:var(--bs-danger);}
.fm-menu{position:fixed; z-index:2050; display:none; min-width:220px;}
.fm-menu.show{display:block;}
.fm-uploads{position:fixed; right:18px; bottom:18px; width:360px; max-height:50vh; z-index:1040; overflow:hidden; display:flex; flex-direction:column;}
.fm-uploads .list-group{overflow:auto;}
.fm-up-name{max-width:230px;}
.fm-preview{display:flex; justify-content:center; align-items:center; min-height:300px;}
.fm-preview img{max-width:100%; max-height:75vh; border-radius:6px;}
.fm-preview iframe{width:100%; height:75vh; border:0;}
.fm-preview video{max-width:100%; max-height:75vh;}
.fm-preview pre{width:100%; max-height:75vh; overflow:auto; background:var(--bs-tertiary-bg); padding:12px; border-radius:6px; white-space:pre-wrap;}
.fm-props th{width:150px; color:var(--bs-secondary-color); font-weight:500;}
.fm-props td{word-break:break-all; white-space:pre-line;}
.text-purple{color:#7c3aed;}
@media (max-width:768px){
  .fm{height:auto; min-height:70vh;}
  .fm-tree{display:none;}
  .fm-toolbar .btn span{display:none;}
  .fm-search input{width:140px;}
  .fm-row, [data-mode="bin"] .fm-row, [data-mode="search"] .fm-row{grid-template-columns:1fr 70px;}
  .fm-row .fm-c-type, .fm-row .fm-c-modified, .fm-row .fm-c-by, .fm-row .fm-c-loc{display:none;}
}
