/* systems.css */

/* THEME */
body{
  font-family:"Segoe UI",sans-serif;
  margin:0;
  padding:0;
  line-height: 1.6;
}
body.light-mode{
  background:#f5f5f5;
  color:#333;
}
body.dark-mode{
  background:#1e1e1e;
  color:#aaa;
}
.container{
  max-width:1300px;
  margin:20px auto;
  padding:0 10px;
}
h1,h2,h3{text-align:center;}
h1 {font-size: 1.7em;}
h2 { margin-top: 0; }

/* SIDEBAR */
.sidebar-toggle{
  position:fixed;
  top:10px;
  left:10px;
  z-index:1001;
  background:#3498db;
  color:#fff;
  border-radius:4px;
  padding:6px 10px;
  cursor:pointer;
  font-size:16px;
}
.sidebar{
  position:fixed;
  top:0;
  left:0;
  width:250px;
  height:100%;
  background:#ffffff;
  border-right:1px solid #ddd;
  transform:translateX(-100%);
  transition:transform 0.25s ease;
  z-index:1003;
}

body.dark-mode .sidebar{
  background:#2a2a2a;
  border-right:1px solid #444;
}
.sidebar.open{
  transform:translateX(0);
}
.sidebar-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px;
  border-bottom:1px solid #ddd;
}
body.dark-mode .sidebar-header{
  border-bottom:1px solid #444;
}

.sidebar-content{
  padding:10px;
}
.sidebar-item{
  margin-bottom:10px;
}
.sidebar-overlay{
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(0,0,0,0.3);
  display:none;
  z-index:999;
}
.sidebar-overlay.show{display:block;}
.switch-label{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* Toggle switch */
.switch{
  position:relative;
  display:inline-block;
  width:40px;
  height:20px;
}
.switch input{display:none;}
.slider{
  position:absolute;
  cursor:pointer;
  top:0;left:0;right:0;bottom:0;
  background:#ccc;
  transition:.2s;
  border-radius:20px;
}
.slider:before{
  position:absolute;
  content:"";
  height:16px;width:16px;
  left:2px;bottom:2px;
  background:white;
  transition:.2s;
  border-radius:50%;
}
input:checked + .slider{
  background:#3498db;
}
input:checked + .slider:before{
  transform:translateX(20px);
}

/* TABS */
.tabs{
  display:flex;
  border-bottom:5px solid #aaa;
  margin-bottom:9px;
  padding-bottom: 1px;
  overflow-x:auto;
}
body.dark-mode .tabs{
  border-bottom:5px solid #666;
}
.tab{
    padding: 5px 11px 8px; 
    cursor:pointer;
    color:#333;
    background:#eaeaea;
    border:1px solid #ddd;
    margin-left:5px;   
    border-radius:7px 7px 0 0;  
    white-space:nowrap;
}
.tab:hover {     
    background: #8cd1ff;
    border-color:#8cd1ff;
}
.tab.active {     
    color:#f7f9ff;
    background: #2888c9;
    border-color:#2888c9;    
}

body.dark-mode .tab{
    color:#aaa;
    background:#333;
    border-color: #999;
}
body.dark-mode .tab:hover {
    color: #000;
    background: #bbb;
    border-color: #fff; 
}
body.dark-mode .tab.active { 
    color:#eee;
    background: #555;  
    border-color: #aaa;     
}

.tab-content{
  display:none;
  background:#ffffff;
  padding:20px;
  border:1px solid #ddd;
  border-radius:0 5px 5px 5px;
}
body.dark-mode .tab-content{
  background:#2a2a2a;
  border:1px solid #444;
}
.tab-content.active{display:block;}

/* GRID */
.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:15px;
}
.grid-3{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:15px;
}
@media(max-width:900px){
  .grid-3{grid-template-columns:1fr 1fr;}
}
@media(max-width:600px){
  .grid-2,.grid-3{grid-template-columns:1fr;}
}

/* FORM */
label{
  font-weight:bold;
  font-size:13px;
}
input,select,textarea{
  width:100%;
  padding:6px;
  margin-top:5px;
  font-size:14px;
  box-sizing:border-box;
  background:#f7f9ff;
  border:1px solid #ccc;
  color:#333;
}
textarea { 
  font-size:16px;
  margin-top: 0;
  min-height:60px;
  background: #f7f9ff;
  resize:vertical;
  border-radius: 6px;
}
textarea[name="BenchmarkGapRecommendations"] {
  min-height: 165px;
}

#TechRecommendations{
    min-height:240px;
}

body.dark-mode input, 
body.dark-mode select,
body.dark-mode textarea{
  background:#1e1e1e;
  border:1px solid #555;
  color:#bbb;
}

/* TABLE */
table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  font-size:13px;
  background:#fff;
}
th,td {
  border:1px solid #ddd;
  padding:4px;
  text-align:center;
}
th {
    padding:7px 4px;
    background:#f0f0f0;
}

body.dark-mode table{
  background:#1e1e1e;
}
body.dark-mode th{
  background:#333;
}
body.dark-mode th,body.dark-mode td{
  border:1px solid #444;
}

/* BUTTONS */
button {
    padding:8px 16px;
    margin:5px;
    font-size:14px;
    cursor:pointer;  
    color:#f7f9ff;
    background: #2888c9; 
    border: 1px solid #2888c9;  
    border-radius:4px;
}
td button {
    padding:4px 9px;
    margin: 2px 5px;
}
.button-large {
    font-size: 19px;
    /* font-weight: bold; */
    padding: 8px 21px;
}

button:hover {
    color: #000;
    background:#8cd1ff;
    border-color:#8cd1ff;
}

body.dark-mode button{
    /* color:#aaa;
    background:#333; 
    border-color: #999;  */
    
    color: #eee;
    background: #555;
    border-color: #aaa;
}

body.dark-mode button:hover {
    color: #000;
    background: #bbb;
    border-color: #fff;  
}

.actions{ margin-top:-13px; }

.sidebar-header button{
    color: #c00;
    font-size: 25px;
    font-weight: bold;
    padding: 3px 9px;
    background: rgb(255, 193, 193);
    border: 1px solid rgb(228, 138, 138);    
    cursor:pointer;
}
.sidebar-header button:hover{
    background: rgb(251, 152, 152);
    border: 1px solid rgb(207, 81, 81);
}

/* SECTIONS */
.section-title{
  font-weight:bold;
  margin-top:15px;
  margin-bottom:5px;
  border-bottom:1px solid #ddd;
  padding-bottom:3px;
}
body.dark-mode .section-title{
  border-bottom:1px solid #444;
}
.small-note{
  font-size:14px;
  color:#777;
}
body.dark-mode .small-note{
  color:#bbb;
}

/* CODE BLOCK */
.code-block{
  background:#000;
  border:1px solid #444;
  padding:10px 25px 0;
  font-size:14px;
  direction:ltr;
  text-align:left;
  overflow:auto;
  border-radius:4px;
  color:#eee;
  line-height: 1.4;
  margin-block: 10px 5px;
}
.code-keyword{color:#c586c0;}
.code-number{color:#b5cea8;}
.code-string{color:#ce9178;}

/* DASHBOARD CARDS */
.flex{
  display:flex;
  gap:15px;
  flex-wrap:wrap;
  justify-content:center;
}
.card{
  border-radius:8px;
  padding:12px;
  min-width:220px;
  text-align:center;
  color:#fff;
}
body.dark-mode .card {
    opacity: 0.7;
}
.card h3{
  font-size:14px;
  margin-top:0;
  margin-bottom:8px;
}
.card-value{
  font-size:24px;
  font-weight:bold;
}
.card-primary{background: #2888c9;}
.card-info{background:#16a085;}
.card-warning{background:#f1c40f;color:#000;}
.card-danger{background:#c0392b;}

/* SCORE BOX */
.score-box{
  font-size:16px;
  /* font-weight:bold; */
  padding:4px 7px 9px;
  text-align:center;
  border-radius:5px;
  margin-top:5px;
  background:#f0f0f0;
  color:#333;
}
#summaryPercent {
    font-size:16px;
    padding:9px 7px;
    border-radius:5px;
}

body.dark-mode .score-box{
  background:#333;
  color:#fff;
}
.high{background:#2ecc71;color:#fff;}
.medium{background:#f1c40f;color:#000;}
.low{background:#e67e22;color:#000;}
.critical{background:#c0392b;color:#fff;}

/* APPROVAL */
.approval-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:15px;
}
@media(max-width:900px){
  .approval-grid{grid-template-columns:1fr 1fr;}
}
@media(max-width:600px){
  .approval-grid{grid-template-columns:1fr;}
}
.approval-box{
  border:1px solid #ddd;
  border-radius:6px;
  padding:10px;
  background: #fffbdb;
}
body.dark-mode .approval-box{
  border:1px solid #444;
  background:#1e1e1e;
}
.approval-box h4{  
    /* margin-top:0;   */
    color: #2888c9;
    width: fit-content;
    text-align: center;
    margin: auto;
    font-size: 15px;
    font-weight: bold;
    border-bottom: 2px solid #0273be;
}
body.dark-mode .approval-box h4{
    opacity: 0.6;
}
/* ACCORDION */
.accordion-item{margin-bottom:8px;}
.accordion-header{
    text-align:right;
    /* padding:8px 10px; */
    padding: 5px 11px 8px;
    background:#eaeaea;
    border:1px solid #ddd;
    color:#333;   
    cursor:pointer;
    border-radius:7px 7px 0 0;
}
.accordion-header:hover{
    background: #8cd1ff;
    border-color:#8cd1ff;
  
}
.accordion-header.active{
    color:#f7f9ff;
    background: #2888c9;
    border-color:#2888c9;
  
}
.accordion-body{
  display:none;
  padding:10px;
  border:1px solid #ddd;
  border-top:none;
  background:#f7f9ff;
  border-radius:0 0 4px 4px;
}
.accordion-body.open{ display:block; }

body.dark-mode .accordion-header{
  /* background:#333;
  border:1px solid #444;
  color:#eee; */
    color:#aaa;
    background:#333;
    border:1px solid #999;
}


body.dark-mode .accordion-header:hover {
    color: #000;
    background: #bbb;
    border-color: #fff; 
}
body.dark-mode .accordion-header.active { 
    color:#eee;
    background: #555;  
    border-color: #aaa;      
}

body.dark-mode .accordion-body{
  background:#1e1e1e;
  border:1px solid #444;
}

/* YEAR DROPDOWN */
.year-dropdown{
  position:absolute;
  top:100%;
  right:0;
  left:0;
  max-height:200px;
  overflow-y:auto;
  background:#fff;
  border:1px solid #ccc;
  display:none;
  z-index:10;
}
.year-dropdown div{
  padding:5px 8px;
  cursor:pointer;
}
.year-dropdown div:hover{
  background:#3498db;
  color:#fff;
}
body.dark-mode .year-dropdown{
  background:#1e1e1e;
  border:1px solid #555;
}
body.dark-mode .year-dropdown div:hover{
  background:#3498db;
}

/* CHART */
.chart-wrapper{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-top:10px;
}
#resultChart{  
  width: 100%;
  height: 240px;
  border: 1px solid #ddd;
  border-radius: 7px;
  /* padding-bottom: 10px; */
  background: #f7f9ff;
}

body.dark-mode #resultChart{
  background:#1e1e1e;
  border:1px solid #444;
}

/* MISC */
hr{
  border:none;
  border-top:1px solid #ddd;
  margin:15px 0;
}
body.dark-mode hr{
  border-top:1px solid #444;
}

.benchmark-table input,
.benchmark-table textarea {
  width: 100%;
  padding: 6px;
  text-align: center;
  box-sizing: border-box;
}

#benchmarkRadar {
  max-width: 80%;
  max-height: 400px;
  border: 1px solid #ddd;
    border-radius: 7px;
    padding-bottom: 10px;
    background: #f7f9ff;

}

.chart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

/*  */
.field-row {
  display: flex;
  flex-direction: column;
}

.field-inline {
  display: flex;
  width: 100%;
  gap: 8px;
}

.field-inline select {
  width: 100%;
}

.score-desc,
.field-inline .other-input {
  display: none;
  width: 100%;
  padding: 6px;
  background:#f7f9ff;
  border:1px solid #ccc;      
}

.score-desc {
  border-radius: 3px;
  font-weight: bold;
  text-align: center;
}

body.dark-mode .score-desc,
body.dark-mode .field-inline .other-input {
  background:#1e1e1e;
  border-color: #555;
  color:#bbb;
}

/* عند وجود تفسير → تقسيم نصفين */
.field-inline.split select {
  width: 40%;
}

.field-inline.split .other-input,
.field-inline.split .score-desc {
  width: 60%;
}

/* ألوان التفسير */
.score-desc.high { background:#2ecc71; color:white; }
.score-desc.medium { background:#f1c40f; color:black; }
.score-desc.low { background:#e67e22; color:white; }
.score-desc.critical { background:#c0392b; color:white; }

.count-label {
  font-size: 14px;
  color: #a00;
  margin-right: 8px;
}

.benchmark-table input.high { background:#2ecc71; color:white; }
.benchmark-table input.medium { background:#f1c40f; color:black; }
.benchmark-table input.low { background:#e67e22; color:white; }
.benchmark-table input.critical { background:#c0392b; color:white; }

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sign-preview {  /* max-width: 200px; */
  width: calc(100% - 14px);
  max-height: 60px;
  object-fit: contain;
  margin-top: 6px;
  border: 1px solid #ccc;  /* var(--border); */
  background: #f7f9ff;  /* var(--bg2); */
  padding: 6px;
  display: none;
}

.signature-pad {
  width: 100%;
  height: 120px;
  border: 1px solid #ccc;
  background: #fff;
  /* cursor: crosshair; */
  touch-action: none; /* مهم جداً للـ Stylus */

  /* Encoded SVG in one line */
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><path d='M2 30 L6 26 L26 6 L22 2 L2 22 Z' fill='black' stroke='red' stroke-width='1.5'/><circle cx='24' cy='8' r='2' fill='white'/></svg>") 0 32, auto;
}

.sig-buttons {
  margin-top: 5px;
  display: flex;
  gap: 10px;
}

/* .mode-title {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 15px;
} */
 
.tabs-header {
  display: flex;
  justify-content: flex-start;
  /* padding: 10px 0; */
}

.mode-title {
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -60px;
  padding-right: 20px;
}

/* ألوان الحالات */
.mode-add {
  color: #27ae60; /* أخضر */
}

.mode-edit {
  color: #2980b9; /* أزرق */
}

/* حجم الأيقونة */
.mode-title .icon {
  font-size: 21px;
}


/* Exact match */
[ name="value" ] {
  /* styles */
}

/* Partial match (contains) */
[ name*="value" ] {
  /* styles */
}

/* Starts with */
[ name^="value" ] {
  /* styles */
}

/* Ends with */
[ name$="value" ] {
  /* styles */
}

