/* Modern UI Enhancements & Layout for AccOffice / Master Contacts Directory */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.1);
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #6366f1;
  --sidebar-active-bg: rgba(99, 102, 241, 0.15);
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
  background-color: var(--bg-main) !important;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Application Layout Wrapper */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.app-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: transform 0.3s ease-in-out;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
}

.sidebar-brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  margin: 0;
}

.sidebar-nav {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav-item {
  margin-bottom: 4px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sidebar-nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-nav-link:hover {
  color: #ffffff;
  background-color: var(--sidebar-hover);
}

.sidebar-nav-link.active {
  color: #ffffff;
  background-color: var(--sidebar-active);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--sidebar-text);
}

/* Sidebar Mobile Backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1030;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* Main Content Area */
.app-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s ease;
}

/* Top Header Bar */
.top-header {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-main);
  transition: all 0.2s;
}

.hamburger-btn:hover {
  background-color: #f1f5f9;
  color: var(--primary);
}

.header-date {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e0e7ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* Main Container Body */
.main-body {
  padding: 28px;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* Custom Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155 !important;
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: #0f172a !important;
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff !important;
}

.btn-danger:hover {
  background-color: #dc2626;
}

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

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* Card Component */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
}

/* Search & Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.search-box {
  flex: 1;
  min-width: 260px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus, .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-main);
  background-color: #fff;
  outline: none;
}

/* Table Styling */
.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

thead th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s;
}

tbody tr:hover {
  background-color: #f8fafc;
}

tbody td {
  padding: 14px 18px;
  vertical-align: middle;
  color: var(--text-main);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #059669 !important;
}

.badge-info, .badge-refunded {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #d97706 !important;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
}




/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.pagination-links {
  display: flex;
  gap: 6px;
}

.pagination-link {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.pagination-link:hover, .pagination-link.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
  overflow-y: auto;
}

.modal-backdrop.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}

.modal-content form,
.modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 16px 24px;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  margin-top: auto;
}

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

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-message {
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s forwards;
}

.toast-message.success {
  border-left: 4px solid #10b981;
}

.toast-message.danger {
  border-left: 4px solid #ef4444;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile Responsive Breakpoints */
@media (max-width: 991px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.show-mobile {
    transform: translateX(0);
  }

  .app-content {
    margin-left: 0;
  }

  .hamburger-btn {
    display: inline-flex;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .main-body {
    padding: 16px;
  }

  .top-header {
    padding: 0 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header .btn {
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar div[style*="display: flex"] {
    width: 100%;
    flex-direction: column;
  }

  .filter-bar select {
    width: 100% !important;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-content {
    max-height: calc(100dvh - 20px);
    border-radius: 12px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 13.5px;
    text-align: center;
    justify-content: center;
  }
}

/* Remarks Timeline Styling */
.remarks-timeline-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.timeline-header {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-list {
  position: relative;
  padding-left: 20px;
  border-left: 2px dashed #cbd5e1;
  margin: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  margin-bottom: 14px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.timeline-date-badge {
  font-size: 11px;
  font-weight: 700;
  color: #4f46e5;
  background-color: rgba(99, 102, 241, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.timeline-text {
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}


