@font-face {
  font-family: 'Correspond';
  src: url('/fonts/font-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Correspond';
  src: url('/fonts/font-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Correspond';
  src: url('/fonts/font-italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

:root {
  --tg-blue: #0088cc;
  --tg-blue-dark: #0077b3;
  --border: #e0e0e0;
  --bg: #f5f5f5;
  --text: #333;
  --text-muted: #999;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Correspond', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 100vw;
  margin: 0 auto;
}

.logo {
    color: white;
    font-size: 2rem;
    letter-spacing: -2.5px;
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-logout {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.btn-logout:hover {
  background: var(--border);
}

/* Login Page */
.login-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--tg-blue);
}

.login-box {
    background: white;
    padding: 23px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.login-box h1 {
  font-size: 32px;
  margin-bottom: 12px;
  font-weight: 700;
}

.login-box p {
  color: #666;
  margin-bottom: 32px;
  font-size: 16px;
}

.login-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
}

/* Main Content */
main {
  display: flex;
  height: calc(100vh - 64px);
}

.sidebar {
  width: 200px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 16px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  background: none;
  border: none;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.2s;
}

.nav-btn:hover {
  background: var(--bg);
}

.nav-btn.active {
  background: var(--tg-blue);
  color: white;
}

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.tab-content {
  display: none;
}

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

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.tab-header h2 {
  font-size: 24px;
  font-weight: 700;
}

/* Buttons */
.btn-primary {
  background: var(--tg-blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--tg-blue-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--border);
}

/* Cards */
.flows-list, .bots-list {
  display: grid;
  gap: 16px;
}

.flow-card, .bot-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.2s;
}

.flow-card:hover, .bot-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.flow-card-info h3, .bot-card-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
  font-weight: 700;
}

.flow-card-info p, .bot-card-info p {
  font-size: 13px;
  color: var(--text-muted);
}

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

.btn-edit, .btn-delete {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

.btn-edit {
  background: var(--tg-blue);
  color: white;
}

.btn-edit:hover {
  background: var(--tg-blue-dark);
}

.btn-delete {
  background: #e74c3c;
  color: white;
}

.btn-delete:hover {
  background: #c0392b;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
}

/* Input */
.input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
}

.input:focus {
  outline: none;
  border-color: var(--tg-blue);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  position: relative;
}

.modal-content h2 {
  margin-bottom: 16px;
  font-weight: 700;
}

.modal-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.close {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
}

.close:hover {
  color: var(--text);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Settings */
.settings-section {
  background: white;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.settings-section h3 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
}

.settings-section p {
  color: #666;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .login-box {
    padding: 32px 24px;
  }

  .header-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
