﻿:root {
  --bg-a: #f7fafc;
  --bg-b: #e8f1fb;
  --ink: #1f2937;
  --muted: #6b7280;
  --brand: #7c3aed;
  --brand-2: #a855f7;
  --accent: #f59e0b;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(15, 23, 42, 0.08);
  --card-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
  --card-shadow-hover: 0 18px 40px rgba(15, 23, 42, 0.14), 0 4px 14px rgba(15, 23, 42, 0.08);
  --card-highlight: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.56));
}

html {
  font-size: 14px;
  height: 100%;
  position: relative;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Vazirmatn FD", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, #dbeafe 0, transparent 34%),
    radial-gradient(circle at 0% 100%, #d1fae5 0, transparent 28%),
    linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 100%);
  background-color: var(--bg-b);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 1200px 1200px, 1200px 1200px, 100% 100%;
  background-position: top right, bottom left, top center;
      background-attachment: fixed;
}

.site-main {
  flex: 1 0 auto;
}

.top-nav {
  background: linear-gradient(90deg, #0f172a 0%, #1e1b4b 55%, #7c3aed 100%);
}

.top-nav .nav-link,
.top-nav .navbar-brand {
  color: #f8fafc !important;
}

.mobile-menu-btn {
  border: 1px solid rgba(248, 250, 252, 0.5);
  padding: 6px 8px;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 10px;
}

.mobile-menu-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #f8fafc;
  border-radius: 2px;
}

.mobile-sidebar-menu {
  --bs-offcanvas-width: min(88vw, 320px);
}

.mobile-sidebar-menu .offcanvas-header {
  background: linear-gradient(90deg, #0f172a 0%, #1e1b4b 55%, #7c3aed 100%);
  color: #f8fafc;
}

.mobile-sidebar-links .list-group-item {
  border: 0;
  border-radius: 12px;
  margin-bottom: 4px;
}

.mobile-sidebar-links .list-group-item:hover,
.mobile-sidebar-links .list-group-item:focus {
  background: #eef2ff;
}

.mobile-sidebar-menu .navbar-nav .nav-link,
.mobile-sidebar-menu .navbar-nav .btn.nav-link {
  color: #0f172a !important;
}

.mobile-sidebar-menu .navbar-nav .nav-link:hover,
.mobile-sidebar-menu .navbar-nav .btn.nav-link:hover {
  color: #1d4ed8 !important;
}

.glass-panel,
.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-highlight), var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: var(--card-shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(59, 130, 246, 0.28);
}

.card-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.08));
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
  font-weight: 700;
  border-top-left-radius: 18px !important;
  border-top-right-radius: 18px !important;
}

.card-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.55);
  border-bottom-left-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
}

.page-hero {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 55%, #ddd6fe 100%);
}

.btn-primary {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border: none;
}

.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-warning {
  background-color: var(--accent);
  border-color: var(--accent);
}

.form-control,
.form-select {
  border-radius: 12px;
  border: 1px solid #cbd5e1;
}

.form-control:focus,
.form-select:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.18);
}

.table thead th {
  border-bottom: none;
  color: #0f172a;
  font-weight: 800;
}

.table tbody tr {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.badge.text-bg-info {
  background-color: #ccfbf1 !important;
  color: #134e4a !important;
}

.dashboard-badge {
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.dashboard-badge-strong {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #0f172a !important;
}

.login-wrap {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 92vw);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
}

.server-terminal-loading-card {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

body.dark-theme {
  --bg-a: #0b1220;
  --bg-b: #111a2d;
  --ink: #e5e7eb;
  --muted: #a3adc2;
  --panel: rgba(17, 24, 39, 0.88);
  --line: rgba(148, 163, 184, 0.24);
  --card-shadow: 0 14px 34px rgba(2, 6, 23, 0.48), 0 3px 12px rgba(2, 6, 23, 0.38);
  --card-shadow-hover: 0 24px 48px rgba(2, 6, 23, 0.62), 0 7px 18px rgba(2, 6, 23, 0.46);
  --card-highlight: linear-gradient(180deg, rgba(30, 41, 59, 0.74), rgba(15, 23, 42, 0.50));
  background:
    radial-gradient(circle at 100% 0%, #1f2937 0, transparent 34%),
    radial-gradient(circle at 0% 100%, #0f172a 0, transparent 28%),
    linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 100%);
  background-color: var(--bg-b);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 1200px 1200px, 1200px 1200px, 100% 100%;
  background-position: top right, bottom left, top center;
}

body.dark-theme .glass-panel,
body.dark-theme .card {
  color: var(--ink);
}

body.dark-theme .card:hover {
  border-color: rgba(56, 189, 248, 0.38);
}

body.dark-theme .card-header {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.64), rgba(15, 23, 42, 0.28));
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

body.dark-theme .card-footer {
  background: rgba(15, 23, 42, 0.55);
  border-top-color: rgba(148, 163, 184, 0.2);
}

body.dark-theme .mobile-menu-btn {
  border-color: rgba(148, 163, 184, 0.55);
}

body.dark-theme .mobile-sidebar-menu {
  background-color: #0b1220;
  color: #e5e7eb;
}

body.dark-theme .mobile-sidebar-links .list-group-item {
  background: rgba(15, 23, 42, 0.65);
  color: #e5e7eb;
}

body.dark-theme .mobile-sidebar-links .list-group-item:hover,
body.dark-theme .mobile-sidebar-links .list-group-item:focus {
  background: rgba(30, 41, 59, 0.88);
}

body.dark-theme .mobile-sidebar-menu .navbar-nav .nav-link,
body.dark-theme .mobile-sidebar-menu .navbar-nav .btn.nav-link {
  color: #e5e7eb !important;
}

body.dark-theme .mobile-sidebar-menu .navbar-nav .nav-link:hover,
body.dark-theme .mobile-sidebar-menu .navbar-nav .btn.nav-link:hover {
  color: #93c5fd !important;
}

body.dark-theme .modal-content {
  background-color: #0f172a;
  color: #e5e7eb;
  border-color: #334155;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

body.dark-theme .server-terminal-loading-card {
  background: #0f172a;
  color: #e5e7eb;
  border-color: #334155;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

body.dark-theme .modal-header,
body.dark-theme .modal-footer {
  border-color: #334155;
}

body.dark-theme .modal-title {
  color: #e5e7eb;
}

body.dark-theme .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.85;
}

body.dark-theme .btn-close:hover {
  opacity: 1;
}

body.dark-theme .offcanvas {
  background-color: #0b1220;
  color: #e5e7eb;
  border-color: #334155;
}

body.dark-theme .offcanvas-header {
  border-color: #334155 !important;
}

body.dark-theme .offcanvas-title {
  color: #e5e7eb;
}

body.dark-theme .dropdown-menu {
  background-color: #0f172a;
  color: #e5e7eb;
  border-color: #334155;
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.5);
}

body.dark-theme .dropdown-item {
  color: #e5e7eb;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
  color: #f8fafc;
  background-color: #1e293b;
}

body.dark-theme .dropdown-item.active,
body.dark-theme .dropdown-item:active {
  color: #f8fafc;
  background-color: #2563eb;
}

body.dark-theme .toast {
  background-color: #0f172a;
  color: #e5e7eb;
  border-color: #334155;
}

body.dark-theme .toast-header {
  background-color: #111827;
  color: #e5e7eb;
  border-color: #334155;
}

body.dark-theme .popover {
  --bs-popover-bg: #0f172a;
  --bs-popover-border-color: #334155;
  --bs-popover-header-bg: #111827;
  --bs-popover-header-color: #e5e7eb;
  --bs-popover-body-color: #e5e7eb;
}

body.dark-theme .tooltip {
  --bs-tooltip-bg: #111827;
  --bs-tooltip-color: #e5e7eb;
}

body.dark-theme .text-muted,
body.dark-theme .small.text-muted {
  color: var(--muted) !important;
}

body.dark-theme .table {
  color: var(--ink);
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-striped-bg: rgba(148, 163, 184, 0.08);
  --bs-table-striped-color: var(--ink);
  --bs-table-hover-bg: rgba(148, 163, 184, 0.14);
  --bs-table-hover-color: var(--ink);
  --bs-table-border-color: rgba(148, 163, 184, 0.2);
}

body.dark-theme .table thead th {
  color: #dbe7ff;
  background-color: rgba(15, 23, 42, 0.65) !important;
}

body.dark-theme .table tbody tr {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

body.dark-theme .table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--ink) !important;
}

body.dark-theme .form-control,
body.dark-theme .form-select {
  background-color: #0f172a;
  border-color: #334155;
  color: #e5e7eb;
}

body.dark-theme .form-control::placeholder {
  color: #94a3b8;
}

body.dark-theme .page-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

body.dark-theme .list-group {
  --bs-list-group-bg: rgba(15, 23, 42, 0.55);
  --bs-list-group-color: var(--ink);
  --bs-list-group-border-color: rgba(148, 163, 184, 0.2);
  --bs-list-group-action-hover-bg: rgba(148, 163, 184, 0.12);
  --bs-list-group-action-hover-color: var(--ink);
  --bs-list-group-action-active-bg: rgba(148, 163, 184, 0.2);
  --bs-list-group-action-active-color: var(--ink);
}

body.dark-theme .list-group-item {
  background-color: rgba(15, 23, 42, 0.55) !important;
  color: var(--ink) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

body.dark-theme .dashboard-badge {
  background: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-theme .dashboard-badge-strong {
  background: #1d4ed8 !important;
  color: #eff6ff !important;
  border-color: #2563eb !important;
}

body.dark-theme .auth-card {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.92)) !important;
  border-color: #334155 !important;
  color: #e5e7eb;
}

body.dark-theme .auth-badge {
  background: rgba(15, 118, 110, 0.22) !important;
  color: #99f6e4 !important;
  border-color: rgba(45, 212, 191, 0.45) !important;
}

body.dark-theme .auth-input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

body.dark-theme .auth-input::placeholder {
  color: #94a3b8 !important;
}

body.dark-theme #storageQuotaChart > div {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}

.document-file-thumb,
.detail-file-thumb {
  width: auto;
  height: auto;
  max-width: 100px;
  max-height: 100px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  object-fit: cover;
  background: #f8fafc;
}

.announcement-item {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 12px;
}

.announcement-green { background-color: #dcfce7; }
.announcement-red { background-color: #fee2e2; }
.announcement-blue { background-color: #dbeafe; }
.announcement-yellow { background-color: #fef9c3; }
.announcement-white { background-color: #ffffff; }
body.dark-theme .announcement-item {
  border-color: #334155;
}
body.dark-theme .announcement-green { background-color: #14532d; color: #dcfce7; }
body.dark-theme .announcement-red { background-color: #7f1d1d; color: #fee2e2; }
body.dark-theme .announcement-blue { background-color: #1e3a8a; color: #dbeafe; }
body.dark-theme .announcement-yellow { background-color: #713f12; color: #fef9c3; }
body.dark-theme .announcement-white { background-color: #1f2937; color: #e5e7eb; }
.fm-shell .fm-tree-pane { background: linear-gradient(180deg, #f8fafc, #eef2ff); min-height: 70vh; }
.fm-shell .fm-files-pane { background: #fff; min-height: 70vh; }
.fm-shell .fm-tree-pane { flex: 0 0 24%; max-width: 24%; }
.fm-shell .fm-files-pane { flex: 0 0 76%; max-width: 76%; }
.fm-tree-node { padding: .35rem .5rem; border-radius: .5rem; cursor: pointer; }
.fm-tree-node:hover { background: #e2e8f0; }
.fm-tree-node.active { background: #c7d2fe; font-weight: 700; }
.fm-child { margin-right: 1rem; border-right: 1px dashed #cbd5e1; padding-right: .6rem; }
.fm-tree-toggle { width: 20px; height: 20px; border: 0; background: transparent; color: #475569; }
.fm-tree-row { display: flex; align-items: center; gap: .25rem; }
.fm-card { border: 1px solid #e2e8f0; border-radius: .8rem; padding: .7rem; background: #fff; }
.fm-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: .5rem; border: 1px solid #cbd5e1; background: #f8fafc; }
.fm-card { height: 100%; display: flex; flex-direction: column; }
.fm-card-preview { height: 120px; border: 1px solid #cbd5e1; border-radius: .6rem; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fm-card-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fm-card-body { margin-top: .6rem; display: grid; gap: .2rem; }
.fm-card-body .fw-semibold {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.fm-file-name,
.fm-card-body .fw-semibold {
    color: #111827 !important;
    text-decoration: none !important;
}
.fm-file-name:hover,
.fm-file-name:focus,
.fm-card-body .fw-semibold:hover,
.fm-card-body .fw-semibold:focus {
    color: #111827 !important;
    text-decoration: none !important;
}
.fm-context-menu { position: fixed; z-index: 2000; min-width: 180px; background: #fff; border: 1px solid #cbd5e1; border-radius: .6rem; box-shadow: 0 10px 24px rgba(0,0,0,.12); padding: .25rem; }
.fm-context-menu .dropdown-item {border-radius: .4rem;padding: 6px 10px;border-bottom: 1px solid #f0f0f0;border-radius: 0;}
@media (max-width: 991.98px) {
    .fm-shell .fm-tree-pane,
    .fm-shell .fm-files-pane { flex: 0 0 100%; max-width: 100%; }
    .fm-shell .fm-tree-pane { min-height: auto; }
    #fmFilesListWrap #fmFilesTable thead th:nth-child(2),
    #fmFilesListWrap #fmFilesTable tbody td:nth-child(2),
    #fmFilesListWrap #fmFilesTable thead th:nth-child(4),
    #fmFilesListWrap #fmFilesTable tbody td:nth-child(4),
    #fmFilesListWrap #fmFilesTable thead th:nth-child(5),
    #fmFilesListWrap #fmFilesTable tbody td:nth-child(5) {
        display: none;
    }
}

.fm-tree-accordion-toggle {
    text-align: right;
}
.fm-shell {
    position: relative;
}
.fm-shell.fm-drag-over {
    outline: 2px dashed #0ea5a1;
    outline-offset: -6px;
}
.fm-shell.fm-drag-over::after {
    content: "فایل‌ها را اینجا رها کنید";
    position: absolute;
    inset: 8px;
    border-radius: 12px;
    background: rgba(14, 165, 161, 0.10);
    color: #0f766e;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

.fm-file-mobile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-top: .25rem;
    color: #6b7280;
    font-size: .82rem;
}

#fmFolderViewersPanel {
    border-color: #dbe3f1 !important;
    background: rgba(248, 250, 252, 0.82) !important;
}
body.dark-theme #fmFolderViewersPanel {
    border-color: #334155 !important;
    background: rgba(15, 23, 42, 0.68) !important;
}
body.dark-theme .fm-file-mobile-meta {
    color: #94a3b8;
}
body.dark-theme .fm-shell.fm-drag-over {
    outline-color: #22d3ee;
}
body.dark-theme .fm-shell.fm-drag-over::after {
    background: rgba(34, 211, 238, 0.14);
    color: #67e8f9;
}

body.dark-theme .fm-shell .fm-tree-pane {
    background: linear-gradient(180deg, #1e293b, #0f172a);
    border-color: #334155 !important;
}
body.dark-theme .fm-shell .fm-files-pane {
    background: #0b1220;
    color: #e2e8f0;
}
body.dark-theme .fm-tree-node {
    color: #e2e8f0;
}
body.dark-theme .fm-tree-node:hover {
    background: #1f2937;
}
body.dark-theme .fm-tree-node.active {
    background: #1d4ed8;
    color: #f8fafc;
}
body.dark-theme .fm-child {
    border-right-color: #334155;
}
body.dark-theme .fm-tree-toggle {
    color: #cbd5e1;
}
body.dark-theme .fm-card {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .fm-card-preview {
    background: #111827;
    border-color: #334155;
}
body.dark-theme .fm-thumb {
    background: #111827;
    border-color: #334155;
}
body.dark-theme .fm-context-menu {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
body.dark-theme .fm-context-menu .dropdown-item {
    color: #e2e8f0;
}
body.dark-theme .fm-context-menu .dropdown-item:hover {
    background: #1f2937;
}

.fm-context-menu .dropdown-item:hover{
  background-color: rgb(244, 244, 244);
}
body.dark-theme #fmFilesTable {
    color: #e2e8f0;
}
body.dark-theme #fmFilesTable thead th {
    background: #111827;
    color: #cbd5e1;
    border-color: #334155;
}
body.dark-theme #fmFilesTable td {
    border-color: #334155;
}
body.dark-theme #fmFilesTable a {
    color: #93c5fd;
}
body.dark-theme #fmFilesTable .fm-file-name,
body.dark-theme .fm-card-body .fw-semibold {
    color: #e2e8f0 !important;
    text-decoration: none !important;
}
body.dark-theme .fm-shell .card-footer {
    background: #0f172a;
    border-top-color: #334155;
    color: #94a3b8 !important;
}


@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}



