/* BV Contact Management System - Professional Corporate with Craft-Inspired Design */

/* ============================================
   GOOGLE FONTS IMPORT
   ============================================ */
@import url("https://fonts.googleapis.com/css2?family=Kumbh+Sans:wght@300;400;500;600;700;800&family=Open+Sans:wght@300;400;500;600;700&display=swap");

/* ============================================
   CSS VARIABLES - DESIGN TOKENS
   ============================================ */
:root {
  /* Professional Corporate Color Palette */
  --corporate-navy: #003262; /* Deep navy - headers, primary buttons */
  --corporate-blue: #4682b4; /* Steel blue - links, active states */
  --corporate-sky: #6699cc; /* Blue grey - lighter accents */
  --corporate-charcoal: #36454f; /* Charcoal blue - text, dark elements */

  /* Craft-Inspired Accent Colors */
  --craft-amber: #f59e0b; /* Warm amber - highlights */
  --craft-brown: #92400e; /* Deep brown - borders, accents */
  --craft-beige: #fef3c7; /* Soft beige - backgrounds */
  --craft-cream: #fefce8; /* Light cream - subtle fills */
  --craft-sand: #fef9e7; /* Sand - paper texture base */

  /* Neutral Grays */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Semantic Colors */
  --white: #ffffff;
  --black: #000000;
  --success: #16a34a;
  --warning: var(--craft-amber);
  --error: #dc2626;
  --info: var(--corporate-blue);

  /* Typography */
  --font-header:
    "Kumbh Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:
    "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.875rem; /* 14px */
  --text-base: 1rem; /* 16px */
  --text-lg: 1.125rem; /* 18px */
  --text-xl: 1.25rem; /* 20px */
  --text-2xl: 1.5rem; /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem; /* 36px */
  --text-5xl: 3rem; /* 48px */

  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Spacing Scale */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */

  /* Border Radius */
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.5rem; /* 8px */
  --radius-lg: 0.75rem; /* 12px */
  --radius-xl: 1rem; /* 16px */
  --radius-2xl: 1.25rem; /* 20px */
  --radius-3xl: 1.5rem; /* 24px */
  --radius-full: 9999px;

  /* Craft-Specific Effects */
  --stitch-border: 2px dashed var(--slate-300);
  --stitch-border-dark: 2px dashed var(--corporate-blue);
  --stitch-spacing: 4px;

  /* Shadows - Including Embossed Effects */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Embossed Shadows (Craft Effect) */
  --emboss-light:
    inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.05);
  --emboss-medium:
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  --emboss-raised:
    0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Paper Texture Background */
  --paper-texture:
    linear-gradient(90deg, rgba(0, 0, 0, 0.01) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.01) 1px, transparent 1px);
  --paper-texture-size: 20px 20px;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: 1.6;
  color: var(--slate-700);
  background: var(--craft-sand);
  background-image: var(--paper-texture);
  background-size: var(--paper-texture-size);
  min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-header);
  font-weight: var(--font-bold);
  line-height: 1.2;
  color: var(--corporate-navy);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-2xl);
}
h4 {
  font-size: var(--text-xl);
}
h5 {
  font-size: var(--text-lg);
}
h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--space-4);
  color: var(--slate-600);
}

a {
  color: var(--corporate-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--corporate-navy);
}

/* Stitched underline effect for links */
a.stitched-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--stitch-border-dark);
  transition: width var(--transition-normal);
}

a.stitched-link:hover::after {
  width: 100%;
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.main {
  padding: var(--space-8) 0;
  min-height: calc(100vh - 80px);
}

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */
.top-navbar {
  background: var(--white);
  border-bottom: var(--stitch-border);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.navbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  height: auto;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-2) 0;
}

/* Logo */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-header);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--corporate-navy);
  text-decoration: none;
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.navbar-brand:hover {
  background: var(--craft-cream);
  transform: translateY(-2px);
}

.navbar-logo-img {
  height: 45px;
  width: auto;
  border-radius: var(--radius-md);
  border: var(--stitch-border);
  padding: var(--space-1);
  background: var(--white);
  box-shadow: var(--emboss-light);
}

.navbar-logo-text {
  background: linear-gradient(
    135deg,
    var(--corporate-navy) 0%,
    var(--corporate-blue) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Desktop Navigation */
.navbar-nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-family: var(--font-header);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--slate-600);
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
  border: 2px solid transparent;
}

.nav-link i {
  font-size: var(--text-base);
  transition: transform var(--transition-fast);
}

.nav-link:hover {
  color: var(--corporate-blue);
  background: var(--craft-cream);
  border: var(--stitch-border);
  transform: translateY(-2px);
}

.nav-link:hover i {
  transform: scale(1.1);
}

.nav-link.active {
  color: var(--corporate-navy);
  background: var(--craft-beige);
  border: var(--stitch-border-dark);
  box-shadow: var(--emboss-light);
}

/* Right Section */
.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.navbar-user-info {
  font-family: var(--font-header);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--corporate-navy);
  padding: var(--space-2) var(--space-4);
  background: var(--craft-cream);
  border-radius: var(--radius-full);
  border: var(--stitch-border);
}

.navbar-logout {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--corporate-navy);
  color: var(--white);
  border-radius: var(--radius-lg);
  font-family: var(--font-header);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: all var(--transition-normal);
  border: 2px solid var(--corporate-navy);
}

.navbar-logout:hover {
  background: var(--corporate-blue);
  border-color: var(--corporate-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.mobile-menu-toggle:hover {
  background: var(--craft-cream);
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: var(--corporate-navy);
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

/* Mobile Navigation */
.mobile-nav-menu {
  display: none;
  flex-direction: row;
  padding: var(--space-3);
  border-top: var(--stitch-border);
  background: var(--white);
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-menu.active {
  display: flex;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  color: var(--slate-600);
  font-family: var(--font-header);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  white-space: nowrap;
  min-width: 80px;
}

.mobile-nav-link i {
  font-size: var(--text-lg);
}

.mobile-nav-link:hover {
  background: var(--craft-cream);
  color: var(--corporate-blue);
  border-color: var(--corporate-blue);
  border-style: dashed;
}

.mobile-nav-link.active {
  background: var(--craft-beige);
  color: var(--corporate-navy);
  border-color: var(--corporate-navy);
  border-style: dashed;
  font-weight: var(--font-bold);
}

.mobile-nav-link.logout {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}

.mobile-nav-link.logout:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.mobile-nav-divider {
  width: 1px;
  background: var(--stitch-border);
  margin: var(--space-2) 0;
  align-self: stretch;
}

/* Mobile User Info */
.mobile-user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--craft-cream);
  border-radius: var(--radius-lg);
  border: var(--stitch-border);
  font-family: var(--font-header);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--corporate-navy);
  white-space: nowrap;
}

.mobile-user-info i {
  font-size: var(--text-base);
  color: var(--corporate-blue);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--white);
  border: var(--stitch-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-6);
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--paper-texture);
  background-size: var(--paper-texture-size);
  opacity: 0.3;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--corporate-sky);
}

.card-header {
  padding: var(--space-6);
  background: linear-gradient(
    135deg,
    var(--craft-beige) 0%,
    var(--craft-cream) 100%
  );
  border-bottom: var(--stitch-border);
  box-shadow: var(--emboss-raised);
  position: relative;
  z-index: 1;
}

.card-title {
  font-family: var(--font-header);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--corporate-navy);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.card-title i {
  color: var(--corporate-blue);
  font-size: var(--text-xl);
}

.card-body {
  padding: var(--space-6);
  position: relative;
  z-index: 1;
}

.card-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-header);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--white);
  background: var(--corporate-blue);
  border: 2px solid var(--corporate-blue);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width var(--transition-normal),
    height var(--transition-normal);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  background: var(--corporate-navy);
  border-color: var(--corporate-navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-style: dashed;
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--emboss-medium);
}

.btn i {
  font-size: var(--text-lg);
  transition: transform var(--transition-fast);
}

.btn:hover i {
  transform: scale(1.1);
}

/* Button Variants */
.btn-primary {
  background: var(--corporate-navy);
  border-color: var(--corporate-navy);
}

.btn-primary:hover {
  background: var(--corporate-blue);
  border-color: var(--corporate-blue);
}

.btn-secondary {
  background: var(--slate-600);
  border-color: var(--slate-600);
  color: var(--white);
}

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

.btn-outline {
  background: transparent;
  color: var(--corporate-blue);
  border-color: var(--corporate-blue);
  border-style: dashed;
}

.btn-outline:hover {
  background: var(--corporate-blue);
  color: var(--white);
  border-style: solid;
}

.btn-danger {
  background: var(--error);
  border-color: var(--error);
}

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

.btn-success {
  background: var(--success);
  border-color: var(--success);
}

.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-header);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--corporate-navy);
  margin-bottom: var(--space-2);
}

.form-label i {
  color: var(--corporate-blue);
  font-size: var(--text-base);
}

.form-label .required {
  color: var(--error);
  margin-left: var(--space-1);
}

.form-control,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--slate-700);
  background: var(--white);
  border: 2px solid var(--slate-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--corporate-blue);
  border-style: dashed;
  box-shadow:
    0 0 0 3px rgba(70, 130, 180, 0.1),
    var(--emboss-light);
  background: var(--craft-cream);
}

.form-control::placeholder {
  color: var(--slate-400);
  font-style: italic;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234682b4' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

/* Form Validation States */
.form-control.is-valid,
.form-select.is-valid {
  border-color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2316a34a' d='M13.5 2.5L6 10l-3.5-3.5L1 8l5 5 9-9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--error);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23dc2626' d='M8 1l7 14H1L8 1z'/%3E%3Cpath fill='white' d='M8 11.5a1 1 0 100 2 1 1 0 000-2zM7 5v4h2V5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.invalid-feedback,
.valid-feedback {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.invalid-feedback {
  color: var(--error);
}

.valid-feedback {
  color: var(--success);
}

/* Checkbox and Radio */
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: var(--space-2);
  cursor: pointer;
  accent-color: var(--corporate-blue);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: var(--stitch-border);
}

.page-title {
  font-family: var(--font-header);
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  color: var(--corporate-navy);
  margin-bottom: var(--space-2);
  background: linear-gradient(
    135deg,
    var(--corporate-navy) 0%,
    var(--corporate-blue) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: var(--text-lg);
  color: var(--slate-600);
  font-weight: var(--font-normal);
  margin: 0;
}

/* ============================================
   TABLES
   ============================================ */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: var(--stitch-border);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
}

thead {
  background: linear-gradient(
    135deg,
    var(--craft-beige) 0%,
    var(--craft-cream) 100%
  );
  box-shadow: var(--emboss-raised);
}

th {
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-header);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--corporate-navy);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: var(--stitch-border);
}

td {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--slate-700);
  border-bottom: 1px dashed var(--slate-200);
}

tbody tr {
  transition: all var(--transition-fast);
}

tbody tr:hover {
  background: var(--craft-cream);
  box-shadow: inset 0 0 0 2px var(--corporate-sky);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
  border: var(--stitch-border);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

.alert i {
  font-size: var(--text-xl);
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  border-color: var(--success);
  color: #15803d;
}

.alert-success i {
  color: var(--success);
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--error);
  color: #991b1b;
}

.alert-error i {
  color: var(--error);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning);
  color: var(--craft-brown);
}

.alert-warning i {
  color: var(--warning);
}

.alert-info {
  background: rgba(70, 130, 180, 0.1);
  border-color: var(--info);
  color: var(--corporate-navy);
}

.alert-info i {
  color: var(--info);
}

/* ============================================
   MODALS
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-4);
}

.modal-content {
  background: var(--white);
  border: var(--stitch-border-dark);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-2xl);
  animation: modalSlideIn var(--transition-normal);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h3 {
  font-family: var(--font-header);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--corporate-navy);
  margin-bottom: var(--space-4);
}

.modal-content p {
  color: var(--slate-600);
  margin-bottom: var(--space-6);
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.pagination button,
.pagination a {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-header);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--corporate-blue);
  background: var(--white);
  border: 2px solid var(--slate-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.pagination button:hover,
.pagination a:hover {
  background: var(--craft-cream);
  border-color: var(--corporate-blue);
  border-style: dashed;
  transform: translateY(-2px);
}

.pagination button.active,
.pagination a.active {
  background: var(--corporate-blue);
  color: var(--white);
  border-color: var(--corporate-blue);
  box-shadow: var(--emboss-light);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px dashed var(--corporate-blue);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.text-center {
  text-align: center;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-6 {
  margin-bottom: var(--space-6);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}

.text-muted {
  color: var(--slate-500);
}

.text-primary {
  color: var(--corporate-blue);
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

/* Craft-specific utility classes */
/* ============================================
   PREMIUM UI COMPONENTS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.badge-info {
  background: rgba(70, 130, 180, 0.1);
  color: var(--corporate-blue);
  border-color: rgba(70, 130, 180, 0.2);
}

.badge-outline {
  background: transparent;
  color: var(--slate-500);
  border: 1px dashed var(--slate-300);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--corporate-blue);
  border: var(--stitch-border);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--craft-cream);
  border-color: var(--corporate-navy);
  color: var(--corporate-navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-icon-success {
  color: var(--success);
}

.btn-icon-success:hover {
  background: rgba(22, 163, 74, 0.1);
  border-color: var(--success);
  color: #15803d;
}

.btn-icon-danger {
  color: var(--error);
}

.btn-icon-danger:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--error);
  color: #991b1b;
}

.contact-row:hover {
  background: var(--craft-cream) !important;
}

.stitched-border {
  border: var(--stitch-border);
}

.stitched-border-dark {
  border: var(--stitch-border-dark);
}

.embossed {
  box-shadow: var(--emboss-raised);
}

.paper-bg {
  background: var(--craft-sand);
  background-image: var(--paper-texture);
  background-size: var(--paper-texture-size);
}

/* ============================================
   FORM SPECIFIC STYLES
   ============================================ */
/* Hide designation field for Government Official types - they have their own */
.hide-general-designation {
  display: none !important;
}

/* ============================================
   DASHBOARD FILTERS (Shared Styles)
   ============================================ */
/* Dashboard Filters styles are defined in dashboard.css */

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .navbar-nav-desktop {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .navbar-right {
    display: none;
  }

  .page-title {
    font-size: var(--text-3xl);
  }

  .card-header,
  .card-body {
    padding: var(--space-4);
  }

  .container {
    padding: 0 var(--space-4);
  }

  table {
    font-size: var(--text-sm);
  }

  th,
  td {
    padding: var(--space-3);
  }

  /* Dashboard filters responsive */
  .filters-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  .filter-actions {
    flex-direction: column;
    width: 100% !important;
  }

  .filter-btn-primary,
  .filter-btn-secondary,
  .filter-btn-outline {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: var(--text-2xl);
  }

  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
  }

  .modal-content {
    padding: var(--space-6);
  }

  .mobile-nav-menu {
    padding: var(--space-2);
  }

  .mobile-nav-link {
    min-width: 70px;
    padding: var(--space-2) var(--space-3);
  }

  .mobile-user-info {
    font-size: 0.7rem;
    padding: var(--space-2) var(--space-3);
  }
}

/* ============================================
  NAVIGATION DROPDOWN
  ============================================ */
.nav-dropdown {
  position: relative;
}

.dropdown-arrow {
  margin-left: var(--space-2);
  transition: transform var(--transition-fast);
}

.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--white);
  border: var(--stitch-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  z-index: 1000;
  margin-top: var(--space-2);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--slate-600);
  text-decoration: none;
  font-family: var(--font-header);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  margin: var(--space-1);
}

.dropdown-item:hover {
  background: var(--craft-cream);
  color: var(--corporate-blue);
  transform: translateX(4px);
}

.dropdown-item.active {
  background: var(--craft-beige);
  color: var(--corporate-navy);
  font-weight: var(--font-bold);
}

.dropdown-item i {
  font-size: var(--text-base);
  color: var(--corporate-blue);
}

/* Mobile Navigation Submenu */
.mobile-nav-group {
  position: relative;
}

.mobile-nav-submenu {
  display: none;
  flex-direction: column;
  margin-top: var(--space-2);
  padding-left: var(--space-4);
  border-left: 2px dashed var(--corporate-blue);
}

.mobile-nav-group.expanded .mobile-nav-submenu {
  display: flex;
}

.mobile-nav-sublink {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--slate-500);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-1);
}

.mobile-nav-sublink:hover {
  background: var(--craft-cream);
  color: var(--corporate-blue);
}

.mobile-nav-sublink.active {
  background: var(--craft-beige);
  color: var(--corporate-navy);
  font-weight: var(--font-semibold);
}

.mobile-nav-sublink i {
  font-size: var(--text-sm);
}

/* ============================================
   CUSTOM FIELDS STYLES
   ============================================ */
.custom-fields-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.custom-fields-section h3 {
  margin-bottom: 1rem;
  color: var(--corporate-navy);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.radio-item:hover,
.checkbox-item:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
  margin: 0;
  accent-color: var(--corporate-blue);
}

.radio-item label,
.checkbox-item label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
}

/* ============================================
   FORM GRID SYSTEM & UTILITIES
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
  width: 100%;
}

.grid-col-3 {
  grid-column: span 3;
}

.grid-col-6 {
  grid-column: span 6;
}

.grid-col-12 {
  grid-column: span 12;
}

/* Spacer utilities */
.form-spacer {
  display: block;
  height: var(--space-4);
}

@media (max-width: 900px) {
  .grid-col-3,
  .grid-col-6 {
    grid-column: span 6;
  }
}

@media (max-width: 600px) {
  .grid-col-3,
  .grid-col-6,
  .grid-col-12 {
    grid-column: span 12;
  }
}
.form-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  width: 100%;
}

.form-group.col-1 {
  grid-column: span 1;
}

.form-group.col-quarter {
  grid-column: span 1;
}

.form-group.col-full {
  grid-column: span 4;
}

.form-section-header.col-full {
  grid-column: span 4;
  margin-top: var(--space-6);
  padding-bottom: var(--space-2);
  border-bottom: var(--stitch-border);
  margin-bottom: var(--space-4);
}

.form-section-header h3 {
  margin: 0;
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--corporate-blue);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
}

@media (max-width: 1200px) {
  .form-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-group.col-full {
    grid-column: span 3;
  }
}

@media (max-width: 900px) {
  .form-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-group.col-full,
  .form-section-header.col-full {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .form-grid-container {
    grid-template-columns: 1fr;
  }
  .form-group.col-1,
  .form-group.col-quarter,
  .form-group.col-full,
  .form-section-header.col-full {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .custom-fields-section {
    padding: 1rem;
  }
}

/* ============================================
   COMPACT FORM UTILITIES
   ============================================ */
.compact-form .form-row {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 15px !important;
  margin-bottom: 15px !important;
}

.compact-form .form-group {
  margin-bottom: 0 !important;
  width: 100% !important;
}

.compact-form .form-control {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.875rem !important;
}

.compact-form label {
  font-size: 0.8rem !important;
  margin-bottom: 0.25rem !important;
}

@media (max-width: 1200px) {
  .compact-form .form-row {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 992px) {
  .compact-form .form-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 576px) {
  .compact-form .form-row {
    grid-template-columns: 1fr !important;
  }
}

/* =====================================================
   GLOBAL RESPONSIVE LAYER
   Applies to entire web app without breaking logic
   ===================================================== */

/* ---------- Reset & Safety ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ---------- Media Safety ---------- */
img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Layout Containers ---------- */
.container,
.wrapper,
.content,
.main,
.main-content,
.page-content,
.dashboard,
.section {
  width: 100%;
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Center wide layouts safely */
@media (min-width: 1400px) {
  .container,
  .wrapper {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- Flex & Grid Normalization ---------- */
.row,
.flex,
.pixel,
.flex-row,
.flex-container {
  display: flex;
  flex-wrap: wrap;
}

.col,
.column {
  flex: 1 1 auto;
}

/* ---------- Cards / Panels ---------- */
.card,
.panel,
.box,
.widget {
  max-width: 100%;
  overflow: hidden;
}

/* ---------- Tables (CRITICAL) ---------- */
table {
  width: 100%;
  border-collapse: collapse;
}

.table-responsive,
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 600px; /* keeps desktop layout intact */
}

/* ---------- Forms ---------- */
input,
select,
textarea,
button {
  max-width: 100%;
  font-family: inherit;
}

form {
  width: 100%;
}

/* ---------- Buttons ---------- */
button,
.btn {
  cursor: pointer;
}

/* =====================================================
   BREAKPOINTS
   ===================================================== */

/* ---------- Tablets & below ---------- */
@media (max-width: 992px) {
  .sidebar,
  .side-menu,
  .left-panel {
    width: 100%;
    position: relative;
  }

  .header,
  .top-bar {
    flex-wrap: wrap;
  }

  table {
    font-size: 0.95rem;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 1.4rem;
  }
  h2 {
    font-size: 1.2rem;
  }
  h3 {
    font-size: 1.1rem;
  }

  .row,
  .flex-row {
    flex-direction: column;
  }

  .card,
  .panel,
  .widget {
    margin-bottom: 1rem;
  }

  .btn,
  button {
    width: 100%;
  }

  table {
    font-size: 0.9rem;
  }
}

/* ---------- Small Mobile ---------- */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container,
  .wrapper,
  .content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  input,
  select,
  textarea,
  button {
    width: 100%;
  }

  table {
    min-width: 500px;
  }
}

/* ---------- Ultra Small Screens ---------- */
@media (max-width: 360px) {
  body {
    font-size: 13px;
  }
}

/* ---------- Custom Fixes for Overflow ---------- */
@media (max-width: 1200px) {
  .navbar-nav-desktop {
    gap: 0;
  }
  
  .nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
  
  .navbar-user-info {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
  }
}

@media (max-width: 1100px) {
  .navbar-main {
    justify-content: center;
    gap: var(--space-3);
  }
  
  .navbar-brand {
    width: 100%;
    justify-content: center;
    margin-bottom: var(--space-2);
  }
  
  .navbar-nav-desktop {
    width: 100%;
    justify-content: center;
  }
}

/* Ensure no element can force a width beyond the screen */
.container, .card, .dashboard-filters-card, .top-navbar {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
}

/* But allow tables to overflow their specific container */
.table-responsive {
    overflow-x: auto !important;
    width: 100% !important;
}

/* Global Overflow Safety */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

* {
    max-width: 100%;
}
