*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
  width:100%;
  min-height:100%;
}

body{
  font-family:Arial, Helvetica, sans-serif;
  background:#f4f6f8;
  color:#20252b;
}

button,
input,
select,
textarea{
  font:inherit;
}

/* APP */

.app-shell{
  display:grid;
  grid-template-columns:240px minmax(0, 1fr);
  min-height:100vh;
}

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

/* HEADER */

.app-header{
  height:64px;
  display:flex;
  align-items:center;
  gap:20px;
  padding:0 24px;
  background:#ffffff;
  border-bottom:1px solid #e3e7eb;
}

.app-header-title{
  flex:1;
  font-size:20px;
  font-weight:600;
}

.app-header-user{
  font-size:14px;
}

.sidebar-toggle{
  display:block;
  border:0;
  background:none;
  cursor:pointer;
  font-size:24px;
}

/* SIDEBAR */

.app-sidebar{
  position:sticky;
  top:0;
  height:100vh;
  background:#20252b;
  color:#ffffff;
}

.sidebar-brand{
  height:64px;
  display:flex;
  align-items:center;
  padding:0 24px;
  font-size:22px;
  font-weight:600;
  border-bottom:1px solid rgba(255,255,255,.1);
}

.sidebar-nav{
  display:flex;
  flex-direction:column;
  padding:16px 12px;
}

.sidebar-link{
  display:block;
  padding:12px 14px;
  color:#dfe5eb;
  text-decoration:none;
  border-radius:6px;
}

.sidebar-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  color:#dfe5eb;
  text-decoration:none;
  border-radius:6px;
}

.sidebar-link:hover{
  background:rgba(255,255,255,.08);
  color:#ffffff;
}

.sidebar-link--project-module{
  background:#2b3138;
}

.sidebar-link--project-module:hover{
  background:#343b43;
}

.sidebar-link--project-module.active{
  background:#3a424b;
}

.sidebar-link.active,
.sidebar-group.active > .sidebar-group-toggle{
  background:rgba(255,255,255,.08);
  color:#ffffff;
}

.sidebar-sublink{
  display:block;
  padding:9px 14px;
  color:#b9c3cc;
  text-decoration:none;
  border-radius:6px;
}

.sidebar-sublink:hover{
  color:#ffffff;
}

.sidebar-sublink.active{
  color:#ffffff;
  font-weight:600;
}

.app-shell.sidebar-collapsed .sidebar-submenu{
  display:none;
}

.app-shell.sidebar-collapsed .sidebar-group-arrow{
  display:none;
}

/* CONTENT */

.app-content{
  padding:24px;
}

.app-content h1{
  margin:0 0 16px;
  font-size:28px;
  font-weight:600;
}

.dashboard{
  width:100%;
  max-width:1400px;
  margin:0 auto;
}

.dashboard-header{
  margin-bottom:24px;
}

.dashboard-header h1{
  margin:0 0 6px;
  font-size:28px;
}

.dashboard-header p{
  margin:0;
  color:#69727c;
}

/* OVERLAY */

.sidebar-overlay{
  display:none;
}

/* TABLET / MOBILE */

@media(max-width:768px){

  .app-shell{
    display:block;
  }

  .app-sidebar{
    position:fixed;
    top:0;
    left:0;
    width:260px;
    height:100vh;
    z-index:1000;
    transform:translateX(-100%);
    transition:transform .2s ease;
  }

  .app-sidebar.open{
    transform:translateX(0);
  }

  .sidebar-overlay{
    position:fixed;
    inset:0;
    z-index:900;
    background:rgba(0,0,0,.4);
  }

  .sidebar-overlay.open{
    display:block;
  }

  .app-content{
    padding:18px;
  }
  
  .app-shell.sidebar-collapsed{
    display:block;
  }

  .sidebar-brand-full{
    display:inline;
  }

  .sidebar-brand-short{
    display:none;
  }

  .app-shell.sidebar-collapsed .sidebar-label{
    display:inline;
  }

}

.sidebar-group{
  width:100%;
}

.sidebar-group-toggle{
  width:100%;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  text-align:left;
  cursor:pointer;
}

.sidebar-group-arrow{
  margin-left:auto;
  transition:transform .2s ease;
}

.sidebar-group.open .sidebar-group-arrow{
  transform:rotate(90deg);
}

.sidebar-submenu{
  display:none;
  flex-direction:column;
  padding-left:14px;
}

.sidebar-group.open .sidebar-submenu{
  display:flex;
}

.sidebar-sublink{
  display:block;
  padding:10px 14px;
  color:#bfc7cf;
  text-decoration:none;
  border-radius:6px;
  font-size:14px;
}

.sidebar-sublink:hover{
  background:rgba(255,255,255,.08);
  color:#ffffff;
}

/* SMARTPHONE */

@media(max-width:480px){

  .app-header{
    height:56px;
    padding:0 14px;
    gap:12px;
  }

  .app-header-title{
    font-size:18px;
  }

  .app-content{
    padding:14px;
  }

  .dashboard-header h1{
    font-size:24px;
  }

}


.app-shell{
  transition:grid-template-columns .2s ease;
}

.app-shell.sidebar-collapsed{
  grid-template-columns:64px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar-brand-full,
.app-shell.sidebar-collapsed .sidebar-label{
  display:none;
}

.sidebar-brand-short{
  display:none;
}

.app-shell.sidebar-collapsed .sidebar-brand-short{
  display:inline;
}

.app-shell.sidebar-collapsed .sidebar-brand{
  justify-content:center;
  padding:0;
}

.app-shell.sidebar-collapsed .sidebar-link{
  text-align:center;
  padding-left:4px;
  padding-right:4px;
}

/* LOGIN */

.login-page{
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  padding:24px;
  background:#f4f6f8;
}

.login-box{
  width:100%;
  max-width:400px;
  padding:40px;
  background:#fff;
  border:1px solid #e3e7eb;
  border-radius:10px;
  box-shadow:0 8px 30px rgba(0,0,0,.08);
}

.login-box h1{
  margin:0 0 32px;
  text-align:center;
  font-size:28px;
  font-weight:600;
  color:#1f2933;
}

.login-box .form-group{
  margin-bottom:20px;
}

.login-box label{
  display:block;
  margin-bottom:7px;
  font-size:14px;
  font-weight:500;
  color:#4b5563;
}

.login-box input{
  width:100%;
  height:44px;
  padding:0 12px;
  box-sizing:border-box;
  border:1px solid #d6dce2;
  border-radius:6px;
  background:#fff;
  color:#1f2933;
  font-size:15px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}

.login-box input:focus{
  border-color:#00498a;
  box-shadow:0 0 0 3px rgba(0,73,138,.10);
}

.login-box button{
  width:100%;
  height:44px;
  margin-top:8px;
  border:0;
  border-radius:6px;
  background:#00498a;
  color:#fff;
  font-size:15px;
  font-weight:500;
  cursor:pointer;
  transition:background .15s ease;
}

.login-box button:hover{
  background:#003d74;
}

.login-box button:active{
  transform:translateY(1px);
}

.login-error{
  margin:0 0 16px;
  padding:10px 12px;
  border:1px solid #e4b4b4;
  border-radius:6px;
  background:#fff4f4;
  color:#a12626;
  font-size:14px;
}

.login-error[hidden]{
  display:none;
}

@media(max-width:480px){

  .login-page{
    padding:16px;
  }

  .login-box{
    padding:30px 22px;
  }

}

/* USER MENU */

.app-header-user{
  position:relative;
}

.user-menu-toggle{
  display:flex;
  align-items:center;
  gap:7px;
  padding:7px 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:inherit;
  font:inherit;
  cursor:pointer;
}

.user-menu-toggle:hover{
  background:rgba(0,0,0,.05);
}

.user-menu-arrow{
  font-size:11px;
  opacity:.65;
}

.user-menu{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  z-index:1000;
  min-width:160px;
  padding:6px;
  background:#fff;
  border:1px solid #e3e7eb;
  border-radius:7px;
  box-shadow:0 8px 24px rgba(0,0,0,.10);
}

.user-menu[hidden]{
  display:none;
}

.user-menu-item{
  width:100%;
  padding:9px 11px;
  border:0;
  border-radius:5px;
  background:transparent;
  color:#1f2933;
  font-size:14px;
  text-align:left;
  cursor:pointer;
}

.user-menu-item:hover{
  background:#f4f6f8;
}

/* ERROR PAGE */

.error-page{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
  box-sizing:border-box;
}

.error-box{
  width:100%;
  max-width:520px;
  text-align:center;
}

.error-code{
  margin-bottom:8px;
  font-size:42px;
  font-weight:600;
  color:#6b7280;
}

.error-code:empty{
  display:none;
}

.error-box h1{
  margin:0 0 12px;
  font-size:24px;
  color:#1f2933;
}

.error-box p{
  margin:0;
  color:#6b7280;
  line-height:1.5;
}

.error-box button{
  margin-top:24px;
  padding:10px 18px;
  border:0;
  border-radius:6px;
  background:#00498a;
  color:#fff;
  font:inherit;
  cursor:pointer;
}

.error-box button:hover{
  background:#003d74;
}

.app-header-project{
  position:relative;
  margin-left:20px;
  font-size:14px;
}

@media (max-width:600px){

  .app-header-project{
    margin-left:8px;
  }

}

/* =========================================================
   PROJECT SELECT
   ========================================================= */

.project-select-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:#f4f6f8;
}

.project-select-card{
  width:100%;
  max-width:460px;
  padding:32px;
  background:#ffffff;
  border-radius:10px;
  box-shadow:0 4px 18px rgba(0,0,0,.08);
}

.project-select-card h1{
  margin:0 0 8px;
  font-size:28px;
  font-weight:600;
  color:#1f2933;
}

.project-select-card p{
  margin:0 0 24px;
  color:#6b7280;
  font-size:15px;
}

.project-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.project-select-item{
  width:100%;
  padding:14px 16px;
  border:1px solid #dfe3e8;
  border-radius:7px;
  background:#ffffff;
  color:#263238;
  font:inherit;
  font-size:15px;
  text-align:left;
  cursor:pointer;
  transition:
    background .15s ease,
    border-color .15s ease,
    transform .15s ease;
}

.project-select-item:hover{
  background:#f7f9fa;
  border-color:#b8c1c9;
}

.project-select-item:active{
  transform:translateY(1px);
}

.project-select-item:focus-visible{
  outline:2px solid #64748b;
  outline-offset:2px;
}

@media (max-width:600px){

  .project-select-page{
    padding:16px;
  }

  .project-select-card{
    padding:24px 20px;
    border-radius:8px;
  }

  .project-select-card h1{
    font-size:24px;
  }

  .project-select-item{
    padding:13px 14px;
  }

}


/* =========================================================
   PROJECTS VIEW
   ========================================================= */

.projects-view{
  width:100%;
  max-width:900px;
  margin:0 auto;
}

.projects-view-header{
  margin-bottom:24px;
}

.projects-view-header h1{
  margin:0 0 6px;
  font-size:26px;
  font-weight:600;
  color:#1f2933;
}

.projects-view-header p{
  margin:0;
  font-size:15px;
  color:#6b7280;
}

.projects-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.projects-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  min-height:64px;
  padding:14px 18px;
  background:#ffffff;
  border:1px solid #e1e5e9;
  border-radius:8px;
  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}

.projects-item:hover{
  border-color:#c5ccd3;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
}

.projects-item.active{
  background:#f7f9fa;
}

.projects-item-name{
  min-width:0;
  font-size:15px;
  font-weight:500;
  color:#263238;
}

.projects-item-action{
  flex:0 0 auto;
  min-width:80px;
  padding:8px 14px;
  border:1px solid #cfd6dc;
  border-radius:6px;
  background:#ffffff;
  color:#263238;
  font:inherit;
  font-size:14px;
  cursor:pointer;
  transition:
    background .15s ease,
    border-color .15s ease;
}

.projects-item-action:hover:not(:disabled){
  background:#f4f6f8;
  border-color:#aeb8c1;
}

.projects-item-action:focus-visible{
  outline:2px solid #64748b;
  outline-offset:2px;
}

.projects-item-action:disabled{
  border-color:transparent;
  background:transparent;
  color:#6b7280;
  cursor:default;
}

@media (max-width:600px){

  .projects-view{
    max-width:none;
  }

  .projects-view-header{
    margin-bottom:18px;
  }

  .projects-view-header h1{
    font-size:22px;
  }

  .projects-item{
    min-height:60px;
    padding:12px 14px;
    gap:12px;
  }

  .projects-item-action{
    min-width:72px;
    padding:7px 11px;
  }

}

/* =========================
   Diagnostics
   ========================= */

.diagnostics-view{
  width:100%;
  max-width:1400px;
}

.diagnostics-header{
  margin-bottom:24px;
}

.diagnostics-header h1{
  margin:0 0 6px;
  font-size:28px;
}

.diagnostics-header p{
  margin:0;
  opacity:.65;
}


/* Layout */

.diagnostics-grid{
  display:grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap:18px;
}


/* Containers */

.diagnostics-card{
  min-width:0;

  padding:22px 24px;

  background:#ffffff;
  color:#20252b;

  border:1px solid #d9dee3;

  border-radius:8px;

  box-shadow:
    0 2px 8px rgba(0,0,0,.06);

  overflow:hidden;
}

.diagnostics-card-wide{
  grid-column:1 / -1;
}


/* Titles */

.diagnostics-card h2{
  margin:0 0 18px;

  padding-bottom:10px;

  color:#20252b;

  border-bottom:
    1px solid #e2e6ea;

  font-size:14px;
  font-weight:600;

  text-transform:uppercase;
  letter-spacing:.06em;
}


/* Values */

.diagnostics-list{
  margin:0;
}

.diagnostics-list > div{
  display:grid;

  grid-template-columns:
    minmax(130px, 180px)
    minmax(0, 1fr);

  gap:20px;

  padding:9px 0;
}

.diagnostics-list dt{
  color:#6c757d;
}

.diagnostics-list dd{
  min-width:0;
  margin:0;

  color:#20252b;

  font-weight:500;
}


/* Main values */

.diagnostics-value-main{
  color:#20252b;

  font-size:18px;
  font-weight:500;
}


/* Technical values */

.diagnostics-break{
  display:block;

  width:100%;
  max-width:100%;

  overflow-x:auto;
  overflow-y:hidden;

  white-space:nowrap;

  padding-bottom:6px;

  scrollbar-width:thin;
  scrollbar-color:
    #b8bec5
    #eef0f2;
}


/* Horizontal scrollbar */

.diagnostics-break::-webkit-scrollbar{
  height:6px;
}

.diagnostics-break::-webkit-scrollbar-track{
  background:#eef0f2;

  border-radius:3px;
}

.diagnostics-break::-webkit-scrollbar-thumb{
  background:#b8bec5;

  border-radius:3px;
}

.diagnostics-break::-webkit-scrollbar-thumb:hover{
  background:#969da5;
}


/* Modules */

.diagnostics-modules-section h3{
  margin:0 0 12px;

  color:#6c757d;

  font-size:13px;
  font-weight:500;

  text-transform:uppercase;
  letter-spacing:.05em;
}

#diag-modules,
#diag-api-modules{
  display:grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap:8px 24px;
}

#diag-modules,
#diag-api-modules{
  display:grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap:8px 24px;
}

#diag-modules > div,
#diag-api-modules > div{
  display:flex;
  justify-content:space-between;

  min-width:0;

  gap:20px;

  padding:9px 12px;

  color:#20252b;

  border:1px solid #e5e8eb;

  border-radius:5px;

  background:#f6f7f8;
}

.diagnostics-modules-api{
  margin-top:24px;
}


/* Tablet */

@media(max-width:900px){

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

  .diagnostics-card-wide{
    grid-column:auto;
  }

}


/* Mobile */

@media(max-width:600px){

  .diagnostics-card{
    padding:18px;
  }

  .diagnostics-header h1{
    font-size:24px;
  }

  .diagnostics-list > div{
    grid-template-columns:1fr;
    gap:4px;
  }

  #diag-modules,
  #diag-api-modules{
    grid-template-columns:1fr;
  }

}

.diagnostics-modules-api{
  margin-top:24px;
}

/* =========================================================
   CORE MODAL
   ========================================================= */

body.modal-open{
  overflow:hidden;
}

.core-modal-overlay{
  position:fixed;
  inset:0;
  z-index:2000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(20, 25, 30, .55);
}

.core-modal-overlay[hidden]{
  display:none;
}

.core-modal{
  display:flex;
  flex-direction:column;
  width:100%;
  max-height:calc(100vh - 48px);
  background:#ffffff;
  border-radius:10px;
  box-shadow:0 20px 60px rgba(0,0,0,.22);
  overflow:hidden;
}

.core-modal-small{
  max-width:420px;
}

.core-modal-medium{
  max-width:680px;
}

.core-modal-large{
  max-width:1100px;
}

.core-modal-header{
  display:flex;
  align-items:center;
  gap:16px;
  padding:18px 20px;
  border-bottom:1px solid #e3e7eb;
}

.core-modal-header h2{
  flex:1;
  margin:0;
  font-size:20px;
  font-weight:600;
}

.core-modal-close{
  width:36px;
  height:36px;
  padding:0;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#69727c;
  font-size:26px;
  line-height:1;
  cursor:pointer;
}

.core-modal-close:hover{
  background:#f4f6f8;
  color:#20252b;
}

.core-modal-body{
  flex:1;
  min-height:0;
  padding:20px;
  overflow:auto;
}

.core-modal-message{
  margin:0;
  line-height:1.5;
}

.core-modal-footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:14px 20px;
  border-top:1px solid #e3e7eb;
}

.core-modal-button{
  padding:9px 16px;
  border:1px solid #d7dde3;
  border-radius:6px;
  background:#ffffff;
  color:#20252b;
  cursor:pointer;
}

.core-modal-button:hover{
  background:#f4f6f8;
}

.core-modal-button.primary{
  border-color:#00498a;
  background:#00498a;
  color:#ffffff;
}

.core-modal-button.primary:hover{
  background:#003d74;
}

@media(max-width:600px){

  .core-modal-overlay{
    align-items:flex-end;
    padding:12px;
  }

  .core-modal{
    max-width:none;
    max-height:calc(100vh - 24px);
  }

  .core-modal-header,
  .core-modal-body{
    padding:16px;
  }

  .core-modal-footer{
    padding:12px 16px;
  }

}

/* =========================================================
   SYSTEM VIEWS
   ========================================================= */

.system-projects-view{
  width:100%;
  max-width:1100px;
  margin:0 auto;
}

.system-view-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:24px;
}

.system-view-header h1{
  margin:0 0 6px;
}

.system-view-header p{
  margin:0;
  color:#69727c;
}

.system-primary-button,
.system-secondary-button{
  border-radius:6px;
  font:inherit;
  cursor:pointer;
}

.system-primary-button{
  padding:10px 16px;
  border:1px solid #00498a;
  background:#00498a;
  color:#ffffff;
}

.system-primary-button:hover{
  background:#003d74;
}

.system-secondary-button{
  padding:8px 12px;
  border:1px solid #d7dde3;
  background:#ffffff;
  color:#20252b;
}

.system-secondary-button:hover{
  background:#f4f6f8;
}

.system-projects-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.system-project-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) 110px 424px;
  align-items:center;
  gap:20px;
  padding:16px 18px;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
}

.system-project-name{
  margin-bottom:4px;
  font-weight:600;
}

.system-project-code{
  color:#69727c;
  font-size:13px;
}

.system-project-actions{
  display:grid;
  grid-template-columns:repeat(4, 100px);
  gap:8px;
}

.system-project-actions .system-secondary-button,
.system-project-action-placeholder{
  width:100px;
}

.system-project-actions .system-secondary-button{
  text-align:center;
}

.system-status{
  display:inline-flex;
  align-items:center;
  padding:5px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  justify-self:start;
}

.system-status-active{
  background:#e9f7ef;
  color:#287a48;
}

.system-status-disabled{
  background:#f0f1f2;
  color:#69727c;
}

.system-empty-state{
  padding:32px;
  text-align:center;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
  color:#69727c;
}

.system-form{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.system-form-field{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.system-form-field label{
  font-weight:600;
}

.system-form-field input,
.system-form-field select,
.system-form-field textarea{
  width:100%;
  padding:10px 11px;
  border:1px solid #cfd6dd;
  border-radius:6px;
  background:#ffffff;
  color:#20252b;
}

.system-form-field small{
  color:#69727c;
}

.system-form-error{
  padding:10px 12px;
  border-radius:6px;
  background:#fff1f0;
  color:#a12622;
  font-size:14px;
}

@media(max-width:700px){

  .system-view-header{
    flex-direction:column;
  }

  .system-project-card{
    grid-template-columns:1fr;
    gap:12px;
  }

  .system-project-actions{
    flex-wrap:wrap;
  }

}

.system-modules-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.system-module-card{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:20px;
  padding:18px 20px;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
}

.system-module-info{
  min-width:0;
}

.system-module-name{
  font-size:17px;
  font-weight:600;
}

.system-module-id{
  margin-top:3px;
  font-size:13px;
  color:#69727c;
}

.system-module-details,
.system-module-dependencies{
  margin-top:7px;
  font-size:13px;
  color:#69727c;
}

.system-module-error{
  grid-column:1 / -1;
  padding-top:10px;
  border-top:1px solid #e3e7eb;
  font-size:13px;
  color:#a12622;
}

@media (max-width:768px){

  .system-module-card{
    grid-template-columns:1fr;
  }

}

.system-project-modules-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.system-project-module-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px;
  border:1px solid #e3e7eb;
  border-radius:8px;
  cursor:pointer;
}

.system-project-module-item input{
  margin-top:4px;
}

.system-project-module-name{
  font-weight:600;
}

.system-project-module-details{
  margin-top:4px;
  font-size:13px;
  color:#69727c;
}

/* =========================================================
   SYSTEM USERS / ROLES / PERMISSIONS
   ========================================================= */

.system-users-view,
.system-roles-view{
  width:100%;
  max-width:1100px;
  margin:0 auto;
}

.system-users-list,
.system-roles-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.system-user-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) 110px 424px;
  align-items:center;
  gap:20px;
  padding:16px 18px;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
}

.system-user-name,
.system-role-name{
  margin-bottom:4px;
  font-weight:600;
}

.system-user-details,
.system-role-details{
  margin-top:3px;
  color:#69727c;
  font-size:13px;
}

.system-user-actions{
  display:grid;
  grid-template-columns:repeat(4, 100px);
  gap:8px;
}

.system-user-actions .system-secondary-button{
  width:100px;
  text-align:center;
}

.system-role-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:20px;
  padding:16px 18px;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
}

.system-role-actions{
  display:flex;
  gap:8px;
}

.system-selection-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.system-selection-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px;
  border:1px solid #e3e7eb;
  border-radius:8px;
  background:#ffffff;
  cursor:pointer;
}

.system-selection-item:hover{
  background:#f7f9fa;
}

.system-selection-item input{
  margin-top:4px;
}

.system-selection-name{
  font-weight:600;
}

.system-selection-details{
  margin-top:4px;
  color:#69727c;
  font-size:13px;
}

@media(max-width:700px){

  .system-user-card,
  .system-role-card{
    grid-template-columns:1fr;
    gap:12px;
  }

  .system-user-actions{
    display:flex;
    flex-wrap:wrap;
  }

  .system-role-actions{
    flex-wrap:wrap;
  }

}

/* =========================================================
   SYSTEM DIAGNOSTICS UI
   ========================================================= */

.diagnostics-header-toolbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
}

.diagnostics-refresh{
  flex:0 0 auto;
  padding:9px 16px;
  border:1px solid #00498a;
  border-radius:6px;
  background:#00498a;
  color:#ffffff;
  font:inherit;
  cursor:pointer;
}

.diagnostics-refresh:hover:not(:disabled){
  background:#003d74;
}

.diagnostics-refresh:disabled{
  opacity:.55;
  cursor:default;
}

.diagnostics-error{
  margin-bottom:18px;
  padding:12px 14px;
  border:1px solid #e4b4b4;
  border-radius:7px;
  background:#fff4f4;
  color:#a12626;
}

.diagnostics-overall{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
  padding:14px 18px;
  background:#ffffff;
  border:1px solid #d9dee3;
  border-radius:8px;
}

.diagnostics-overall > div:first-child{
  display:flex;
  align-items:center;
  gap:12px;
}

.diagnostics-overall-label{
  font-weight:600;
}

.diagnostics-last-check{
  color:#69727c;
  font-size:13px;
}

.diagnostics-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:68px;
  padding:4px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
}

.diagnostics-status-ok{
  background:#e9f7ef;
  color:#287a48;
}

.diagnostics-status-error{
  background:#fff1f0;
  color:#a12622;
}

.diagnostics-status-neutral{
  background:#f0f1f2;
  color:#69727c;
}

@media(max-width:600px){

  .diagnostics-header-toolbar{
    flex-direction:column;
  }

  .diagnostics-overall{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }

}

/* =========================================================
   SYSTEM PUBLISH PROJECT
   ========================================================= */

.system-publish-view{
  width:100%;
  max-width:1100px;
  margin:0 auto;
}

.system-publish-panel{
  margin-bottom:28px;
  padding:20px;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
}

.system-publish-panel select{
  width:100%;
  max-width:520px;
  padding:10px 11px;
  border:1px solid #cfd6dd;
  border-radius:6px;
  background:#ffffff;
}

.system-publish-project-info{
  margin-top:18px;
  padding:14px;
  border:1px solid #e3e7eb;
  border-radius:7px;
  background:#f7f9fa;
}

#publish-project-modules{
  margin-top:6px;
  color:#69727c;
  font-size:14px;
}

.system-publish-actions{
  margin-top:20px;
}

.system-publish-history h2{
  margin:0 0 14px;
  font-size:18px;
}

#publish-packages{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.system-publish-package{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:20px;
  padding:16px 18px;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
}

.system-publish-package-name{
  font-weight:600;
}

.system-publish-package-details{
  margin-top:4px;
  color:#69727c;
  font-size:13px;
}

.system-publish-package-archive{
  margin-top:5px;
  color:#69727c;
  font-family:monospace;
  font-size:12px;
  overflow-wrap:anywhere;
}

@media(max-width:700px){

  .system-publish-package{
    grid-template-columns:1fr;
  }

}

/* =========================================================
   SYSTEM UPDATE / ROLLBACK
   ========================================================= */

.system-update-view{
  width:100%;
  max-width:1100px;
  margin:0 auto;
}

.system-update-section{
  margin-bottom:28px;
}

.system-update-section h2{
  margin:0 0 14px;
  font-size:18px;
}

#system-update-published,
#system-update-installed{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.system-update-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:20px;
  padding:16px 18px;
  background:#ffffff;
  border:1px solid #e3e7eb;
  border-radius:8px;
}

.system-update-name{
  font-weight:600;
}

.system-update-details{
  margin-top:4px;
  color:#69727c;
  font-size:13px;
}

@media(max-width:700px){

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

}

/* Project module groups */
.sidebar-group-toggle.sidebar-link--project-module{
  background:#2b3138;
}

.sidebar-group-toggle.sidebar-link--project-module:hover{
  background:#343b43;
}

.sidebar-group.active > .sidebar-group-toggle.sidebar-link--project-module{
  background:#3a424b;
}
