/* Custom site styles for admin pages */

/* give DataTables wrapper some inner spacing when inside a card-body */
.card .card-body.table-responsive .dataTables_wrapper {
  padding: 12px 14px;
}

/* Ensure owners table wrapper has padding even when parent uses `p-0` */
#ownersTable_wrapper {
  padding: 10px 14px !important;
}

/* Fallback stronger rule for any DataTables wrapper inside a card to override utility classes */
.card .card-body.table-responsive > .dataTables_wrapper,
.card .card-body.table-responsive .dataTables_wrapper {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* small helper for rounded action buttons */
.btn-sm { border-radius: 6px; }

/* badge color tweaks */
.badge-danger { background-color: #dc3545; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-secondary { background-color: #6c757d; }

/* center table headers for users table */
#usersTable thead th {
  text-align: center;
  vertical-align: middle;
}

/* header background styling (medium-dark variant) */
#usersTable thead th {
  /* Bootstrap Primary gradient (match owners table) */
  background: linear-gradient(180deg,#42a5f5 0%,#007bff 100%);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-top: 12px;
  padding-bottom: 12px;
  letter-spacing: 0.2px;
}

/* hover: subtle brighten */
#usersTable thead th:hover { background: linear-gradient(180deg,#4db1ff 0%,#0a66d1 100%); }

/* vertical column borders for users table */
#usersTable {
  border-collapse: collapse;
  border: 1px solid #e9ecef;
}

#usersTable thead th,
#usersTable tbody td {
  border-left: 1px solid #e9ecef;
}

#usersTable thead th:first-child,
#usersTable tbody td:first-child {
  border-left: none;
}

#usersTable thead th:last-child,
#usersTable tbody td:last-child {
  border-right: 1px solid #e9ecef;
}

/* vertical column borders for owners table (match users table style) */
#ownersTable {
  border-collapse: collapse;
  border: 1px solid #e9ecef;
}

#ownersTable thead th,
#ownersTable tbody td {
  border-left: 1px solid #e9ecef;
}

#ownersTable thead th:first-child,
#ownersTable tbody td:first-child {
  border-left: none;
}

#ownersTable thead th:last-child,
#ownersTable tbody td:last-child {
  border-right: 1px solid #e9ecef;
}

/* center specific columns: role (5), status (6), actions (8) */
#usersTable tbody td:nth-child(1),
#usersTable tbody td:nth-child(5),
#usersTable tbody td:nth-child(6),
#usersTable tbody td:nth-child(8) {
  text-align: center;
  vertical-align: middle;
}

/* override any inner right-alignment for the actions column */
#usersTable tbody td:nth-child(8) .text-right {
  text-align: center !important;
}

/* Make owners table header and column alignment match users table */
#ownersTable thead th {
  /* Bootstrap Primary gradient */
  background: linear-gradient(180deg,#42a5f5 0%,#007bff 100%);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-top: 12px;
  padding-bottom: 12px;
  letter-spacing: 0.2px;
  text-align: center;
  vertical-align: middle;
}

#ownersTable thead th:hover { background: linear-gradient(180deg,#4db1ff 0%,#0a66d1 100%); }

/* center specific columns for owners: index (1), type (3), actions (8) */
#ownersTable tbody td:nth-child(1),
#ownersTable tbody td:nth-child(3),
#ownersTable tbody td:nth-child(8) {
  text-align: center;
  vertical-align: middle;
}

#ownersTable tbody td:nth-child(8) .text-right {
  text-align: center !important;
}

/* owner documents table: match users/owners table visual style */
#ownerDocsTablePage {
  border-collapse: collapse;
  border: 1px solid #e9ecef;
}

/* Notifications table styling: match owners/users table visual style */
#notificationsTable {
  border-collapse: collapse;
  border: 1px solid #e9ecef;
}

#notificationsTable thead th,
#notificationsTable tbody td {
  border-left: 1px solid #e9ecef;
}

#notificationsTable thead th:first-child,
#notificationsTable tbody td:first-child {
  border-left: none;
}

#notificationsTable thead th:last-child,
#notificationsTable tbody td:last-child {
  border-right: 1px solid #e9ecef;
}

#notificationsTable thead th {
  /* Bootstrap Primary gradient */
  background: linear-gradient(180deg,#42a5f5 0%,#007bff 100%);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-top: 12px;
  padding-bottom: 12px;
  letter-spacing: 0.2px;
  text-align: center;
  vertical-align: middle;
}

#notificationsTable thead th:hover { background: linear-gradient(180deg,#4db1ff 0%,#0a66d1 100%); }

/* center commonly used columns (index and actions) */
#notificationsTable tbody td:nth-child(1),
#notificationsTable tbody td:nth-child(10) {
  text-align: center;
  vertical-align: middle;
}

#ownerDocsTablePage thead th,
#ownerDocsTablePage tbody td {
  border-left: 1px solid #e9ecef;
}

#ownerDocsTablePage thead th:first-child,
#ownerDocsTablePage tbody td:first-child {
  border-left: none;
}

#ownerDocsTablePage thead th:last-child,
#ownerDocsTablePage tbody td:last-child {
  border-right: 1px solid #e9ecef;
}

#ownerDocsTablePage thead th {
  background: linear-gradient(180deg,#42a5f5 0%,#007bff 100%);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-top: 12px;
  padding-bottom: 12px;
  letter-spacing: 0.2px;
  text-align: center;
  vertical-align: middle;
}

#ownerDocsTablePage thead th:hover { background: linear-gradient(180deg,#4db1ff 0%,#0a66d1 100%); }

/* center specific columns: index (1), view (5), actions (7) */
#ownerDocsTablePage tbody td:nth-child(1),
#ownerDocsTablePage tbody td:nth-child(5),
#ownerDocsTablePage tbody td:nth-child(7) {
  text-align: center;
  vertical-align: middle;
}

/* Document names table: match owners/users table visual style */
#docNamesTable {
  border-collapse: collapse;
  border: 1px solid #e9ecef;
}

#docNamesTable thead th,
#docNamesTable tbody td {
  border-left: 1px solid #e9ecef;
}

#docNamesTable thead th:first-child,
#docNamesTable tbody td:first-child {
  border-left: none;
}

#docNamesTable thead th:last-child,
#docNamesTable tbody td:last-child {
  border-right: 1px solid #e9ecef;
}

#docNamesTable thead th {
  background: linear-gradient(180deg,#42a5f5 0%,#007bff 100%);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-top: 12px;
  padding-bottom: 12px;
  letter-spacing: 0.2px;
  text-align: center;
  vertical-align: middle;
}

#docNamesTable thead th:hover { background: linear-gradient(180deg,#4db1ff 0%,#0a66d1 100%); }

/* center specific columns: index (1), status (4) and actions (6) */
#docNamesTable tbody td:nth-child(1),
#docNamesTable tbody td:nth-child(4),
#docNamesTable tbody td:nth-child(6) {
  text-align: center;
  vertical-align: middle;
}

/* Document categories table: match owners/users table visual style */
#docCatTable {
  border-collapse: collapse;
  border: 1px solid #e9ecef;
}

#docCatTable thead th,
#docCatTable tbody td {
  border-left: 1px solid #e9ecef;
}

#docCatTable thead th:first-child,
#docCatTable tbody td:first-child {
  border-left: none;
}

#docCatTable thead th:last-child,
#docCatTable tbody td:last-child {
  border-right: 1px solid #e9ecef;
}

#docCatTable thead th {
  background: linear-gradient(180deg,#42a5f5 0%,#007bff 100%);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-top: 12px;
  padding-bottom: 12px;
  letter-spacing: 0.2px;
  text-align: center;
  vertical-align: middle;
}

#docCatTable thead th:hover { background: linear-gradient(180deg,#4db1ff 0%,#0a66d1 100%); }

/* center specific columns: index (1), status (4) and actions (6) */
#docCatTable tbody td:nth-child(1),
#docCatTable tbody td:nth-child(4),
#docCatTable tbody td:nth-child(6) {
  text-align: center;
  vertical-align: middle;
}

/* Owner notifications table: match owners/users table visual style */
#ownerNotificationsTable {
  border-collapse: collapse;
  border: 1px solid #e9ecef;
}

#ownerNotificationsTable thead th,
#ownerNotificationsTable tbody td {
  border-left: 1px solid #e9ecef;
}

#ownerNotificationsTable thead th:first-child,
#ownerNotificationsTable tbody td:first-child {
  border-left: none;
}

#ownerNotificationsTable thead th:last-child,
#ownerNotificationsTable tbody td:last-child {
  border-right: 1px solid #e9ecef;
}

#ownerNotificationsTable thead th {
  background: linear-gradient(180deg,#42a5f5 0%,#007bff 100%);
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-top: 12px;
  padding-bottom: 12px;
  letter-spacing: 0.2px;
  text-align: center;
  vertical-align: middle;
}

#ownerNotificationsTable thead th:hover { background: linear-gradient(180deg,#4db1ff 0%,#0a66d1 100%); }

/* center commonly used columns (index and actions) */
#ownerNotificationsTable tbody td:nth-child(1),
#ownerNotificationsTable tbody td:nth-child(10) {
  text-align: center;
  vertical-align: middle;
}

/* center attachments column */
#ownerNotificationsTable tbody td:nth-child(7) {
  text-align: center;
  vertical-align: middle;
}


/* Modal form tweaks */
.modal-dialog.modal-lg { max-width: 1100px; }
.modal-dialog { width: 100%; }
.modal .form-group label { font-weight: 600; }
.modal .modal-body { padding: 1.5rem; }
.modal .modal-body .text-muted { margin-top: 0; margin-bottom: .5rem; }
.modal .form-row .form-group { margin-bottom: .75rem; }
