
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #edf1f6;
  color: #24344d;
}

button,
input {
  font-family: inherit;
}

/* PAGE SHELL */

.page-shell {
  width: min(1500px, 96%);
  min-height: 92vh;
  margin: 4vh auto;
  background: #fff;
  border: 1px solid #dce3ec;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(20,40,70,.08);
}

/* HEADER */

.topbar {
  min-height: 130px;
  padding: 22px 36px;
  background: #f5f6f8;
  border-bottom: 6px solid #a9d2ad;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.heading {
  flex: 1;
}

.heading h1 {
  margin: 0;
  color: #2f8a4f;
  font-size: clamp(25px,3vw,39px);
  font-weight: 800;
}

.heading p {
  margin: 8px 0 0;
  color: #4d6656;
  font-size: 17px;
  font-weight: 600;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: auto;
  padding: 12px 21px;
  background: #173b68;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.home-button:hover {
  background: #24558c;
}

/* LOGIN PAGE */

.main-content {
  display: grid;
  grid-template-columns: 370px 1fr;
  min-height: 680px;
}

.sidebar {
  padding: 42px 30px;
  background: #0c2857;
  color: white;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 38px;
}

.sidebar-logo img {
  width: min(230px,100%);
  height: auto;
}

.sidebar h2 {
  margin: 0 0 12px;
  font-size: 25px;
  color: white;
}

.sidebar p {
  color: #e1eaf7;
  line-height: 1.7;
  font-size: 15px;
}

.feature-card {
  margin-top: 25px;
  padding: 22px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 17px;
}

.feature-card h3 {
  margin: 0 0 12px;
  font-size: 19px;
}

.feature-card p {
  margin: 0;
}

.login-area {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 45px;
  background: #edf1f6;
}

.login-card {
  width: min(650px,100%);
  padding: 42px;
  background: white;
  border: 1px solid #dce3ec;
  border-radius: 25px;
  box-shadow: 0 10px 30px rgba(20,40,70,.06);
}

.login-card h2 {
  margin: 0 0 12px;
  color: #203653;
  font-size: 31px;
}

.login-intro {
  margin: 0 0 30px;
  color: #65758b;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 9px;
  color: #263a55;
  font-weight: 700;
}

.form-group input {
  width: 100%;
  padding: 16px;
  border: 1px solid #c8d3e2;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 16px;
  outline: none;
}

.form-group input:focus {
  border-color: #26804e;
  box-shadow: 0 0 0 3px rgba(38,128,78,.12);
  background: white;
}

.login-button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: #237647;
  color: white;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.login-button:hover {
  background: #195c36;
}

.login-error {
  margin-top: 10px;
  color: #b42318;
  font-size: 14px;
  font-weight: 600;
}

.security-note {
  margin-top: 25px;
  padding: 15px;
  background: #f0f7f2;
  border-left: 4px solid #32945b;
  border-radius: 8px;
  color: #42634d;
  font-size: 13px;
  line-height: 1.6;
}

/* FOOTER */

.footer {
  padding: 18px;
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid #e1e7ef;
  color: #718096;
  font-size: 13px;
}

/* DASHBOARD */

.dashboard-view {
  padding: 30px;
  background: #edf1f6;
  min-height: 750px;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}

.dashboard-topbar h2 {
  margin: 0;
  color: #203653;
  font-size: 25px;
}

.dashboard-topbar p {
  margin: 6px 0 0;
  color: #65758b;
  font-size: 14px;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
}

.dashboard-actions button,
.primary-button {
  padding: 11px 18px;
  border: none;
  border-radius: 8px;
  background: #173b68;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-actions button:hover,
.primary-button:hover {
  background: #24558c;
}

.prototype-notice {
  padding: 14px 17px;
  margin-bottom: 22px;
  border-radius: 9px;
  background: #fff8e8;
  border-left: 4px solid #d69b27;
  color: #76551b;
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-welcome,
.dashboard-panel {
  background: white;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid #dce3ec;
  margin-bottom: 20px;
}

.dashboard-welcome h2 {
  margin: 0 0 8px;
  color: #203653;
}

.dashboard-welcome p,
.panel-description {
  color: #65758b;
  line-height: 1.6;
}

.panel-description {
  font-size: 14px;
  margin: 0 0 20px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 17px;
  margin-bottom: 25px;
}

.dashboard-stat {
  background: white;
  padding: 22px;
  border-radius: 13px;
  border: 1px solid #dce3ec;
  border-left: 5px solid #32945b;
}

.dashboard-stat strong {
  display: block;
  color: #237647;
  font-size: 30px;
  margin-bottom: 7px;
}

.dashboard-stat span {
  color: #65758b;
  font-size: 14px;
}

/* DASHBOARD NAVIGATION */

.dashboard-grid {
  display: grid;
  grid-template-columns: 245px minmax(0,1fr);
  gap: 20px;
}

.dashboard-nav {
  background: #0c2857;
  border-radius: 14px;
  padding: 20px 13px;
  height: fit-content;
}

.dashboard-nav h3 {
  color: white;
  font-size: 17px;
  padding: 0 12px;
  margin: 0 0 17px;
}

.dashboard-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 12px;
  margin-bottom: 7px;
  border: none;
  border-radius: 8px;
  color: #e1eaf7;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
}

.dashboard-nav button:hover,
.dashboard-nav button.active {
  background: #244574;
  color: white;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-panel h3 {
  margin: 0 0 15px;
  color: #203653;
  font-size: 20px;
}

.section-heading {
  margin-top: 25px !important;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
}

.workspace-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  height: 100%;
  padding: 18px;
  border: 1px solid #dce3ec;
  border-radius: 11px;
  background: #f9fbfd;
}

.workspace-card h4 {
  margin: 0 0 8px;
  color: #203653;
  font-size: 15px;
}

.workspace-card p {
  flex: 1 1 auto;
  color: #718096;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
}

.workspace-card button {
  margin-top: auto;
  width: 100%;
  padding: 10px;
  background: #237647;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.workspace-card button:hover {
  background: #195c36;
}

.fpmu-workspace {
  border-left: 5px solid #173b68;
  background: #f0f4fa;
}

.fpmu-workspace button {
  background: #173b68;
}

.fpmu-workspace button:hover {
  background: #24558c;
}

.overview-workspace-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.overview-workspace-grid .workspace-card {
  border-left: 5px solid #173b68;
  background: #f0f4fa;
}

.overview-workspace-grid .workspace-card button,
.overview-workspace-grid .workspace-card button:hover {
  background: #173b68;
}

.folder-structure-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.folder-structure-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #fff;
}

.folder-structure-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-empty {
  padding: 25px;
  text-align: center;
  color: #718096;
  background: #f8fafc;
  border: 1px dashed #c8d3e2;
  border-radius: 10px;
  white-space: pre-line;
}

/* DOCUMENT WORKSPACE */

.document-workspace {
  background: white;
  padding: 24px;
  border: 1px solid #dce3ec;
  border-radius: 14px;
}

.workspace-back-button {
  padding: 10px 16px;
  border: 1px solid #c8d3e2;
  border-radius: 8px;
  background: white;
  color: #173b68;
  font-weight: 700;
  cursor: pointer;
}

.workspace-back-button:hover {
  background: #f0f4fa;
}

.workspace-title {
  margin-top: 22px !important;
}

.workspace-breadcrumb {
  color: #65758b;
  font-size: 13px;
  margin: 10px 0 20px;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 13px;
  margin: 20px 0;
}

.folder-card {
  padding: 17px;
  background: #f7fafc;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: #203653;
}

.folder-card:hover,
.folder-card.selected {
  border-color: #32945b;
  background: #eff8f1;
}

.folder-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 7px;
}

.folder-card span {
  color: #718096;
  font-size: 12px;
}

.folder-delete-btn {
  display: block;
  margin-top: 8px;
  padding: 6px 10px;
  background: #fca5a5;
  border: 1px solid #f87171;
  border-radius: 4px;
  color: #7f1d1d;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
  width: 100%;
}

.folder-delete-btn:hover {
  background: #f87171;
  border-color: #dc2626;
  color: #fff;
}

/* Hierarchical Folder Navigation - Breadcrumb Buttons */
.folder-breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}

.breadcrumb-button {
  padding: 8px 12px;
  background: #f0f4f8;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #237647;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.breadcrumb-button:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.breadcrumb-sep {
  color: #94a3b8;
  font-size: 12px;
  opacity: 0.7;
}

.create-folder-card {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #16a34a;
}

.create-folder-card:hover {
  background: #dcfce7;
  border-color: #16a34a;
}

.secondary-button {
  padding: 10px 16px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.secondary-button:hover {
  background: #cbd5e1;
  border-color: #94a3b8;
}

.section-divider {
  border: 0;
  border-top: 1px solid #e4eaf1;
  margin: 25px 0;
}

.document-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.document-toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
  padding: 12px;
  border: 1px solid #c8d3e2;
  border-radius: 8px;
  font-size: 14px;
}

.upload-label {
  display: inline-block;
  padding: 12px 18px;
  background: #237647;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.upload-label:hover {
  background: #195c36;
}

.document-table-wrap {
  overflow-x: auto;
}

.document-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.document-table th,
.document-table td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid #e4eaf1;
}

.document-table th {
  background: #f4f7fa;
  color: #40536b;
}

.document-table td {
  color: #53657b;
}

.document-action {
  padding: 7px 11px;
  margin: 2px;
  border: none;
  border-radius: 6px;
  background: #173b68;
  color: white;
  cursor: pointer;
  font-size: 12px;
}

.document-action:hover {
  background: #24558c;
}

.version-history {
  margin-top: 18px;
  padding: 15px;
  background: #f4f7fa;
  border-radius: 9px;
  color: #53657b;
  font-size: 13px;
  line-height: 1.6;
}

.version-history p {
  margin: 10px 0;
}

/* RESPONSIVE DESIGN */

@media(max-width:1050px) {
  .dashboard-stats {
    grid-template-columns: repeat(2,1fr);
  }

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

@media(max-width:850px) {
  .main-content {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    padding: 30px;
  }

  .login-area {
    padding: 25px;
  }
}

@media(max-width:600px) {
  .page-shell {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 20px;
  }

  .dashboard-view {
    padding: 15px;
  }

  .dashboard-stats,
  .workspace-grid,
  .folder-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 27px 22px;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-actions {
    width: 100%;
  }

  .dashboard-actions button {
    flex: 1;
  }

  .document-workspace {
    padding: 15px;
  }
}

/* Role-based local demonstration additions */
select, .user-form input {
  width: 100%; padding: 14px; border: 1px solid #c8d3e2;
  border-radius: 10px; background: #f8fafc; font: inherit; color: #24344d;
}
select:focus, .user-form input:focus {
  outline: none; border-color: #26804e;
  box-shadow: 0 0 0 3px rgba(38,128,78,.12);
}
.login-notice { margin: 0 0 22px; }
.danger-action { background: #a52828; }
.danger-action:hover { background: #7e1e1e; }
.folder-management {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 14px 0 22px; padding: 15px; border: 1px solid #dce3ec;
  border-radius: 10px; background: #f8fafc;
}
.folder-management label { font-weight: 700; color: #40536b; }
.folder-management input {
  flex: 1; min-width: 190px; padding: 11px;
  border: 1px solid #c8d3e2; border-radius: 8px; font: inherit;
}
.user-form {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px; align-items: end; margin: 18px 0 22px; padding: 18px;
  background: #f8fafc; border: 1px solid #dce3ec; border-radius: 10px;
}
.user-form .form-group { margin: 0; }
.user-list { overflow-x: auto; margin-top: 18px; }
@media(max-width:600px) {
  .user-form { grid-template-columns: 1fr; }
  .folder-management { align-items: stretch; flex-direction: column; }
}
