/* ==========================================================================
   ClassPro Theme (aspx-theme.css)
   Classic Windows / ASP.NET Web Style with Mobile Responsiveness
   ========================================================================== */

:root {
  --asp-primary: #507CD1;
  --asp-primary-dark: #284E98;
  --asp-header-bg: #2B579A;
  --asp-header-gradient: linear-gradient(180deg, #3768B0 0%, #204A87 100%);
  --asp-nav-bg: #EAECEF;
  --asp-border: #999999;
  --asp-grid-border: #B5C7DE;
  --asp-alt-row: #F7F6F3;
  --asp-hover-row: #EFF3FB;
  --asp-selected-row: #E2DED6;
  --asp-text: #284775;
  --asp-btn-bg: linear-gradient(180deg, #FFFFFF 0%, #ECE9D8 100%);
  --asp-btn-border: #7F9DB9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Verdana, Arial, sans-serif;
  font-size: 13px;
  color: #333333;
  background-color: #EDECE4;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

/* Page Container */
.asp-page-container {
  width: 96%;
  max-width: 1360px;
  margin: 15px auto 30px auto;
  background: #FFFFFF;
  border: 1px solid #7F9DB9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Header */
.asp-header {
  background: var(--asp-header-gradient);
  color: #FFFFFF;
  padding: 12px 20px;
  border-bottom: 2px solid #1E395B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.asp-brand-title {
  display: flex;
  flex-direction: column;
}

.asp-app-name {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.asp-app-sub {
  font-size: 11px;
  color: #D2E1F8;
  margin-top: 2px;
}

/* Status Bar */
.asp-status-strip {
  background: #3B66A4;
  color: #EFF3FB;
  padding: 6px 20px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #204A87;
}

.asp-user-pill {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: bold;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.asp-link-btn {
  color: #FFFF99;
  text-decoration: underline;
  cursor: pointer;
  font-weight: bold;
  margin-left: 8px;
}

.asp-link-btn:hover {
  color: #FFFFFF;
}

/* Navigation Menu */
.asp-nav-menu {
  background: #F0F0EE;
  border-bottom: 1px solid #7F9DB9;
  display: flex;
  padding: 0 10px;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.asp-menu-item {
  display: inline-block;
  padding: 10px 14px;
  color: #284775;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.asp-menu-item:hover {
  background: #FFFFFF;
  border-color: #B5C7DE;
  color: #1A3660;
}

.asp-menu-item.active {
  background: #FFFFFF;
  border: 1px solid #7F9DB9;
  border-bottom: 1px solid #FFFFFF;
  margin-bottom: -1px;
  color: #204A87;
  font-weight: bold;
}

.asp-badge-count {
  background: #D9534F;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 5px;
}

/* Breadcrumbs */
.asp-sitemap {
  background: #FAFAFA;
  padding: 6px 20px;
  border-bottom: 1px dotted #CCCCCC;
  font-size: 11px;
  color: #666666;
}

.asp-sitemap a {
  color: #284E98;
  text-decoration: none;
}
.asp-sitemap a:hover {
  text-decoration: underline;
}

/* PUSH Notifications Banner */
.asp-push-banner {
  background-color: #FFF3CD;
  border: 1px solid #FFEEBA;
  border-left: 4px solid #FF9800;
  color: #856404;
  padding: 10px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 15px;
  border-radius: 2px;
}

.asp-push-banner.visible {
  display: flex;
}

/* Content Area */
.asp-content {
  padding: 20px;
  min-height: 480px;
}

/* Typography */
h1.asp-title {
  font-size: 17px;
  color: #204A87;
  border-bottom: 2px solid #507CD1;
  padding-bottom: 6px;
  margin-top: 0;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

h2.asp-subtitle {
  font-size: 14px;
  color: #284E98;
  margin-top: 15px;
  margin-bottom: 10px;
  border-bottom: 1px solid #E0E0E0;
  padding-bottom: 4px;
}

/* Panels */
.asp-panel {
  border: 1px solid #B5C7DE;
  background: #FAFBFE;
  padding: 15px 18px;
  margin-bottom: 20px;
  border-radius: 2px;
  position: relative;
}

.asp-legend {
  font-size: 12px;
  font-weight: bold;
  color: #284775;
  background: #FAFBFE;
  padding: 2px 8px;
  border: 1px solid #B5C7DE;
  border-radius: 2px;
}

/* Forms */
.asp-form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.asp-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.asp-label {
  font-size: 11px;
  font-weight: bold;
  color: #333333;
}

.asp-textbox, .asp-select, .asp-textarea {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #7F9DB9;
  background-color: #FFFFFF;
  border-radius: 2px;
  outline: none;
  max-width: 100%;
}

.asp-textbox:focus, .asp-select:focus, .asp-textarea:focus {
  border-color: #204A87;
  box-shadow: 0 0 3px rgba(32, 74, 135, 0.4);
}

.asp-select {
  height: 32px;
  background: #FFFFFF url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22293%22%20height%3D%22293%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M236%2084l-89%2089-89-89%2028-28%2061%2061%2061-61z%22%2F%3E%3C%2Fsvg%3E") no-repeat right 8px center;
  background-size: 9px;
  padding-right: 24px;
  appearance: none;
  -webkit-appearance: none;
}

/* Buttons */
.asp-btn {
  font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #333333;
  background: var(--asp-btn-bg);
  border: 1px solid #707070;
  border-radius: 2px;
  padding: 5px 14px;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 18px;
  white-space: nowrap;
}

.asp-btn:hover {
  background: linear-gradient(180deg, #FFFFFF 0%, #DFDCD1 100%);
  border-color: #3C7FB1;
}

.asp-btn:active {
  background: #D9D6CB;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.asp-btn-primary {
  color: #FFFFFF;
  background: linear-gradient(180deg, #4A8CF7 0%, #205BB5 100%);
  border-color: #174284;
}

.asp-btn-primary:hover {
  background: linear-gradient(180deg, #5B99FF 0%, #2868CC 100%);
  border-color: #14376E;
  color: #FFFFFF;
}

.asp-btn-danger {
  color: #FFFFFF;
  background: linear-gradient(180deg, #E65C5C 0%, #B82828 100%);
  border-color: #8C1C1C;
}

.asp-btn-danger:hover {
  background: linear-gradient(180deg, #F06E6E 0%, #CB3232 100%);
  color: #FFFFFF;
}

.asp-btn-success {
  color: #FFFFFF;
  background: linear-gradient(180deg, #45B058 0%, #267E36 100%);
  border-color: #1B5E26;
}

.asp-btn-sm {
  padding: 3px 8px;
  font-size: 11px;
}

/* GridView Table */
.asp-gridview-wrapper {
  overflow-x: auto;
  margin-top: 10px;
  margin-bottom: 20px;
  border: 1px solid #7F9DB9;
  -webkit-overflow-scrolling: touch;
}

.asp-gridview {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12px;
  color: #333333;
  background-color: #FFFFFF;
}

.asp-gridview th {
  background-color: #507CD1;
  color: #FFFFFF;
  font-weight: bold;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #436FB8;
  white-space: nowrap;
}

.asp-gridview td {
  padding: 7px 10px;
  border: 1px solid #B5C7DE;
  vertical-align: middle;
}

.asp-gridview tr:nth-child(even) {
  background-color: var(--asp-alt-row);
}

.asp-gridview tr:hover {
  background-color: var(--asp-hover-row);
}

/* Badges */
.asp-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  text-align: center;
}

.asp-badge-good {
  background-color: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.asp-badge-norm {
  background-color: #FFFDE7;
  color: #F57F17;
  border: 1px solid #FFF59D;
}

.asp-badge-bad {
  background-color: #FFEBEE;
  color: #C62828;
  border: 1px solid #EF9A9A;
  font-weight: bold;
}

.asp-badge-was-yes {
  background-color: #E3F2FD;
  color: #1565C0;
  border: 1px solid #90CAF9;
}

.asp-badge-was-no {
  background-color: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
}

.asp-badge-was-late {
  background-color: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFE0B2;
}

/* Alert Boxes */
.asp-alert {
  padding: 10px 14px;
  border-radius: 2px;
  margin-bottom: 15px;
  font-size: 12px;
}

.asp-alert-info {
  background-color: #E7F0FA;
  border: 1px solid #98C0EC;
  color: #1A477A;
}

.asp-alert-warning {
  background-color: #FFF9E6;
  border: 1px solid #F5C344;
  color: #8A6400;
}

.asp-alert-danger {
  background-color: #FDE8E8;
  border: 1px solid #F89494;
  color: #9C1C1C;
}

.asp-alert-success {
  background-color: #EAF7EC;
  border: 1px solid #8FD89F;
  color: #1B662C;
}

/* KPI Panels */
.asp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.asp-kpi-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
  border: 1px solid #B5C7DE;
  border-left: 4px solid #507CD1;
  padding: 12px 14px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.asp-kpi-title {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: #555555;
  margin-bottom: 4px;
}

.asp-kpi-value {
  font-size: 20px;
  font-weight: bold;
  color: #204A87;
}

.asp-kpi-sub {
  font-size: 11px;
  color: #777777;
  margin-top: 2px;
}

/* Footer */
.asp-footer {
  background: #EAECEF;
  border-top: 1px solid #B5C7DE;
  padding: 10px 18px;
  font-size: 11px;
  color: #555555;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Modal */
.asp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 15px;
}

.asp-modal-window {
  background: #FFFFFF;
  border: 2px solid #507CD1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 550px;
  border-radius: 2px;
  overflow: hidden;
}

.asp-modal-header {
  background: linear-gradient(180deg, #4A8CF7 0%, #205BB5 100%);
  color: #FFFFFF;
  font-weight: bold;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.asp-modal-body {
  padding: 16px;
}

.asp-modal-footer {
  background: #F4F6F9;
  border-top: 1px solid #DCE3ED;
  padding: 10px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (@media queries)
   ========================================================================== */

@media (max-width: 768px) {
  body {
    background-color: #F0F0EE;
  }

  .asp-page-container {
    width: 100%;
    margin: 0;
    border: none;
    box-shadow: none;
  }

  .asp-header {
    padding: 10px 14px;
  }

  .asp-app-name {
    font-size: 16px;
  }

  .asp-status-strip {
    padding: 6px 12px;
    font-size: 11px;
    flex-direction: column;
    align-items: flex-start;
  }

  .asp-content {
    padding: 12px;
    min-height: auto;
  }

  .asp-nav-menu {
    padding: 0 4px;
  }

  .asp-menu-item {
    padding: 8px 10px;
    font-size: 11px;
  }

  .asp-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .asp-kpi-card {
    padding: 10px;
  }

  .asp-kpi-value {
    font-size: 17px;
  }

  .asp-form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .asp-form-row > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  .asp-textbox, .asp-select, .asp-textarea {
    font-size: 15px; /* Предотвращает нежелательный зум на iOS */
  }

  .asp-btn {
    padding: 7px 14px;
  }

  .asp-chart-container {
    grid-template-columns: 1fr !important;
  }

  .asp-two-col {
    grid-template-columns: 1fr !important;
  }

  .asp-push-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .asp-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .asp-kpi-grid {
    grid-template-columns: 1fr;
  }
}
