:root {
    /* Theme Variables */
    --bg-color: #f0f2f5;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #888888;
    --accent-green: #ccff00;       
    --accent-green-hover: #b3e600;
    --active-nav-bg: #000000;
    --active-nav-text: #ffffff;
    --field-label-bg: #eef2f6;
    
    /* Dimensions & Spacing */
    --border-radius: 24px;
    --input-radius: 12px;
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --input-bg: #f8f9fa;

    /* NEW SHINY GOLD METAL SCHEME */
    --accent-gold-base: #D4AF37; /* Metallic Gold */
    --accent-gold-light: #F9E27E;
    --accent-gold-dark: #A67C00;
    
    /* The "Metal" Gradient */
    --gold-gradient: linear-gradient(
        135deg, 
        #a67c00 0%, 
        #bf953f 20%, 
        #fcf6ba 45%, 
        #b38728 55%, 
        #fbf5b7 75%, 
        #aa771c 100%
    );
    
    /* Gold Glow/Shadow */
    --gold-shadow: 0 4px 15px rgba(166, 124, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body { background-color: var(--bg-color); color: var(--text-primary); display: flex; height: 100vh; overflow: hidden; }

/* --- SIDEBAR --- */
.sidebar { width: 280px; background-color: var(--sidebar-bg); display: flex; flex-direction: column; padding: 25px; flex-shrink: 0; overflow-y: auto; z-index: 10; border-right: 1px solid #eee; }
.logo-area { display: flex; flex-direction: column; align-items: center; gap: 15px; margin-bottom: 40px; }
.logo-icon { font-size: 31px; color: var(--accent-gold-base); }
.nav-category { font-size: 12px; color: var(--text-secondary); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; padding: 16px 20px; margin-bottom: 12px; border-radius: 20px; cursor: pointer; transition: all 0.3s ease; color: #888; text-decoration: none; font-weight: 500; }
.nav-item i { margin-right: 15px; font-size: 18px; width: 20px; text-align: center; }
.nav-item:hover { background-color: #f5f5f5; color: #000; }
.nav-item.active {
    background: var(--gold-gradient) !important;
    background-size: 200% auto !important; /* For shimmer effect */
    color: #1a1100 !important; /* Dark brown text for readability */
    border: 1px solid rgba(166, 124, 0, 0.2) !important;
    box-shadow: var(--gold-shadow);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: 0.3s;
}

.nav-item.active:hover {
  background-position: right center !important; /* Moves the "highlight" */
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(166, 124, 0, 0.4);
}

.nav-item.active i {
    /* color: var(--accent-gold-base); */
}

/* --- MAIN CONTENT --- */
.main-content { flex: 1; padding: 30px 40px; overflow-y: auto; display: flex; flex-direction: column; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.page-title h1 { font-size: 28px; font-weight: 600; letter-spacing: -1px; color: #000; }

/* --- CARDS & FORMS --- */
.card { background: var(--card-bg); border-radius: var(--border-radius); padding: 30px; box-shadow: var(--shadow-soft); margin-bottom: 30px; border: 1px solid #fff; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid #f2f2f2; padding-bottom: 15px; }
.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; color: #444; }
.card-icon-box { width: 30px; height: 30px; background: var(--accent-gold-base); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #000; }

/* Updated Grid to 4 columns to fit Company Name nicely in the top row */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }

.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-left: 4px; text-transform: uppercase; }
.input-wrapper { position: relative; }
.input-field { width: 100%; padding: 12px 16px; border-radius: var(--input-radius); border: 1px solid transparent; background: var(--input-bg); color: var(--text-primary); font-size: 14px; font-weight: 500; outline: none; transition: 0.2s; }
.input-field:focus { background: #fff; border-color: #ddd; box-shadow: 0 0 0 4px rgba(0,0,0,0.03); }
.input-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #bbb; pointer-events: none; }

/* --- CATEGORY TAGS --- */
.category-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background: #fcfcfc;
    border: 1px solid #eee;
    border-radius: var(--input-radius);
    /* max-height: 150px; */
    overflow-y: auto;
}

.cat-tag {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.cat-tag:hover { border-color: #bbb; color: #333; }

.cat-tag.active {
    background: var(--accent-gold-base);
    border-color: var(--accent-gold-base);
    color: #000;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(204, 255, 0, 0.4);
}

.form-actions { display: flex; justify-content: flex-end; gap: 15px; margin-top: 20px; border-top: 1px solid #f2f2f2; padding-top: 20px; }
.btn { padding: 12px 28px; border-radius: 50px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; transition: 0.2s; }
/* --- Buttons --- */
.btn-primary {
    background: var(--gold-gradient) !important;
    background-size: 200% auto !important; /* For shimmer effect */
    color: #1a1100 !important; /* Dark brown text for readability */
    border: 1px solid rgba(166, 124, 0, 0.2) !important;
    box-shadow: var(--gold-shadow);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: 0.3s;
}

.btn-primary:hover {
    background-position: right center !important; /* Moves the "highlight" */
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(166, 124, 0, 0.4);
}
.btn-secondary { background: #fff; border: 1px solid #e0e0e0; color: var(--text-primary); }
.btn-secondary:hover { background: #f9f9f9; }

/* --- TABLE STYLES --- */
.table-container { width: 100%; }
table.dataTable { width: 100% !important; border-collapse: separate; border-spacing: 0; border-bottom: 1px solid #eee; }

table.dataTable thead th {
    text-align: left;
    padding: 15px 16px;
    color: #555;
    /* background: #f0f2f5; */
    border-bottom: 2px solid #dde1ee;
    font-weight: 600;
    font-size: 13px;
}

table.dataTable tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    vertical-align: middle;
}

.header-action-btn {
    background: #000;
    color: var(--accent-gold-base);
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
    transition: 0.2s;
}
.header-action-btn:hover { background: #333; }

/* Expand Button */
td.dt-control { text-align: center; cursor: pointer; width: 30px; }
td.dt-control:before { content: '\f067'; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #ccc; display: inline-block; }
tr.shown td.dt-control:before { content: '\f068'; color: var(--accent-gold-light); }

/* Child Row Styles */
tr.detail-row-container { background: #f9fafb !important; }
tr.detail-row-container td { padding: 20px !important; background: #f9fafb !important; border-bottom: 1px solid #eee; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; max-width: 800px; }
.detail-item { display: flex; align-items: stretch; border-radius: 8px; overflow: hidden; border: 1px solid #eee; background: #fff; }

.data-label {
    background: var(--field-label-bg);
    padding: 8px 12px;
    font-size: 13px;
    color: #555;
    font-weight: 600;
    display: flex;
    align-items: center;
    min-width: 120px;
    border-right: 1px solid #eee;
}

.data-value { padding: 8px 15px; font-size: 13px; display: flex; align-items: center; color: #000; flex: 1; }

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent-gold-base) !important;
    color: #000 !important;
    border: none !important;
}

  /* --- ADD ENTRY MODAL STYLES --- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content { background: #fff; width: 1000px; max-width: 95%; height: 90%; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.3s ease; }
.modal-header { padding: 20px 30px; background: #fff; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 30px; overflow-y: auto; flex: 1; background: #fafafa; }
.modal-footer { padding: 20px 30px; background: #fff; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 10px; }

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

/* Toggle Switch in Modal */
.type-toggle { display: flex; background: #f0f0f0; padding: 5px; border-radius: 50px; width: fit-content; margin-bottom: 20px; }
.type-btn { padding: 10px 30px; border-radius: 40px; border: none; background: transparent; cursor: pointer; font-weight: 600; color: #888; transition: 0.3s; }
.type-btn.active {
    background: var(--gold-gradient) !important;
    background-size: 200% auto !important; /* For shimmer effect */
    color: #1a1100 !important; /* Dark brown text for readability */
    border: 1px solid rgba(166, 124, 0, 0.2) !important;
    box-shadow: var(--gold-shadow);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: 0.3s;
}

.type-btn.active:hover {
    background-position: right center !important; /* Moves the "highlight" */
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(166, 124, 0, 0.4);
}

/* --- CONTACT CARD (Based on Screenshot) --- */
.contact-card {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 5px solid var(--accent-gold-base);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.contact-grid-media {
    display: grid;
    grid-template-columns: 2fr 3fr; /* Left details, Right categories/remarks */
    gap: 30px;
}

.contact-left, .contact-right { display: flex; flex-direction: column; gap: 10px; }

.row-group { display: flex; gap: 10px; align-items: center; }
.row-group .input-field { margin-bottom: 0; }

.delete-contact {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #ffe6e6;
    color: #d90000;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.delete-contact:hover { background: #ffd6d6; }

/* KOL Grid Specifics */
.kol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }

/* Timeslot Grid */
.timeslot-grid {
    display: grid;
    grid-template-columns: 100px repeat(3, 1fr);
    gap: 1px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}
.ts-header, .ts-cell { padding: 10px; background: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.ts-header { font-weight: 700; background: #f9f9f9; }
.ts-row-header { font-weight: 600; justify-content: flex-start; padding-left: 15px; }

.form-section-title { font-size: 14px; font-weight: 700; margin: 20px 0 10px 0; padding-bottom: 5px; border-bottom: 2px solid var(--accent-gold-base); display: inline-block;}

/* Match Select2 to your theme */
.select2-container--default .select2-selection--single {
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: var(--input-radius);
    height: 45px;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    font-weight: 500;
    padding-left: 16px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 43px;
}
.select2-dropdown {
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    z-index: 9999;
}

/* Push logout to bottom */
.logout-nav {
    margin-top: auto; /* Pushes to bottom of flex container */
    color: #ff4d4d !important; /* Red text for logout */
    border-top: 1px solid #f0f0f0;
    border-radius: 0;
    padding-top: 25px !important;
}

.logout-nav:hover {
    background-color: #fff5f5 !important;
    color: #d90000 !important;
}

/* Ensure the sidebar container can handle the push */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* --- CENTER BLOB (Login/Splash Core) --- */
.blob-center {
  background: 
    linear-gradient(26.62deg, rgba(204, 255, 0, 0.8) 20.64%, rgba(204, 255, 0, 0) 49.82%), 
    linear-gradient(56.79deg, rgba(0, 0, 0, 0.6) 33.79%, rgba(0, 0, 0, 0) 72.67%), 
    linear-gradient(301.08deg, rgba(204, 255, 0, 0.5) 20.42%, rgba(204, 255, 0, 0) 60.38%), 
    linear-gradient(141.57deg, rgba(163, 204, 0, 0.85) 19.08%, rgba(163, 204, 0, 0) 98.72%);
  
  border-radius: 14rem;
  background-blend-mode: screen, normal, normal, normal;
  filter: blur(40px); /* Increased blur for a softer glow */
  height: 100%;
  width: 100%;
  max-height: 400px;
  max-width: 400px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Using standard transform for better compatibility */
  z-index: -1;
  
  animation-duration: 10s;
  animation-name: beat;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

/* --- FLOATING BACKGROUND BLOBS --- */
.blob, .blob-md, .blob-lg {
  position: absolute;
  opacity: 0.35; /* Slightly lowered opacity so lime green isn't too harsh */
  aspect-ratio: 1/1;
  filter: blur(50px);
  z-index: -100;
  /* Gradient: Lime -> Dark Olive -> Deep Black */
  background: linear-gradient(
    47deg,
    var(--accent-gold-base) 0%,
    var(--accent-gold-light) 45%,
    var(--accent-gold-dark) 100%
  );
}

.blob {
  width: 400px;
  top: 10%;
  animation: animate 12s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite alternate forwards;
}

.blob-md {
  width: 600px;
  top: 60%;
  left: 70%;
  animation: animate-md 18s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite alternate forwards;
}

.blob-lg {
  width: 800px;
  top: -20%;
  left: 10%;
  animation: animate-lg 25s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite alternate forwards;
}

/* --- KEYFRAMES --- */

@keyframes animate {
  0% {
    translate: 0% 13%;
    border-radius: 60% 40% 30% 70% / 100% 85% 92% 74%;
  }
  50% {
    translate: 40% -25%;
    border-radius: 20% 71% 47% 70% / 81% 15% 22% 54%;
    rotate: 41deg;
    scale: 1.15;
  }
  100% {
    translate: -45% 39%;
    border-radius: 100% 75% 92% 74% / 60% 80% 30% 70%;
    rotate: -60deg;
    scale: 1.05;
  }
}

@keyframes animate-md {
  0% {
    translate: 35% 23%;
    border-radius: 60% 40% 30% 70% / 100% 85% 92% 74%;
  }
  50% {
    translate: 20% -15%;
    border-radius: 20% 71% 47% 70% / 81% 15% 22% 54%;
    rotate: 41deg;
    scale: 1.15;
  }
  100% {
    translate: -14% 24%;
    border-radius: 100% 75% 92% 74% / 60% 80% 30% 70%;
    rotate: -60deg;
    scale: 0.75;
  }
}


@keyframes animate-lg {
  0% {
    translate: 35% 13%;
    border-radius: 60% 40% 30% 70% / 100% 85% 92% 74%;
  }
  50% {
    translate: -25% 50%;
    border-radius: 20% 71% 47% 70% / 81% 15% 22% 54%;
    rotate: 41deg;
    scale: 1.25;
  }
  100% {
    translate: -45% 39%;
    border-radius: 100% 75% 92% 74% / 60% 80% 30% 70%;
    rotate: -60deg;
    scale: 1.15;
  }
}

.footer-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* 1. Length selector (Bottom Left) */
.dataTables_length {
    flex: 1;
    text-align: left;
}

/* 2. Table Info (Bottom Center) */
.dataTables_info {
    flex: 1;
    text-align: center;
    padding-top: 0 !important; /* DataTables sometimes adds top padding */
}

/* 3. Pagination (Bottom Right) */
.dataTables_paginate {
    flex: 1;
    text-align: right;
}