/* Подключение Material Icons */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* Сброс стилей */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1.5;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Material Icons класс */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* Header и навигация в стиле 1С */
header {
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 50px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0066cc;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo .material-icons {
  font-size: 20px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  padding: 0.75rem 1rem;
  border-radius: 0;
  transition: background-color 0.2s;
  font-size: 13px;
  font-weight: 400;
  border-right: 1px solid #e5e5e5;
}

.nav-links a:hover {
  background: #f0f8ff;
  color: #0066cc;
}

.nav-links a.active {
  background: #0066cc;
  color: white;
}

.burger {
  display: none;
  background: none;
  border: 1px solid #ccc;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 3px;
  color: #333;
}

.burger:hover {
  background: #f5f5f5;
}

/* Main контент */
main {
  flex: 1;
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 2rem;
  width: 100%;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #333;
  font-weight: 500;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: #333;
  font-weight: 500;
}

/* Карточки форм в стиле 1С */
.form-card {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.form-card label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 400;
  color: #333;
  font-size: 13px;
}

.form-card input,
.form-card textarea,
.form-card select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 13px;
  margin-top: 0.25rem;
  font-family: inherit;
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 3px rgba(0, 102, 204, 0.3);
}

.form-card textarea {
  resize: vertical;
  min-height: 80px;
}

.form-card button {
  background: #0066cc;
  color: white;
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 0.75rem;
}

.form-card button:hover {
  background: #0052a3;
}

.form-card button:active {
  background: #004080;
}

/* Таблицы в стиле 1С */
.table-requests {
  width: 100%;
  background: white;
  border: 1px solid #d0d0d0;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 13px;
}

.table-requests th,
.table-requests td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid #d0d0d0;
}

.table-requests th {
  background: #f5f5f5;
  color: #333;
  font-weight: 500;
  border-bottom: 2px solid #d0d0d0;
}

.table-requests tr:hover {
  background: #f9f9f9;
}

.table-requests tr:nth-child(even) {
  background: #fafafa;
}

/* Статусы в стиле 1С */
.status {
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.status.new {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status.in-progress {
  background: #cce5ff;
  color: #0066cc;
  border: 1px solid #99d3ff;
}

.status.closed {
  background: #d4edda;
  color: #155724;
  border: 1px solid #a3d4a8;
}

/* Приоритеты */
.priority {
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.priority.low {
  background: #d4edda;
  color: #155724;
  border: 1px solid #a3d4a8;
}

.priority.medium {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.priority.high {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Секции */
.kb-overview,
.new-request {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.kb-overview ul,
.articles {
  list-style: none;
  padding: 0;
}

.kb-overview li,
.articles li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kb-overview li:last-child,
.articles li:last-child {
  border-bottom: none;
}

.articles a {
  color: #0066cc;
  text-decoration: none;
  font-size: 13px;
}

.articles a:hover {
  text-decoration: underline;
}

/* Поиск */
input[type="search"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 1rem;
  background: white;
  font-family: inherit;
}

input[type="search"]:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 3px rgba(0, 102, 204, 0.3);
}

/* Кнопки в стиле 1С */
button {
  background: #0066cc;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

button:hover {
  background: #0052a3;
}

button:active {
  background: #004080;
}

button.secondary {
  background: #6c757d;
  border: 1px solid #5a6268;
}

button.secondary:hover {
  background: #5a6268;
}

button.danger {
  background: #dc3545;
  border: 1px solid #bd2130;
}

button.danger:hover {
  background: #c82333;
}

button.outline {
  background: white;
  color: #0066cc;
  border: 1px solid #0066cc;
}

button.outline:hover {
  background: #f0f8ff;
}

/* История изменений */
.history {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.history ul {
  list-style: none;
  padding: 0;
}

.history li {
  padding: 0.5rem 0;
  border-left: 3px solid #0066cc;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Логин */
.login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  flex-direction: column;
}

.login .form-card {
  width: 100%;
  max-width: 400px;
}

/* Уведомления */
.notification {
  padding: 0.75rem;
  border-radius: 3px;
  margin-bottom: 1rem;
  display: none;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification.success {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.notification.error {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.notification.info {
  background: #cce5ff;
  color: #0066cc;
  border-color: #99d3ff;
}

/* Фильтры */
.filters {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 13px;
  font-weight: 400;
}

.filters select {
  padding: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  min-width: 120px;
  font-size: 13px;
}

/* Панель инструментов */
.toolbar {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: #d0d0d0;
  margin: 0 0.5rem;
}

/* Группировка полей */
.field-group {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  margin-bottom: 1rem;
}

.field-group-header {
  background: #f5f5f5;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #d0d0d0;
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-group-content {
  padding: 1rem;
}

/* Footer */
footer {
  background: #f5f5f5;
  border-top: 1px solid #ddd;
  color: #666;
  text-align: center;
  padding: 1rem 0;
  margin-top: auto;
  font-size: 12px;
}

/*     -    style.css */

/*     ( media queries) */
.nav-links {
  box-sizing: border-box;                    /*      */
}

.nav-links * {
  box-sizing: border-box;                    /*      */
}

/*  */
@media (max-width: 768px) {
  /*   */
  .navbar {
    padding: 0 1rem;
    position: relative;
    z-index: 1002;
  }

  /*  ()  -  */
  .nav-links {
    position: fixed;
    top: 50px;
    right: -100%;
    bottom: 0;                               /*  bottom  height */
    width: 250px;
    max-width: 80vw;                         /*     */
    display: flex;
    flex-direction: column;
    background: #ffffff !important;          /*    */
    background-color: #ffffff !important;    /*   WebView */
    padding: 1rem 0;
    padding-bottom: 2rem;                    /*    */
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    border-left: 1px solid #ddd;
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;                      /*    */
    
    /*    WebView */
    -webkit-backface-visibility: hidden;     /*     */
    backface-visibility: hidden;
    transform: translateZ(0);                /*    */
    -webkit-transform: translateZ(0);
    -webkit-overflow-scrolling: touch;       /*    iOS */
  }

  /*    */
  .nav-links.open {
    right: 0;
    background: #ffffff !important;          /* ,     */
  }

  /*   */
  .nav-links li {
    margin: 0;
    width: 100%;
    background: transparent;                 /*     */
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    background: #ffffff;                     /*     */
    position: relative;                      /*    */
  }

  .nav-links a:hover {
    background: #f0f8ff !important;
  }

  .nav-links a.active {
    background: #0066cc !important;
    color: white !important;
  }

  /* - */
  .burger {
    display: block;
    z-index: 1003;
    background: #ffffff !important;          /*     */
  }

  /*        */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    height: calc(100vh - 50px);
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
  }

  .nav-overlay.active {
    display: block;
  }
}

@media (max-width: 480px) {
  /*   */
  .nav-links {
    position: fixed;
    top: 50px;
    right: -100%;
    bottom: 0;                               /*  bottom  height */
    width: 200px;
    max-width: 80vw;                         /*     */
    display: flex;
    flex-direction: column;
    background: #ffffff !important;          /*    */
    background-color: #ffffff !important;    /*   WebView */
    padding: 0.75rem 0;
    padding-bottom: 2rem;                    /*    */
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    border-left: 1px solid #ddd;
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;                      /*    */
    
    /*    WebView */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-overflow-scrolling: touch;       /*    iOS */
  }
  
  .nav-links.open {
    right: 0;
    background: #ffffff !important;
  }
  
  .nav-links li {
    margin: 0;
    width: 100%;
    background: transparent;
  }
  
  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 0.9rem;
    background: #ffffff;                     /*     */
    position: relative;
  }
}