/* styles.css */

body {
  margin: 0;
  font-family: Arial, sans-serif;
}

/* ===== Стили для страницы авторизации ===== */

body.auth-page {
  background: #f5f7fa;
  font-family: "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.login-container {
  background: #fff;
  padding: 40px 30px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  text-align: center;
}

.login-container h2 {
  margin-bottom: 25px;
  color: #333;
}

.login-container .logo {
  width: 180px;
  margin-bottom: 20px;
}

.login-container form input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  transition: 0.2s ease;
}

.login-container form input:focus {
  border-color: #4a90e2;
  outline: none;
}

.login-container form button {
  width: 100%;
  padding: 12px 15px;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-container form button:hover {
  background: #357ab7;
}

.login-container p {
  margin-top: 10px;
  color: red;
}

/* ===== Стили для страницы авторизации END ===== */

.sidebar {
  width: 200px;
  background: #333;
  color: white;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding: 20px;
}

.sidebar a {
  color: white;
  text-decoration: none;
  display: block;
  margin: 10px 0;
}

.sidebar a.active {
  font-weight: bold;
  text-decoration: underline;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 8px;
  font-size: 13px;
  color: #cfcfcf;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s;
  cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

.demo-banner {
  background: #ff9800;
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 0 12px 0;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.demo-banner small { opacity: .85; }

.flash-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.kanban-container {
    margin-left: 260px;
    padding: 20px;
    /* Не обрезаем горизонтальный скролл внутри .kanban-board */
    overflow: hidden;
}


.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  /* Позволяет прокручивать горизонтально при переполнении */
  -webkit-overflow-scrolling: touch;
}

.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: #999; }

.kanban-column {
  background: #f4f4f4;
  padding: 10px;
  min-width: 320px;
  width: 320px;
  max-width: 400px;
  flex-shrink: 0;
  border-radius: 8px;
}

.kanban-items {
  min-height: 200px;
  border: 1px dashed #ccc;
  padding: 10px;
  border-radius: 4px;
}

.kanban-item {
  background: white;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  cursor: move;
}

.kanban-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-link {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
}

.btn-link:hover {
  text-decoration: underline;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 300px;
  border-radius: 8px;
}

.close {
  float: right;
  font-size: 20px;
  cursor: pointer;
}

.addlead {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 20px;
}

.addlead:hover {
  background-color: #45a049;
}

.contacts-container {
  margin-left: 260px;
  padding: 20px;
}

.content-container {
  margin-left: 260px;
  padding: 20px;
}

.contacts-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.contacts-table th, .contacts-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.contacts-table th {
  background-color: #f7f7f7;
}

.contacts-table tr:hover {
  background-color: #f1f1f1;
}

.card-form {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.card-form.compact {
  margin-top: 12px;
}

.card-form label {
  display: block;
  font-size: 14px;
  margin-bottom: 10px;
}

.card-form input,
.card-form select,
.card-form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.btn-primary,
.btn-secondary {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #4a90e2;
  color: #fff;
}

.btn-secondary {
  background: #f2f2f2;
}

.alert {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.alert-error {
  background: #ffe5e5;
  color: #9b1c1c;
}

.alert-success {
  background: #e6f7e6;
  color: #1f7a1f;
}

.card-section {
  margin-top: 24px;
}

.muted {
  color: #666;
}

.email-listing {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-item-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
}

.email-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #666;
}

.email-subject {
  font-weight: bold;
  margin-top: 6px;
}

.email-snippet {
  color: #444;
  margin-top: 6px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.tab-button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  cursor: pointer;
  border-radius: 4px;
}

.tab-button.active {
  background: #4a90e2;
  color: #fff;
  border-color: #4a90e2;
}

.tab-content {
  display: none;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.tab-content.active {
  display: block;
}

.email-html {
  background: #fff;
}

.attachment-list {
  list-style: none;
  padding: 0;
}

.attachment-list li {
  margin-bottom: 6px;
}

.contacts-table button {
  background: #e74c3c;
  border: none;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.contacts-table button:hover {
  background: #c0392b;
}

.settings-container {
  margin-left: 260px;
  padding: 20px;
}

.settings-container h2 {
    margin-bottom: 20px;
    font-size: 22px;
}

.settings-form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 500;
}

.settings-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 15px;
}

.settings-form button {
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.settings-form button:hover {
    background: #43a047;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.col-total { font-size: 13px; color: #666; margin-bottom: 8px; font-weight: 600; }
.card-budget { display: block; color: #2e7d32; font-weight: 600; font-size: 13px; margin-top: 3px; }
.kanban-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; padding: 12px; background: #f8f9fa; border-radius: 8px; }
.kanban-filters select, .kanban-filters input { padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.kanban-filters .btn-filter { padding: 6px 14px; background: #4a90e2; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.kanban-filters .btn-reset { font-size: 13px; color: #666; text-decoration: none; }
.send-email-section textarea, .send-email-section input[type=text] { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; margin-bottom: 8px; }
#send-email-result { margin-top: 8px; font-size: 14px; }
.send-email-section { margin-top: 16px; }
.card-date-row { display:flex; justify-content:space-between; align-items:center; margin-top:5px; }
.card-date { font-size:11px; color:#888; }
.card-age  { font-size:11px; color:#aaa; background:#f0f0f0; border-radius:8px; padding:1px 6px; }
.card-source { display:inline-block; font-size:10px; color:#fff; background:#6c757d; border-radius:8px; padding:1px 7px; margin-top:3px; }
.card-source[data-src="facebook"],.card-source[data-src="instagram"] { background:#1877f2; }
.card-source[data-src="tiktok"] { background:#010101; }
.card-source[data-src="google"] { background:#ea4335; }
.card-source[data-src="email"] { background:#34a853; }
.utm-section summary { cursor:pointer; font-weight:600; font-size:14px; color:#444; padding:4px 0; }
.utm-section { border:1px solid #e8eaf0; border-radius:8px; padding:10px 14px; margin-bottom:12px; }
