/* Mobile-First Responsive Design */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  padding-bottom: 20px;
}

/* Login Container */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 30px 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

/* Mobile Header */
.mobile-header {
  background: white;
  padding: 15px 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  gap: 10px;
}

.mobile-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  flex: 1;
  text-align: center;
  margin: 0;
}

.mobile-header .header-actions {
  min-width: 80px;
  display: flex;
  justify-content: flex-end;
}

/* Hamburger Button */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex !important;
  flex-direction: column;
  gap: 5px;
  z-index: 100;
  position: relative;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
}

.hamburger-btn span {
  display: block !important;
  width: 28px;
  height: 4px;
  background: #667eea !important;
  border-radius: 3px;
  transition: all 0.3s;
}

.hamburger-btn:hover span {
  background: #5568d3 !important;
}

.hamburger-btn:active {
  opacity: 0.7;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  z-index: 1002;
  transition: left 0.3s ease;
  overflow-y: auto;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.sidebar-close {
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-nav {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex !important;
  align-items: center;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 4px solid transparent;
  width: 100%;
  box-sizing: border-box;
}

.nav-item:hover {
  background: #f5f5f5;
  border-left-color: #667eea;
}

.nav-item.active {
  background: #e0e7ff;
  border-left-color: #667eea;
  color: #667eea;
  font-weight: 600;
}

.nav-icon {
  font-size: 24px;
  margin-right: 15px;
  width: 30px;
  text-align: center;
}

.nav-text {
  font-size: 16px;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Search Section */
.search-section {
  padding: 15px 20px;
  background: white;
  margin-bottom: 15px;
}

.search-input-group {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

/* Action Bar */
.action-bar {
  padding: 0 20px 15px;
}

/* Client List */
.client-list {
  padding: 0 20px;
}

.client-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.client-name {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.client-code {
  background: #e0e7ff;
  color: #667eea;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.client-info {
  margin-bottom: 15px;
}

.info-row {
  display: flex;
  padding: 8px 0;
  font-size: 14px;
}

.info-row .label {
  font-weight: 600;
  color: #666;
  min-width: 100px;
}

.info-row .value {
  color: #333;
  flex: 1;
  word-break: break-all;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.client-actions {
  display: flex;
  gap: 10px;
}

/* Forms */
.form-container {
  padding: 0 20px;
}

.mobile-form {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
}

.form-input:read-only {
  background-color: #f5f5f5;
  color: #666;
}

.form-actions {
  margin-top: 25px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.checkbox-label:hover {
  color: #333;
}

.checkbox-label span {
  user-select: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-block {
  display: block;
  width: 100%;
  margin-bottom: 10px;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-success {
  background: #48bb78;
  color: white;
}

.btn-success:hover {
  background: #38a169;
}

.btn-danger {
  background: #f56565;
  color: white;
}

.btn-danger:hover {
  background: #e53e3e;
}

.btn-outline {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-outline:hover {
  background: #f0f4ff;
}

.btn-sm {
  padding: 6px 9px;
  font-size: 12px;
}

/* Alerts */
.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-error {
  background: #fed7d7;
  color: #c53030;
  border: 1px solid #fc8181;
}

.alert-error h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.alert-error ul {
  margin-left: 20px;
  font-size: 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state p {
  font-size: 16px;
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 10px;
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
  .login-card {
    padding: 40px;
  }

  .client-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .mobile-header {
    padding: 20px 40px;
  }

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

  .search-section {
    padding: 20px 40px;
  }

  .action-bar {
    padding: 0 40px 20px;
  }

  .form-container {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .client-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Call Button */
.btn-call {
  display: inline-block;
  margin-left: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(72, 187, 120, 0.3);
  border: none;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.3px;
}

.btn-call:hover {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  box-shadow: 0 4px 10px rgba(72, 187, 120, 0.4);
  transform: translateY(-1px);
}

.btn-call:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(72, 187, 120, 0.3);
}

.btn-call-large {
  display: block;
  margin-top: 12px;
  margin-left: 0;
  padding: 14px 24px;
  font-size: 15px;
  text-align: center;
  width: 100%;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
  border: none;
  cursor: pointer;
}

.btn-call-large:hover {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
  transform: translateY(-2px);
}

.btn-call-large:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(72, 187, 120, 0.3);
}

/* Detail View */
.header-with-back {
  display: flex;
  align-items: center;
  gap: 15px;
}

.back-link {
  color: #667eea;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: color 0.3s;
}

.back-link:hover {
  color: #5568d3;
}

.detail-container {
  padding: 0 20px;
}

.detail-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid #667eea;
}

.detail-name {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  flex: 1;
  margin: 0;
}

.detail-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e7ff;
}

.detail-row {
  display: flex;
  flex-direction: column;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #666;
  font-size: 13px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  color: #333;
  font-size: 16px;
  word-break: break-all;
}

.detail-actions {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.detail-subsection {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.detail-subsection:first-child {
  margin-top: 10px;
}

.subsection-title {
  font-size: 14px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e7ff;
}

.detail-memo {
  color: #555;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  min-height: 60px;
}

.btn-email {
  display: block;
  margin-top: 12px;
  margin-left: 0;
  padding: 14px 24px;
  font-size: 15px;
  text-align: center;
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  border: none;
  cursor: pointer;
}

.btn-email:hover {
  background: linear-gradient(135deg, #5568d3 0%, #4c5fc7 100%);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.btn-email:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Pagination */
.pagination {
  padding: 10px 8px;
  background: white;
  border-radius: 12px;
  margin: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pagination-info {
  text-align: center;
  font-size: 10px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.pagination-controls .btn-outline.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-numbers {
  display: flex;
  gap: 2px;
  align-items: center;
}

.page-number {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #667eea;
  background: white;
  border: 1px solid #ddd;
  transition: all 0.3s;
  min-width: 26px;
  text-align: center;
}

.page-number:hover {
  background: #f0f4ff;
  border-color: #667eea;
}

.page-number.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  cursor: default;
}

/* Utility */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
