/* File: /File Manager/assets/css/style.css
   EcoFlare File Manager — dark shell aligned with Petty Cash */

:root {
  --bg-dark: #0F1A1A;
  --bg-surface: #152323;
  --bg-surface-2: #102020;
  --primary: #2BBBAD;
  --primary-2: #1f958a;
  --primary-soft: rgba(43,187,173,.14);
  --primary-ring: 0 0 0 3px rgba(43,187,173,.18);
  --green: #2FB34A;
  --danger: #f87171;
  --danger-soft: rgba(248,113,113,.12);
  --warning: #facc15;
  --info: #60a5fa;
  --text-light: #EAF2F2;
  --text-muted: #9FB3B3;
  --border-dark: rgba(255,255,255,.08);
  --border-dark-2: rgba(255,255,255,.14);
  --shadow-soft: 0 8px 24px rgba(0,0,0,.22);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(43,187,173,.08), transparent 65%),
    radial-gradient(900px 520px at 90% 8%, rgba(47,179,74,.06), transparent 60%);
}

.fm-wrapper { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.fm-sidebar {
  width: 260px; height: 100vh; position: fixed; left: 0; top: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #152323 0%, #101e1e 100%);
  border-right: 1px solid var(--border-dark);
  box-shadow: var(--shadow-soft);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
}
.fm-sidebar-head {
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border-dark); flex-shrink: 0;
}
.fm-sidebar-brand { display: flex; align-items: center; gap: 11px; }
.fm-sidebar-logo { width: 46px; height: 46px; object-fit: contain; }
.fm-sidebar-app-name {
  font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--primary); font-weight: 700;
}
.fm-sidebar-user-name { margin-top: 4px; font-weight: 700; font-size: 13.5px; }
.fm-sidebar-user-role { margin-top: 1px; font-size: 11.5px; color: var(--text-muted); }
.fm-sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 0; }
.fm-nav { list-style: none; padding: 0; margin: 0; }
.fm-nav-section {
  padding: 10px 16px 3px; font-size: 9.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(159,179,179,.38); font-weight: 600;
}
.fm-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 8px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-muted); border-left: 3px solid transparent;
}
.fm-nav li a i { width: 20px; text-align: center; color: rgba(234,242,242,.45); }
.fm-nav li.active a, .fm-nav li a:hover {
  background: rgba(43,187,173,.10); color: var(--primary); border-left-color: var(--primary);
}
.fm-nav li.active a i, .fm-nav li a:hover i { color: var(--primary); }
.fm-sidebar-bottom { padding: 10px 12px; border-top: 1px solid var(--border-dark); }
.fm-logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--text-light); background: var(--danger-soft); border: 1px solid rgba(248,113,113,.20);
  font-weight: 600;
}
.fm-logout-btn i { color: var(--danger); }
.fm-sidebar-footer {
  margin-top: 7px; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 11px; color: rgba(159,179,179,.55);
}
.fm-sidebar-footer .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.fm-sidebar-footer a { color: rgba(234,242,242,.72); text-decoration: none; font-weight: 700; }
.fm-sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150;
}
.fm-sidebar-overlay.show { display: block; }

.fm-main { flex: 1; margin-left: 260px; min-width: 0; }
.fm-topbar {
  height: 56px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 18px; border-bottom: 1px solid var(--border-dark);
  background: rgba(21,35,35,.72); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.fm-topbar-menu { justify-self: start; }
.fm-topbar-spacer { justify-self: end; min-width: 38px; }
.fm-topbar-toggle {
  display: none; background: transparent; border: 1px solid var(--border-dark-2);
  color: var(--text-light); width: 38px; height: 38px; border-radius: 10px;
}
.fm-topbar-datetime {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-light); font-size: 13px; font-weight: 600;
  letter-spacing: .2px; white-space: nowrap;
}
.fm-topbar-divider {
  color: var(--text-muted); font-weight: 400; opacity: .7;
}
#fmDatePart { color: var(--text-muted); font-weight: 500; }
#fmTimePart { color: var(--primary); }
.fm-content { padding: 22px 22px 40px; }

.fm-page-head {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  margin-bottom: 18px; flex-wrap: wrap;
}
.fm-kicker {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--primary); font-weight: 700; margin-bottom: 6px;
}
.fm-page-title { margin: 0; font-size: 1.55rem; font-weight: 700; }
.fm-page-sub { margin: 6px 0 0; color: var(--text-muted); max-width: 560px; }
.fm-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.fm-btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 10px;
  padding: 9px 14px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-decoration: none; color: var(--text-light); background: transparent;
}
.fm-btn-primary { background: var(--primary); color: #06201e; border-color: var(--primary); }
.fm-btn-primary:hover { background: var(--primary-2); color: #06201e; }
.fm-btn-ghost {
  background: rgba(255,255,255,.04); border-color: var(--border-dark-2); color: var(--text-light);
}
.fm-btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.fm-btn-danger { background: var(--danger-soft); border-color: rgba(248,113,113,.28); color: #fecaca; }
.fm-btn-block { width: 100%; justify-content: center; }
.fm-btn-sm { padding: 6px 10px; font-size: 12.5px; }

.fm-stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
.fm-stat {
  background: var(--bg-surface); border: 1px solid var(--border-dark); border-radius: var(--radius-md);
  padding: 14px 16px;
}
.fm-stat-warn { border-color: rgba(248,113,113,.28); }
.fm-stat-label { display: block; color: var(--text-muted); font-size: 11.5px; margin-bottom: 4px; }
.fm-stat strong { font-size: 1.25rem; }

.fm-panel {
  background: var(--bg-surface); border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg); padding: 16px;
}
.fm-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.fm-panel-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.fm-table-wrap { overflow-x: auto; }
.fm-table {
  width: 100%; border-collapse: collapse; min-width: 640px;
}
.fm-table th, .fm-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-dark);
  text-align: left; vertical-align: middle;
}
.fm-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted); font-weight: 700;
}
.fm-table tbody tr:hover { background: rgba(255,255,255,.03); }
.fm-row-danger td { background: rgba(248,113,113,.06); }
.fm-muted { color: var(--text-muted); font-size: 12px; }
.fm-empty {
  text-align: center; padding: 28px 12px; color: var(--text-muted);
}
.fm-list { list-style: none; margin: 0; padding: 0; }
.fm-list li {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--border-dark);
}
.fm-list a { color: var(--primary); text-decoration: none; font-weight: 600; }
.fm-list a:hover { text-decoration: underline; }
.fm-crumb-link { color: var(--primary); text-decoration: none; }
.fm-note-body { color: var(--text-muted); white-space: pre-wrap; margin: 0; }
.fm-note-pre {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  color: var(--text-light); font-family: inherit; font-size: 14px;
}
.fm-attach-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.fm-attach-card {
  background: var(--bg-surface-2); border: 1px solid var(--border-dark);
  border-radius: var(--radius-md); padding: 12px;
}
.fm-attach-name { font-weight: 700; word-break: break-word; }
.fm-attach-meta { color: var(--text-muted); font-size: 12px; margin: 6px 0 10px; }
.fm-url-cell, .fm-preview-cell {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted);
}
.fm-badge.danger { background: var(--danger-soft); color: #fecaca; }
.modal { z-index: 1080; }
.modal-backdrop { z-index: 1070; }

.fm-req { color: #f87171; }
.fm-dropzone {
  border: 1.5px dashed rgba(43,187,173,.45);
  border-radius: 14px;
  background: rgba(43,187,173,.05);
  padding: 28px 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.fm-dropzone:hover, .fm-dropzone:focus, .fm-dropzone.is-dragover {
  border-color: var(--primary);
  background: rgba(43,187,173,.12);
}
.fm-dropzone-inner {
  text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.fm-dropzone-inner i { font-size: 28px; color: var(--primary); }
.fm-dropzone-inner strong { color: var(--text-light); font-size: 13.5px; }
.fm-pending-list, .fm-attach-list {
  display: flex; flex-direction: column; gap: 8px; margin-top: 12px;
}
.fm-pending-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-surface-2); border: 1px solid var(--border-dark);
  border-radius: 10px; padding: 10px 12px;
}
.fm-pending-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fm-pending-left i { color: var(--primary); }
.fm-pending-name {
  font-weight: 600; font-size: 13px; word-break: break-word;
}
.fm-pending-size { color: var(--text-muted); font-size: 12px; }
.fm-pending-actions { display: flex; gap: 4px; flex-shrink: 0; }
.fm-side-actions { display: flex; flex-direction: column; gap: 8px; }
.fm-btn-block { width: 100%; justify-content: center; }
.fm-existing-block {
  padding-bottom: 10px; border-bottom: 1px solid var(--border-dark); margin-bottom: 10px;
}

.fm-upload-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.fm-form-actions {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--border-dark); margin-top: 4px;
}

.fm-browser-bar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.fm-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fm-crumb {
  background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0;
  font-size: 13.5px;
}
.fm-crumb:hover, .fm-crumb.active { color: var(--primary); }
.fm-crumb-sep { color: rgba(159,179,179,.35); font-size: 11px; }
.fm-browser-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fm-search-wrap {
  position: relative; min-width: 220px;
}
.fm-search-wrap i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted);
}
.fm-search, .fm-input, .fm-select {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border-dark-2);
  color: var(--text-light); border-radius: 10px; padding: 10px 12px; outline: none;
}
.fm-search { padding-left: 36px; }
.fm-search:focus, .fm-input:focus, .fm-select:focus { border-color: var(--primary); box-shadow: var(--primary-ring); }
input[type="date"].fm-input {
  cursor: pointer;
  color-scheme: dark;
}
input[type="date"].fm-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: transparent;
}
input[type="date"].fm-input {
  position: relative;
}
.fm-select { width: auto; min-width: 130px; }
.fm-hint { margin: 8px 0 0; color: var(--text-muted); font-size: 12px; }
.fm-form-label {
  display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--text-muted); font-weight: 600;
}

.fm-browser-panel {
  background: var(--bg-surface); border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg); padding: 14px; min-height: 360px;
}
.fm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px;
}
.fm-card {
  background: var(--bg-surface-2); border: 1px solid var(--border-dark);
  border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  min-height: 150px; transition: border-color .15s, transform .12s;
}
.fm-card:hover { border-color: rgba(43,187,173,.35); transform: translateY(-1px); }
.fm-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.fm-card-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 18px;
}
.fm-card-icon.folder { background: rgba(250,204,21,.12); color: #facc15; }
.fm-card-icon.link { background: rgba(96,165,250,.12); color: #60a5fa; }
.fm-card-icon.image { background: rgba(47,179,74,.12); color: #2FB34A; }
.fm-card-icon.video { background: rgba(248,113,113,.12); color: #f87171; }
.fm-card-title {
  margin: 0; font-size: 14px; font-weight: 700; word-break: break-word; cursor: pointer;
}
.fm-card-meta { color: var(--text-muted); font-size: 12px; }
.fm-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.fm-badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  background: rgba(255,255,255,.06); color: var(--text-muted);
}
.fm-badge.system { background: var(--primary-soft); color: var(--primary); }

.fm-browser-empty {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.fm-browser-empty i { font-size: 42px; color: var(--primary); margin-bottom: 12px; }
.fm-browser-empty h2 { color: var(--text-light); font-size: 1.2rem; margin: 0 0 6px; }

.fm-modal {
  background: #132121; color: var(--text-light); border: 1px solid var(--border-dark-2);
  border-radius: 16px;
}
.fm-modal .modal-header, .fm-modal .modal-footer {
  border-color: var(--border-dark);
}
.fm-modal .modal-title { font-size: 1.05rem; font-weight: 700; }
.fm-preview-frame {
  width: 100%; min-height: 360px; border: 0; border-radius: 12px; background: #000;
}
.fm-preview-img { max-width: 100%; max-height: 60vh; border-radius: 12px; display: block; margin: 0 auto; }

.fm-toast-wrap {
  position: fixed; right: 16px; bottom: 16px; z-index: 1080; display: flex; flex-direction: column; gap: 8px;
}
.fm-toast {
  background: #173030; border: 1px solid var(--border-dark-2); color: var(--text-light);
  padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow-soft); min-width: 220px;
}
.fm-toast.error { border-color: rgba(248,113,113,.35); }
.fm-toast.ok { border-color: rgba(43,187,173,.35); }

/* Login */
.fm-login-bg {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(43,187,173,.10), transparent 65%),
    radial-gradient(900px 520px at 90% 8%, rgba(47,179,74,.08), transparent 60%),
    var(--bg-dark);
}
.fm-login-card {
  width: min(440px, 100%); background: var(--bg-surface); border: 1px solid var(--border-dark);
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-soft);
}
.fm-login-header { padding: 24px 24px 8px; }
.fm-login-brand { display: flex; gap: 14px; align-items: center; }
.fm-login-logo { width: 56px; height: 56px; object-fit: contain; }
.fm-login-app-name {
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--primary); font-weight: 700;
}
.fm-login-title { margin: 4px 0 0; font-size: 1.6rem; }
.fm-login-sub { color: var(--text-muted); font-size: 13px; }
.fm-login-body { padding: 16px 24px 24px; }
.fm-input-wrap { position: relative; }
.fm-input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted);
}
.fm-input-wrap .fm-input { padding-left: 38px; }
.fm-pwd-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
}
.fm-alert {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  margin-bottom: 14px; font-size: 13px;
}
.fm-alert-danger { background: var(--danger-soft); border: 1px solid rgba(248,113,113,.28); color: #fecaca; }
.fm-login-hint { margin-top: 14px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

@media (max-width: 992px) {
  .fm-sidebar { transform: translateX(-105%); }
  .fm-sidebar.open { transform: translateX(0); }
  .fm-main { margin-left: 0; }
  .fm-topbar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .fm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .fm-content { padding: 16px 14px 32px; }
  .fm-stats { grid-template-columns: 1fr 1fr; }
  .fm-table { min-width: 520px; }
}
