/* =========================
   DASHBOARD (pages/dashboard.css)
   Goal: clean layout, equal blocks, mobile-friendly
========================= */

/* Container */
.dash-container{
  max-width:1240px;
}

/* Main grid */
.dash-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
}

@media (min-width: 980px){
  .dash-grid{
    grid-template-columns: 2fr 1fr; /* left wider, right sidebar */
    align-items:start;
  }
}

.dash-left,
.dash-right{
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* =========================
   Common helpers
========================= */

.card-pad{ padding:18px; }
.muted2{ color:var(--muted); }

.mini-title{
  margin:0 0 8px 0;
  font-size:16px;
  font-weight:850;
}

.hr{
  height:1px;
  background:var(--border);
  margin:14px 0;
}

/* Header rows inside cards */
.dash-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.dash-head h1{
  margin:0 0 6px 0;
  font-size:22px;
  letter-spacing:-.2px;
}

.dash-head p{
  margin:0;
}

/* Buttons row */
.btn-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (min-width: 980px){
  .btn-row{ justify-content:flex-end; }
}

/* =========================
   Equal blocks: "tiles"
========================= */

.dash-tiles{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top:14px;
}

.dash-tile{
  display:block;
  padding:14px;
  text-decoration:none;
}

.dash-tile:hover{
  box-shadow: 0 10px 28px rgba(2, 6, 23, .08);
  transform: translateY(-1px);
}

.dash-tile__row{
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.dash-tile__ico{
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  background:#fff;
  font-size:18px;
  line-height:1;
}

.dash-tile__title{
  font-weight:850;
}

.dash-tile__desc{
  margin-top:4px;
  font-size:13px;
  color:var(--muted);
  line-height:1.35;
}

/* =========================
   Files toolbar (search/filter row)
========================= */

.dash-files-toolbar .input{
  height:42px;
}

.dash-files-actions{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

/* =========================
   "Desktop" Cloud view (folders + files)
   Use in template:
     <div class="cloud-grid"> ... items ... </div>
========================= */

.cloud-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin:6px 0 10px;
}

.cloud-breadcrumbs{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  font-size:13px;
  color:var(--muted);
}

.cloud-breadcrumbs a{
  color:var(--muted);
  text-decoration:none;
}

.cloud-breadcrumbs a:hover{
  color:var(--text);
}

.cloud-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* icon buttons like "new folder", "upload" */
.icon-btn{
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

.icon-btn:hover{
  background:#f9fafb;
  border-color:#d1d5db;
}

.icon-btn:active{
  transform: translateY(1px);
}

.icon-btn svg{
  width:22px;
  height:22px;
  display:block;
}

.cloud-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}

@media (min-width: 720px){
  .cloud-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1100px){
  .cloud-grid{
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.cloud-item{
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  padding:12px;
  text-decoration:none;
  color:inherit;
  display:flex;
  flex-direction:column;
  gap:10px;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
  min-width:0;
}

.cloud-item:hover{
  background:#f9fafb;
  border-color:#d1d5db;
}

.cloud-item:active{
  transform: translateY(1px);
}

.cloud-ico{
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  overflow:hidden;
}

.cloud-ico svg{
  width:26px;
  height:26px;
  display:block;
}

.cloud-thumb{
  width:44px;
  height:44px;
  object-fit:cover;
  border-radius:12px;
  display:block;
}

.cloud-name{
  font-weight:650;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cloud-meta{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Item footer actions (like download) */
.cloud-item__actions{
  margin-top:auto;
  display:flex;
  gap:8px;
}

.cloud-item__actions .btn-sm{
  width:100%;
  text-align:center;
}

/* =========================
   Small buttons
========================= */

.btn-sm{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--border);
  font-size:13px;
  background:#fff;
  cursor:pointer;
}

.btn-sm:hover{ opacity:.92; }

/* =========================
   Profile card
========================= */

.profile-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}

.profile-left{
  min-width:0;
  flex:1;
}

.profile-subtitle{
  font-size:13px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.35px;
}

.profile-title{
  font-size:22px;
  font-weight:850;
  margin:4px 0 0 0;
  line-height:1.2;
}

.profile-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:10px;
  font-size:13px;
}

.profile-meta a{
  color:var(--muted);
  text-decoration:none;
}

.profile-meta a:hover{
  color:var(--text);
}

/* Avatar */
.profile-avatar{
  flex:0 0 auto;
}

.profile-avatar__box{
  width:120px;
  height:120px;
  border-radius:24px;
  overflow:visible;     /* ✅ бейдж может выходить */
  background:#f7f7f9;
  position: relative;   /* ✅ важно! */
}

/* новый контейнер, который режет фото */
.profile-avatar__clip{
  width:100%;
  height:100%;
  border-radius:24px;
  overflow:hidden;      /* ✅ режем фото по радиусу */
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f7f7f9;
}

.profile-avatar__clip img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.profile-avatar__box img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* =========================
   Tabs (optional)
========================= */

.dash-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.dash-tab{
  border:1px solid var(--border);
  background:#fff;
  border-radius:999px;
  padding:8px 10px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.dash-tab.is-active{
  background:rgba(20,85,135,.10);
  border-color:rgba(20,85,135,.25);
  color:var(--brand);
}

.dash-tabpanel{
  display:none;
  margin-top:12px;
}

.dash-tabpanel.is-active{
  display:block;
}

/* =========================
   Modal (create folder)
========================= */

.modal{
  position:fixed;
  inset:0;
  background: rgba(2, 6, 23, .45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index: 9999;
}

.modal.is-open{ display:flex; }

.modal-card{
  width:min(520px, 100%);
  background:#fff;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow: 0 18px 50px rgba(2, 6, 23, .20);
  padding:16px;
}

.modal-title{
  font-weight:850;
  margin:0 0 10px 0;
}

.modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:12px;
}

/* =========================
   Mobile fixes
========================= */

@media (max-width: 700px){

  .profile-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .profile-avatar__box{
    width:96px;
    height:96px;
    border-radius:22px;
  }

  .cloud-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===============================
   CLOUD LIST (Desktop-like)
================================= */

.cloud-list{
  display:flex;
  flex-direction:column;
}

.cloud-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 6px;
  border-bottom:1px solid var(--border);
  text-decoration:none;
  color:inherit;
}

.cloud-row:last-child{ border-bottom:none; }

.cloud-row__ico{
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  color:#111827;
}

.cloud-row__ico svg{
  width:24px;
  height:24px;
}

.cloud-row__thumb{
  width:34px;
  height:34px;
  border-radius:8px;
  object-fit:cover;
  border:1px solid var(--border);
}

.cloud-row__main{
  min-width:0;
  flex:1;
}

.cloud-row__name{
  font-weight:650;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cloud-row__meta{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
  white-space:nowrap;
}

.cloud-row__right{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
}

.cloud-row__hint{
  font-size:12px;
  color:var(--muted);
}

.cloud-row--folder:hover{
  background:rgba(0,0,0,.02);
}

@media (max-width:700px){
  .cloud-row{
    padding:12px 0;
  }
  .cloud-row__right .btn-sm{
    padding:10px 12px;
  }
}

.pro-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #f6b73c, #e67e22);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  z-index: 5;
}