@charset "UTF-8";

:root {
  --ink: #172027;
  --muted: #66727e;
  --line: #dce2e7;
  --line-strong: #c9d1d8;
  --surface: #ffffff;
  --surface-alt: #f8fafb;
  --canvas: #f2f5f6;
  --primary: #0f766e;
  --primary-dark: #0a5d57;
  --primary-soft: #e5f3f0;
  --accent: #c4573a;
  --accent-soft: #f8ebe6;
  --blue: #326b98;
  --blue-soft: #e8f0f7;
  --amber: #a66b14;
  --amber-soft: #fff2d8;
  --focus: rgba(15, 118, 110, 0.2);
  --shadow-sm: 0 1px 2px rgba(23, 32, 39, 0.05);
  --shadow-lg: 0 22px 55px rgba(23, 32, 39, 0.14);
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

a:hover,
a:focus {
  color: var(--primary-dark);
}

.container {
  width: min(1360px, calc(100% - 40px));
}

.file-app .container {
  padding-bottom: 48px;
}

.app-header {
  position: relative;
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  height: auto;
  padding: 12px 2px;
  line-height: normal;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover,
.brand:focus {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  font-size: 19px;
  font-weight: 700;
}

.brand strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions,
#tb {
  display: flex;
  align-items: center;
  gap: 2px;
}

#tb .btn-link,
#tb2 .btn-link {
  color: #4e5b66;
  text-decoration: none;
}

#tb .btn-link:hover,
#tb2 .btn-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.rightbtn {
  float: none;
  margin-left: 2px;
}

.btn {
  min-height: 36px;
  border-radius: 6px;
  border-color: var(--line-strong);
  box-shadow: none;
  font-weight: 600;
  letter-spacing: 0;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.btn-default {
  background: var(--surface);
  color: #35414b;
}

.btn-default:hover,
.btn-default:focus {
  border-color: #aeb9c2;
  background: #f6f8f9;
  color: var(--ink);
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:active:focus {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.btn-danger {
  border-color: #b84631;
  background: #b84631;
}

.btn:focus,
.form-control:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.btn[disabled] {
  opacity: 0.55;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: #4f5c67;
}

.icon-button:hover,
.icon-button:focus,
.icon-button.active {
  border-color: #9bc2bb;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.form-control {
  height: 40px;
  border-color: var(--line-strong);
  border-radius: 6px;
  box-shadow: none;
  color: var(--ink);
}

.form-control::placeholder {
  color: #929ca5;
}

.workspace-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 2px 10px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-meta .glyphicon {
  margin-right: 5px;
  color: #87929c;
}

.panel.workspace-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

#filetable > .panel-heading {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
}

#filetable .heading {
  order: 1;
  display: flex;
  align-items: center;
  min-height: 64px;
  margin: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

#filetable .navbar-header {
  float: none;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 180px);
}

#filetableheadera {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: none;
  min-height: 42px;
  margin: 0;
  padding: 4px 8px 4px 2px;
  color: var(--ink) !important;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

#folderIconSpan {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 7px;
  background: var(--amber-soft);
  color: var(--amber);
}

#currentFolderName {
  flex: 0 1 auto;
  max-width: calc(100% - 52px);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-toolbar {
  position: static;
  order: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 11px 16px;
  background: var(--surface-alt);
}

.item-summary {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.workspace-search {
  display: grid;
  grid-template-columns: 112px minmax(180px, 280px) 36px;
  gap: 0;
  margin: 0 0 0 auto;
}

.workspace-search .form-control {
  height: 36px;
}

.workspace-search select {
  border-radius: 6px 0 0 6px;
  border-right: 0;
  background: #fff;
  font-size: 13px;
}

.workspace-search input {
  border-radius: 0;
}

.workspace-search .icon-button {
  border-radius: 0 6px 6px 0;
  border-left: 0;
}

.view-switch {
  display: inline-flex;
}

.view-switch .btn {
  border-radius: 0;
}

.view-switch .btn:first-child {
  border-radius: 6px 0 0 6px;
}

.view-switch .btn:last-child {
  border-radius: 0 6px 6px 0;
}

@media (min-width: 768px) {
  #filetable .navbar-collapse {
    display: flex !important;
    align-items: center;
    flex: 1;
    min-height: 0 !important;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  #filetable .navbar-nav {
    display: flex;
    align-items: center;
    float: none;
    margin: 0;
  }

  #filetable .navbar-right {
    float: none !important;
    margin: 0 0 0 auto;
  }

  #filetable .navbar-nav > li > a {
    min-height: 38px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #53606b;
  }

  #filetable .navbar-nav > li > a:hover,
  #filetable .navbar-nav > li > a:focus {
    background: var(--surface-alt);
    color: var(--primary);
  }
}

.mobile-toolbar {
  margin-bottom: 10px;
  white-space: nowrap;
}

.mobile-search {
  display: none;
  gap: 6px;
  margin-bottom: 10px;
}

.table {
  width: 100%;
  margin-bottom: 0;
  table-layout: auto;
  background: var(--surface);
}

#filetable .table {
  table-layout: fixed;
}

.table > thead > tr > th {
  height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  color: #66737e;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
  cursor: pointer;
}

.table > thead > tr > th:first-child,
.table > tbody > tr > td:first-child {
  padding-left: 16px;
}

#filetable .table > thead > tr > th:nth-child(1) { width: 45%; }
#filetable .table > thead > tr > th:nth-child(2) { width: 17%; }
#filetable .table > thead > tr > th:nth-child(3) { width: 10%; }
#filetable .table > thead > tr > th:nth-child(4) { width: 13%; }
#filetable .table > thead > tr > th:nth-child(5) { width: 15%; }

.table > tbody > tr > td {
  height: 58px;
  padding: 9px 12px;
  border-color: #edf0f2;
  word-break: normal;
  vertical-align: middle;
}

.table-hover > tbody > tr {
  transition: background-color 0.14s ease;
}

.table-hover > tbody > tr:hover {
  background: #f5f9f8;
}

.table > tbody > tr.info > td {
  background: var(--primary-soft);
}

.filerow {
  cursor: default;
}

.file-name-cell {
  min-width: 220px;
  color: #27323b;
  font-weight: 600;
}

.file-name-content {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.file-name-cell > .btn-link {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #27323b;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
  min-width: 0;
}

.file-name-cell > .btn-link:hover,
.file-name-cell > .btn-link:focus,
.file-name-cell > .btn-link:active {
  border-color: transparent;
  background: transparent;
  color: var(--primary-dark);
  text-decoration: none;
  outline: 0;
  box-shadow: none;
}

.file-name-cell > .btn-link:focus .file-name-text {
  text-decoration: underline;
  text-decoration-color: rgba(18, 115, 102, 0.35);
  text-underline-offset: 3px;
}

.file-name-text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 35px;
  margin-top: 6px;
}

.folder-access-row .dropdown {
  flex: 0 0 auto;
}

.folder-access-label {
  color: var(--muted);
  font-size: 12px;
}

.folder-access-label .glyphicon {
  margin-right: 4px;
}

.folder-access-button {
  min-height: 32px;
  padding: 4px 2px 4px 10px;
  border: 0;
  color: var(--primary-dark);
  font-weight: 700;
  white-space: nowrap;
}

.folder-access-button:hover,
.folder-access-button:focus {
  background: transparent;
  color: var(--primary);
  text-decoration: none;
  box-shadow: none;
}

.folder-access-row .dropdown-menu {
  width: 300px;
  min-width: 100%;
  max-width: calc(100vw - 48px);
  overflow: visible;
}

.folder-access-row .dropdown-menu > li > a {
  display: block;
  line-height: 1.4;
  white-space: normal;
}

.folder-access-row .dropdown-menu small {
  display: block;
  margin: 2px 0 0;
  color: #98a2aa;
  font-size: 11px;
}

#newFolderModal .modal-content,
#renameFolderModal .modal-content,
#importFolderModal .modal-content {
  overflow: visible;
}

.file-type-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin-right: 10px;
  border-radius: 7px;
  background: #edf1f3;
  color: #596772;
  font-size: 14px;
}

.file-type-icon.folder {
  background: var(--amber-soft);
  color: var(--amber);
}

.file-type-icon.image {
  background: var(--primary-soft);
  color: var(--primary);
}

.file-type-icon.media {
  background: var(--accent-soft);
  color: var(--accent);
}

.file-type-icon.document {
  background: var(--blue-soft);
  color: var(--blue);
}

.file-date-cell,
.file-owner-cell {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  min-width: 140px;
  white-space: nowrap;
}

.file-actions .icon-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  margin: 0 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #596772;
  font-size: 0;
}

.file-actions .icon-action:nth-child(n+4):not(.context-trigger) {
  display: none;
}

.file-actions .context-trigger {
  display: inline-grid;
}

.file-context-menu {
  position: fixed;
  z-index: 3000;
  display: none;
  width: 210px;
  max-height: min(480px, calc(100vh - 16px));
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 45px rgba(23, 32, 39, 0.2);
}

.file-context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #35414b;
  text-align: left;
}

.file-context-menu button:hover,
.file-context-menu button:focus {
  outline: 0;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.file-context-menu button.danger {
  color: #a33f29;
}

.file-context-menu button.danger:hover,
.file-context-menu button.danger:focus {
  background: var(--accent-soft);
}

.file-context-menu .glyphicon {
  width: 18px;
  color: #6b7781;
  text-align: center;
}

.context-separator {
  height: 1px;
  margin: 5px 3px;
  background: var(--line);
}

.text-preview-dialog {
  height: min(80vh, 780px);
}

.text-preview-body {
  height: calc(100% - 124px);
  padding: 0;
}

#textPreviewContent {
  height: 100%;
  margin: 0;
  overflow: auto;
  padding: 20px 24px;
  border: 0;
  border-radius: 0;
  background: #fbfcfd;
  color: #27323b;
  font: 14px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, "Microsoft YaHei", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.file-actions .icon-action .glyphicon {
  font-size: 13px;
}

.file-actions .icon-action:hover,
.file-actions .icon-action:focus {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.file-actions .danger-action:hover,
.file-actions .danger-action:focus,
.admin-row-actions .danger-action:hover,
.admin-row-actions .danger-action:focus {
  border-color: transparent;
  background: var(--accent-soft);
  color: #a33f29;
}

.parent-row {
  cursor: pointer;
}

.parent-row .file-type-icon {
  background: #edf1f3;
  color: #65737e;
}

.time-node > td {
  height: 38px !important;
  padding: 8px 16px !important;
  border-top: 1px solid var(--line) !important;
  background: #f1f4f5;
  color: #54616c;
  font-size: 12px;
  font-weight: 700;
}

.time-node .glyphicon {
  margin-right: 5px;
  color: var(--primary);
}

.empty-files {
  height: 280px !important;
  padding: 48px 16px !important;
  color: var(--muted);
  text-align: center;
}

.empty-files .empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 8px;
  background: #edf1f3;
  color: #7a8791;
  font-size: 23px;
}

.empty-files strong,
.empty-files small {
  display: block;
}

.empty-files strong {
  margin-bottom: 5px;
  color: #40505b;
  font-size: 15px;
}

.empty-files small {
  color: #8a959e;
  font-size: 12px;
}

.drop-overlay {
  position: absolute;
  inset: 64px 0 0;
  z-index: 20;
  display: none;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px dashed var(--primary);
  background: rgba(247, 251, 250, 0.96);
  color: var(--primary-dark);
  pointer-events: none;
}

.drop-overlay .glyphicon {
  font-size: 36px;
}

.drop-overlay strong {
  font-size: 16px;
}

.workspace-panel.is-dragging .drop-overlay {
  display: grid;
}

.dropdown-menu {
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 14px 35px rgba(23, 32, 39, 0.15);
}

.dropdown-menu > li > a {
  padding: 8px 10px;
  border-radius: 5px;
}

.dropdown-menu > li > a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.dropdown-menu .divider {
  margin: 5px 0;
}

.modal-backdrop {
  background: #1c272d;
}

.modal-backdrop.in {
  opacity: 0.45;
}

.modal-dialog {
  margin-top: 7vh;
}

.modal-content {
  overflow: hidden;
  border: 1px solid rgba(32, 44, 52, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
  border-color: var(--line);
  background: var(--surface-alt);
}

.modal-header {
  padding: 16px 20px;
}

.modal-title {
  color: #25313a;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
}

.modal .close {
  opacity: 0.5;
}

.modal .close:hover {
  opacity: 0.8;
}

.alert {
  border-radius: 6px;
}

.loading {
  border-radius: 8px;
}

.shownoticebox {
  top: 90px;
}

.shownoticebutton {
  border: 1px solid var(--line);
  border-radius: 6px 0 0 6px;
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.gobacktopbutton {
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  background: var(--surface);
  color: var(--primary);
}

.loadingremaininngbox {
  border-top: 1px solid #b9d8d1;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* Login */
.auth-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  background: #edf1f3;
}

.auth-page::before {
  position: fixed;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--primary);
  content: "";
}

.login-shell {
  width: min(460px, calc(100% - 32px));
  margin: auto;
  padding: 40px 0;
}

.auth-card {
  position: relative;
  overflow: hidden;
  padding: 34px 38px 28px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.auth-card::after {
  position: absolute;
  top: -4px;
  right: 0;
  width: 86px;
  height: 4px;
  background: var(--accent);
  content: "";
}

.login-brand {
  justify-content: flex-start;
  margin-bottom: 32px;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-card h1 {
  margin: 0 0 7px;
  color: #1f2b33;
  font-size: 24px;
  font-weight: 750;
}

.auth-card .auth-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-card .form-group {
  margin-right: 0;
  margin-bottom: 19px;
  margin-left: 0;
}

.auth-card .control-label {
  display: block;
  padding: 0 0 7px;
  color: #34414b;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.auth-card .form-control {
  height: 46px;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: #71808b;
}

.password-toggle:hover,
.password-toggle:focus {
  background: #f2f5f6;
  color: var(--primary);
  box-shadow: none;
}

.caps-lock-hint {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 12px;
}

.auth-card #alertbox.alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  font-size: 13px;
}

.auth-card .btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 2px;
}

.auth-back {
  display: block;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-back:hover {
  color: var(--primary);
  text-decoration: none;
}

.password-change-shell {
  width: min(500px, calc(100% - 32px));
}

.password-policy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: -8px 0 18px;
  color: #77838c;
  font-size: 12px;
}

.password-policy span {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.password-policy i {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #c7ced3;
}

.password-policy .passed {
  color: var(--primary-dark);
}

.password-policy .passed i {
  background: var(--primary);
}

.password-policy.compact {
  grid-template-columns: repeat(5, max-content);
  gap: 5px 10px;
  margin: 8px 0 0;
}

.verification-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.verification-row .vercodeimg {
  width: 120px;
  height: 46px;
  border-radius: 5px;
  object-fit: cover;
}

.form-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.login-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Admin */
.admin-page {
  background: #f2f4f5;
}

.admin-shell {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto 56px;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 76px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 244, 245, 0.96);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.admin-nav a {
  padding: 7px 11px;
  border-radius: 5px;
  color: #56636e;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a:focus {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 16px;
  scroll-margin-top: 92px;
}

.page-heading h1 {
  margin: 0;
  color: #202c34;
  font-size: 25px;
  font-weight: 750;
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 105px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card > div {
  min-width: 0;
}

.stat-card span:not(.stat-icon):not(.glyphicon) {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: #233039;
  font-size: 25px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  font-size: 16px;
}

.stat-icon.users { background: var(--primary-soft); color: var(--primary); }
.stat-icon.folders { background: var(--amber-soft); color: var(--amber); }
.stat-icon.files { background: var(--blue-soft); color: var(--blue); }
.stat-icon.storage { background: var(--accent-soft); color: var(--accent); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.section-panel {
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-panel.table-responsive {
  overflow-x: auto;
  padding: 0;
}

.section-panel.table-responsive .table {
  min-width: 1050px;
}

.section-panel h2 {
  margin: 0 0 16px;
  color: #2b3740;
  font-size: 16px;
  font-weight: 700;
}

.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 210px;
  margin: 0 0 24px;
  padding: 20px 3px 0;
  border-bottom: 1px solid var(--line);
}

.chart-bar {
  position: relative;
  flex: 1;
  min-width: 9px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
  transition: background-color 0.15s ease;
}

.chart-bar:hover {
  background: var(--accent);
}

.chart-bar small {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  color: #7f8a93;
  font-size: 10px;
  white-space: nowrap;
}

.type-row {
  display: grid;
  grid-template-columns: 72px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.type-track {
  overflow: hidden;
  height: 7px;
  border-radius: 4px;
  background: #edf0f2;
}

.type-fill {
  height: 100%;
  background: var(--accent);
}

.user-section {
  margin-top: 30px;
  scroll-margin-top: 92px;
}

.user-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.search-field {
  position: relative;
  width: min(380px, 100%);
}

.search-field > .glyphicon {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 2;
  color: #89949d;
}

.search-field .form-control {
  padding-left: 36px;
  background: var(--surface);
}

.empty-state {
  padding: 42px !important;
  color: var(--muted);
  text-align: center;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #9aa5ae;
  box-shadow: 0 0 0 3px #eef1f3;
}

.status-dot.enabled {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.role-badge {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 5px;
  background: #edf1f3;
  color: #56636e;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge.admin {
  background: var(--accent-soft);
  color: #9e402b;
}

.phone-link {
  color: #46545f;
  white-space: nowrap;
}

.admin-row-actions {
  white-space: nowrap;
}

.admin-row-actions .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  margin-right: 3px;
  border-color: transparent;
  background: transparent;
}

.permission-field > label {
  display: block;
  margin-bottom: 8px;
}

#authChecks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#authChecks .checkbox-inline {
  margin: 0;
  padding: 7px 10px 7px 29px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
}

#authChecks .checkbox-inline:hover {
  border-color: #a9c9c3;
  background: var(--primary-soft);
}

.toast-region {
  position: fixed;
  top: 90px;
  right: 22px;
  z-index: 2000;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 32px));
  pointer-events: none;
}

.app-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #bdd8d3;
  border-radius: 7px;
  background: #f5fbf9;
  color: var(--primary-dark);
  box-shadow: 0 12px 30px rgba(23, 32, 39, 0.14);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.error {
  border-color: #ecc9c0;
  background: #fff8f5;
  color: #9e402b;
}

.teaching-section {
  margin-top: 34px;
  scroll-margin-top: 92px;
}

.scope-summary {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 5px;
  background: #e9f3f0;
  color: #28685e;
  font-size: 12px;
  font-weight: 700;
}

.teaching-scope {
  padding: 0;
}

.scope-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.semester-field {
  width: min(380px, 100%);
  margin: 0;
}

.scope-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.scope-actions .btn-link {
  min-height: 34px;
  padding: 6px 9px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.scope-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 20px;
}

.scope-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.scope-grid legend {
  width: auto;
  margin: 0 0 10px;
  border: 0;
  color: #4b5963;
  font-size: 12px;
  font-weight: 700;
}

.grade-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  margin-bottom: 10px;
}

.grade-heading legend {
  margin: 0;
}

.grade-heading .btn-link {
  min-height: 26px;
  padding: 3px 5px;
  color: var(--primary-dark);
  font-size: 12px;
}

.choice-grid {
  display: grid;
  gap: 7px;
}

.subject-choices {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.scope-choice {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 37px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #d9dfe2;
  border-radius: 5px;
  background: #fafbfb;
  color: #47545e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.scope-choice:hover {
  border-color: #a9c9c3;
  background: #f4f9f7;
}

.scope-choice.selected {
  border-color: #8bb9b0;
  background: #eaf4f1;
  color: #255f56;
}

.scope-choice input {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 0 7px 0 0;
}

.scope-choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.custom-grade-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 7px;
  margin-top: 9px;
}

.custom-grade-row .icon-button {
  width: 34px;
  min-width: 34px;
  height: 30px;
  min-height: 30px;
}

.teaching-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.teaching-tool {
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.tool-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 18px;
}

.tool-heading h2 {
  margin: 1px 0 4px;
}

.tool-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 7px;
  background: var(--amber-soft);
  color: var(--amber);
}

.tool-icon.report {
  background: var(--blue-soft);
  color: var(--blue);
}

.compact-form {
  display: grid;
  gap: 10px;
}

.compact-form.three-columns {
  grid-template-columns: minmax(80px, 0.65fr) minmax(80px, 0.65fr) minmax(170px, 1.7fr);
}

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

.compact-form .form-group {
  min-width: 0;
  margin-bottom: 0;
}

.compact-form label,
.semester-field label {
  margin-bottom: 7px;
  color: #4b5963;
  font-size: 12px;
}

.week-preview,
.statistics-preview {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  margin: 14px 0;
  padding: 10px 12px;
  border-left: 3px solid #d4a640;
  background: #fbf8ef;
  color: #66572f;
  font-size: 12px;
  line-height: 1.5;
}

.week-preview span:last-child,
.statistics-preview span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.week-preview b {
  margin: 0 4px;
  color: #8b7b54;
  font-weight: 500;
}

.statistics-preview {
  border-left-color: #6f9fc1;
  background: #f1f6f9;
  color: #45677d;
}

.statistics-preview strong {
  color: #245a79;
  font-size: 22px;
}

.report-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
}

.email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.email-row .btn {
  min-width: 84px;
}

.teaching-tool > .btn-block {
  margin-top: auto;
}

@media (max-width: 1050px) {
  .workspace-search {
    grid-template-columns: 98px minmax(150px, 1fr) 36px;
  }

  .item-summary {
    display: none;
  }

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

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .scope-grid {
    grid-template-columns: 1fr;
  }

  .subject-choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-nav {
    display: none;
  }
}

@media (max-width: 767px) {
  .container,
  .admin-shell {
    width: min(100% - 20px, 1320px);
  }

  .file-app .container {
    padding-bottom: 24px;
  }

  .app-header {
    min-height: 62px;
    padding: 10px 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    font-size: 11px;
  }

  .subtitle {
    display: flex !important;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
    margin: 0 0 8px;
    padding: 5px 0;
    color: var(--muted);
    text-align: left;
    white-space: nowrap;
  }

  #tb2 {
    display: flex;
    align-items: center;
    gap: 3px;
  }

  .subtitle .btn-link {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .workspace-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  #filetable > .panel-heading {
    padding: 0;
  }

  #filetable .heading {
    display: block;
    min-height: 54px;
    padding: 6px 10px;
  }

  #filetable .navbar-header {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  #filetableheadera {
    width: 100%;
    max-width: none;
    min-height: 42px;
    font-size: 15px;
  }

  #currentFolderName {
    flex: 0 1 auto;
    max-width: calc(100% - 52px);
  }

  #mdropdownicon {
    display: none;
  }

  #filetable .navbar-collapse {
    margin: 0;
    padding: 8px 0 0;
    border-top: 1px solid var(--line);
    box-shadow: none;
  }

  #filetable .navbar-nav {
    margin: 0;
  }

  .mobile-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
    gap: 7px;
    padding: 10px 10px 0;
  }

  .mobile-toolbar .btn {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-search {
    display: flex !important;
    padding: 0 10px;
  }

  .mobile-search .form-control {
    min-width: 0;
  }

  .table > thead > tr > th,
  .table > tbody > tr > td {
    padding-right: 7px;
    padding-left: 7px;
  }

  #filetable .table > thead > tr > th:first-child,
  #filetable .table > tbody > tr > td:first-child {
    width: 65%;
    padding-left: 10px;
  }

  #filetable .table > thead > tr > th:nth-child(3) {
    width: 15%;
  }

  #filetable .table > thead > tr > th:nth-child(5) {
    width: 20%;
  }

  .table > tbody > tr > td {
    height: 56px;
  }

  .file-name-cell {
    min-width: 0;
  }

  .file-type-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    margin-right: 7px;
  }

  .file-actions {
    min-width: 0;
    white-space: normal;
  }

  .file-actions .icon-action {
    width: 29px;
    min-width: 29px;
    height: 29px;
    min-height: 29px;
    margin: 1px 0;
  }

  .file-actions .icon-action:not(:first-child):not(.context-trigger) {
    display: none;
  }

  .empty-files {
    height: 240px !important;
  }

  .modal-dialog {
    margin: 16px 10px;
  }

  .modal-body {
    padding: 17px;
  }

  .admin-header {
    height: 66px;
    margin-bottom: 20px;
  }

  .admin-header > .btn {
    width: 36px;
    min-width: 36px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .admin-header > .btn .glyphicon {
    font-size: 13px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .scope-summary {
    align-self: flex-start;
  }

  .heading-actions {
    align-self: stretch;
    justify-content: space-between;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .stat-card {
    min-height: 94px;
    gap: 10px;
    padding: 13px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .stat-card strong {
    font-size: 20px;
  }

  .section-panel {
    padding: 16px;
  }

  .section-panel.table-responsive {
    padding: 0;
  }

  .scope-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .scope-actions {
    align-self: flex-end;
  }

  .scope-grid {
    gap: 18px;
    padding: 16px;
  }

  .subject-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .teaching-tools {
    grid-template-columns: 1fr;
  }

  .teaching-tool {
    min-height: 0;
  }

  .user-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .activity-chart {
    gap: 4px;
  }

  .chart-bar small {
    transform: translateX(-50%) rotate(-45deg);
    transform-origin: center;
  }

  .toast-region {
    top: 74px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .auth-page::before {
    width: 5px;
  }

  .login-shell {
    width: calc(100% - 24px);
    padding: 18px 0;
  }

  .auth-card {
    padding: 28px 22px 23px;
  }

  .login-brand {
    margin-bottom: 26px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 82px;
  }

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

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

  .compact-form.three-columns .form-group:last-child {
    grid-column: 1 / -1;
  }

  .report-actions {
    grid-template-columns: 1fr;
  }

  .email-row {
    grid-template-columns: 1fr;
  }

  .email-row .btn {
    width: 100%;
  }
}
