:root {
  --masy-green-950: #063d31;
  --masy-green-800: #0b5a46;
  --masy-green-700: #0f6b52;
  --masy-green-100: #e9f6f1;
  --masy-gold: #c59a3d;
  --masy-gold-soft: #f5ead0;
  --masy-ink: #19312b;
  --masy-muted: #667771;
  --masy-line: #dce7e3;
  --masy-bg: #f7faf9;
  --masy-white: #ffffff;
  --masy-danger: #b42318;
  --masy-shadow: 0 18px 45px rgba(6, 61, 49, .10);
  --masy-radius: 18px;
}

.masy-repository,
.masy-dashboard,
.masy-monitoring,
.masy-panel {
  color: var(--masy-ink);
  font-family: inherit;
}

.masy-hero,
.masy-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 15%, rgba(197,154,61,.28), transparent 25%),
    linear-gradient(135deg, var(--masy-green-950), var(--masy-green-700));
  box-shadow: var(--masy-shadow);
  margin-bottom: 24px;
}

.masy-hero h2,
.masy-dashboard-header h2,
.masy-panel-heading h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.15;
}

.masy-hero p,
.masy-dashboard-header p,
.masy-panel-heading p { margin: 0; opacity: .88; }
.masy-kicker { display: inline-block; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; font-size: .74rem; color: var(--masy-gold); }
.masy-hero-stat { min-width: 142px; text-align: center; padding: 18px 22px; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(255,255,255,.10); backdrop-filter: blur(8px); }
.masy-hero-stat strong { display: block; font-size: 2.25rem; line-height: 1; }
.masy-hero-stat span { display: block; margin-top: 7px; font-size: .82rem; opacity: .85; }

.masy-filter {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) repeat(5, minmax(125px, 1fr)) auto;
  gap: 10px;
  padding: 15px;
  background: var(--masy-white);
  border: 1px solid var(--masy-line);
  border-radius: var(--masy-radius);
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(6, 61, 49, .06);
}

.masy-filter input,
.masy-filter select,
.masy-form input,
.masy-form select,
.masy-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cddbd6;
  border-radius: 11px;
  background: #fff;
  color: var(--masy-ink);
  padding: 10px 12px;
  font: inherit;
  box-sizing: border-box;
}

.masy-form textarea { min-height: 110px; resize: vertical; }
.masy-filter input:focus,
.masy-filter select:focus,
.masy-form input:focus,
.masy-form select:focus,
.masy-form textarea:focus { outline: 3px solid rgba(15,107,82,.13); border-color: var(--masy-green-700); }

.masy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  background: var(--masy-green-800);
  color: #fff !important;
  font-weight: 750;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.masy-button:hover { background: var(--masy-green-950); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(6,61,49,.18); }
.masy-button-primary { background: linear-gradient(135deg, var(--masy-green-700), var(--masy-green-950)); }
.masy-button-small { min-height: 36px; padding: 8px 13px; font-size: .86rem; }
.masy-button.is-disabled { opacity: .48; pointer-events: none; }

.masy-filter-summary { padding: 11px 14px; margin-bottom: 17px; border-radius: 11px; background: var(--masy-green-100); color: var(--masy-green-950); font-size: .92rem; }
.masy-filter-summary a { font-weight: 800; margin-left: 5px; }

.masy-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.masy-card { display: flex; flex-direction: column; min-height: 310px; background: #fff; border: 1px solid var(--masy-line); border-radius: var(--masy-radius); overflow: hidden; box-shadow: 0 8px 25px rgba(6,61,49,.055); transition: transform .18s ease, box-shadow .18s ease; }
.masy-card:hover { transform: translateY(-3px); box-shadow: var(--masy-shadow); }
.masy-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px 0; }
.masy-file-badge { min-width: 48px; text-align: center; border-radius: 9px; padding: 7px 8px; font-size: .75rem; font-weight: 900; letter-spacing: .04em; background: var(--masy-gold-soft); color: #76561c; }
.masy-type-badge { font-size: .74rem; font-weight: 800; color: var(--masy-green-800); background: var(--masy-green-100); border-radius: 999px; padding: 7px 10px; }
.masy-card-body { flex: 1; padding: 16px 18px; }
.masy-card h3 { margin: 0 0 13px; font-size: 1.08rem; line-height: 1.42; }
.masy-card h3 a { color: var(--masy-ink); text-decoration: none; }
.masy-card h3 a:hover { color: var(--masy-green-700); }
.masy-card-teacher { display: flex; align-items: center; gap: 7px; color: var(--masy-muted); font-size: .88rem; margin: 0 0 14px; }
.masy-card-teacher .dashicons { font-size: 17px; width: 17px; height: 17px; }
.masy-meta-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.masy-meta-chips span { padding: 5px 8px; border: 1px solid var(--masy-line); border-radius: 8px; color: #51635d; font-size: .76rem; background: #fbfdfc; }
.masy-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--masy-line); background: #fbfdfc; }
.masy-download-count { display: flex; align-items: center; gap: 5px; font-size: .84rem; color: var(--masy-muted); }
.masy-download-count .dashicons { font-size: 17px; width: 17px; height: 17px; }

.masy-pagination { margin-top: 28px; }
.masy-pagination ul { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.masy-pagination a, .masy-pagination span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--masy-line); background: #fff; text-decoration: none; }
.masy-pagination .current { background: var(--masy-green-800); color: #fff; border-color: var(--masy-green-800); }

.masy-empty-state { text-align: center; padding: 60px 20px; border: 1px dashed #b9cdc5; border-radius: var(--masy-radius); background: var(--masy-bg); }
.masy-empty-state .dashicons { font-size: 44px; width: 44px; height: 44px; color: var(--masy-green-700); }
.masy-empty-state h3 { margin: 10px 0 6px; }
.masy-empty-state p { margin: 0; color: var(--masy-muted); }

.masy-panel { padding: 28px; background: #fff; border: 1px solid var(--masy-line); border-radius: 22px; box-shadow: var(--masy-shadow); }
.masy-panel-heading { margin-bottom: 22px; }
.masy-panel-heading p { color: var(--masy-muted); opacity: 1; }
.masy-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px 16px; }
.masy-field { margin: 0 0 13px; }
.masy-field-full { grid-column: 1 / -1; }
.masy-field label { display: block; margin-bottom: 7px; font-weight: 750; }
.masy-field label span { color: #c21f16; }
.masy-field small { display: block; color: var(--masy-muted); margin-top: 7px; }

.masy-notice { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 16px; border-radius: 12px; margin: 0 0 18px; border: 1px solid transparent; }
.masy-notice-success { color: #095c3f; background: #e8f8f0; border-color: #bde5d2; }
.masy-notice-error { color: #8b1e16; background: #fff0ef; border-color: #f4c8c4; }
.masy-notice-warning { color: #775718; background: #fff8e6; border-color: #ead9a9; }
.masy-notice-info { color: #174e72; background: #edf7ff; border-color: #c4e3f7; }

.masy-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 0 0 24px; }
.masy-stat-card { padding: 20px; border: 1px solid var(--masy-line); border-radius: 16px; background: #fff; box-shadow: 0 6px 20px rgba(6,61,49,.045); }
.masy-stat-card strong { display: block; font-size: 2rem; line-height: 1; color: var(--masy-green-800); }
.masy-stat-card span { display: block; margin-top: 8px; color: var(--masy-muted); font-size: .9rem; }
.masy-stat-grid-public .masy-stat-card { text-align: center; }

.masy-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--masy-line); border-radius: 16px; background: #fff; }
.masy-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.masy-table th, .masy-table td { padding: 14px 15px; border-bottom: 1px solid var(--masy-line); text-align: left; vertical-align: middle; }
.masy-table th { background: var(--masy-green-950); color: #fff; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.masy-table tr:last-child td { border-bottom: 0; }
.masy-table td small { display: block; color: var(--masy-muted); margin-top: 4px; }
.masy-actions { white-space: nowrap; }
.masy-actions a { display: inline-block; margin-right: 9px; font-weight: 700; font-size: .85rem; }
.masy-delete-link { color: var(--masy-danger) !important; }
.masy-status { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: .76rem; font-weight: 800; }
.masy-status-publish { background: #e8f8f0; color: #087147; }
.masy-status-pending { background: #fff4d9; color: #805d13; }
.masy-status-draft { background: #eef1f0; color: #5c6965; }
.masy-check-cell { text-align: center !important; }
.masy-check { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 900; }
.masy-check.is-complete { color: #fff; background: var(--masy-green-700); }
.masy-check.is-empty { color: #8d9995; background: #eef2f0; }

@media (max-width: 1180px) {
  .masy-filter { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .masy-filter-search { grid-column: span 2; }
  .masy-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .masy-hero, .masy-dashboard-header { align-items: flex-start; flex-direction: column; padding: 25px; }
  .masy-hero-stat { min-width: 0; width: 100%; box-sizing: border-box; }
  .masy-filter { grid-template-columns: 1fr; }
  .masy-filter-search { grid-column: auto; }
  .masy-card-grid { grid-template-columns: 1fr; }
  .masy-form-grid, .masy-stat-grid { grid-template-columns: 1fr; }
  .masy-field-full { grid-column: auto; }
  .masy-panel { padding: 20px; }
  .masy-notice { align-items: flex-start; flex-direction: column; }
}

.masy-single-details { margin-top: 28px; padding: 24px; border: 1px solid var(--masy-line); border-radius: var(--masy-radius); background: var(--masy-bg); }
.masy-single-details h3 { margin: 0 0 18px; }
.masy-single-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.masy-single-grid > div { padding: 13px; border: 1px solid var(--masy-line); border-radius: 11px; background: #fff; }
.masy-single-grid span { display: block; margin-bottom: 5px; color: var(--masy-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.masy-single-grid strong { display: block; font-size: .94rem; }
@media (max-width: 760px) { .masy-single-grid { grid-template-columns: 1fr; } }
