/* Centralized theme for CW-EDMS - Bootstrap 5 based
   Palette and component standards per design brief
*/
:root{
  --primary:#4F46E5;
  --secondary:#64748B;
  --success:#10B981;
  --warning:#F59E0B;
  --danger:#EF4444;
  --info:#06B6D4;
  --bg:#F8FAFC;
  --card-bg:#FFFFFF;
  --border:#E2E8F0;
  --text:#334155;
  --radius:12px;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');
html,body{height:100%;}
body {
  font-family: "Inter", "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size:14px;
}
/* Page titles */
.page-title{font-size:24px;font-weight:600;color:var(--text);margin:0;padding:0}
.section-title{font-size:18px;font-weight:600;color:var(--text);margin-bottom:12px}

/* Cards */
.card{background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 6px 18px rgba(15,23,42,0.03)}
.card .card-body{padding:1.25rem}
.card .card-header{background:transparent;border-bottom:none;padding:0}

/* Form controls */
.form-control, .form-select, .form-control:focus, .form-select:focus{height:42px;min-height:42px;border-radius:8px;border:1px solid var(--border);box-shadow:none}
.form-control:focus, .form-select:focus{outline:0;box-shadow:0 0 0 4px rgba(79,70,229,0.08);border-color:var(--primary)}
.form-label{font-weight:600;color:var(--text);}
.form-text.text-danger{margin-top:6px}

/* Buttons */
.btn{height:42px;border-radius:8px;padding-left:12px;padding-right:12px}
.btn i{margin-right:6px}
.btn-primary-custom{background:var(--primary);border:1px solid var(--primary);color:#fff}
.btn-primary-custom:hover{background:#4338ca;border-color:#4338ca}
.btn-secondary-custom{background:#fff;border:1px solid var(--border);color:var(--secondary)}
.btn-success-custom{background:var(--success);border:1px solid var(--success);color:#fff}
.btn-warning-custom{background:var(--warning);border:1px solid var(--warning);color:#fff}
.btn-danger-custom{background:var(--danger);border:1px solid var(--danger);color:#fff}
/* Outline variants */
.btn-outline-primary-custom{background:transparent;border:1px solid var(--primary);color:var(--primary)}
.btn-outline-primary-custom:hover{background:var(--primary);color:#fff}
.btn-outline-secondary-custom{background:transparent;border:1px solid var(--border);color:var(--secondary)}
.btn-outline-secondary-custom:hover{background:var(--border)}
.btn-icon{display:inline-flex;align-items:center;gap:0.5rem}

/* Ensure small buttons match standard height and alignment so icons and text align across pages */
.btn-sm{height:42px;padding-left:10px;padding-right:10px;border-radius:8px;font-size:14px}
.d-inline-flex.align-items-center{height:42px;align-items:center}
.d-inline-flex.align-items-center i, .btn-icon i{margin-right:8px;display:inline-block;vertical-align:middle}
.btn-icon{height:42px;padding-left:12px;padding-right:12px}

/* form-control-sm should keep consistent height */
.form-control-sm, .form-select-sm{height:42px;padding:.375rem .75rem}

/* Table header visual separation */
.table-custom thead th{background:var(--card-bg);font-weight:600;border-bottom:1px solid var(--border);padding:0.85rem}
.table-custom thead th:first-child{border-top-left-radius:8px}
.table-custom thead th:last-child{border-top-right-radius:8px}

/* Card header spacing */
.card-header{padding:.75rem 1.25rem;border-bottom:1px solid var(--border)}

/* Toolbar */
.page-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;padding-left:0;padding-right:0}
.page-header > div:first-child{flex:1 1 auto}
.page-header .actions{display:flex;gap:8px;flex:0 0 auto;justify-content:flex-end}

/* Ensure header aligns to container grid and buttons don't wrap into new rows */
.page-header .actions .btn{white-space:nowrap}

/* Ensure action buttons stay compact and do not expand to full width */
.page-header .actions .btn{width:auto !important;min-width:unset;display:inline-flex;align-items:center}
.page-header .actions .btn.btn-primary-custom{padding-left:14px;padding-right:14px;border-radius:10px;height:42px}

/* Reduce extra left/right spacing inside the main container for content cards */
.container {padding-left:1rem; padding-right:1rem}

/* Tables */
.table-custom{border-collapse:separate;border-spacing:0;width:100%}
.table-custom th{position:sticky;top:0;background:linear-gradient(180deg,#fff,#fff);z-index:1;border-bottom:1px solid var(--border)}
.table-custom thead th{background:var(--card-bg);font-weight:600}
.table-custom tbody tr:hover{background:rgba(79,70,229,0.03)}
.table-custom td, .table-custom th{vertical-align:middle;padding:0.75rem;border-bottom:1px solid transparent}
.table-responsive{overflow:auto}

/* Subtle attractive divider between rows: thin gradient line inset from edges */
.table-custom tbody tr:not(:last-child) {
  background-image: linear-gradient(90deg, rgba(79,70,229,0.12), rgba(79,70,229,0.02));
  background-repeat: no-repeat;
  background-position: left bottom;
  /* leave a small left/right inset so the line doesn't touch card edges */
  background-size: calc(100% - 2rem) 1px;
}

/* Slightly stronger divider on hover for better focus */
.table-custom tbody tr:not(:last-child):hover {
  background-image: linear-gradient(90deg, rgba(79,70,229,0.22), rgba(79,70,229,0.04));
}

/* Breadcrumbs */
.breadcrumb{background:transparent;padding:0;margin-bottom:0}

/* Utilities */
.required-star{color:var(--danger);margin-left:4px}
.small-muted{color:var(--secondary);font-size:13px}

/* Modals - keep consistent rounded corners */
.modal-content{border-radius:12px}

/* Responsive tweaks */
@media (max-width:576px){
  .page-header{flex-direction:column;align-items:stretch}
  .page-header .actions{justify-content:flex-start}
}
