/* =====================================================
   CRMS Modern Theme - mAINcss.css  v2.0
   Color Palette:
     Primary Green  : #166534
     Mid Green      : #16a34a
     Accent Gold    : #ca8a04
     Light Green bg : #f0fdf4
     Surface        : #ffffff
     Border         : #d1fae5
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #f0fdf4;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #1c2b20;
}

/* ===== TAB CONTROL (AJAX Control Toolkit) ===== */
.my_ajax__tab_xp .ajax__tab_header {
    font-family: 'Inter', verdana, sans-serif;
    font-size: 14px;
    background-color: #f0fdf4;
}
.Parent_Tabs .ajax__tab_body {
    border: 1px solid #a7f3d0;
    border-top: 0;
    background-color: #ffffff;
}
.Tab .ajax__tab_header {
    color: #166534;
    font-family: 'Inter', Calibri, sans-serif;
    font-size: 13px;
    font-weight: 600;
    background-color: #f0fdf4;
    margin-left: 0;
}
.Tab .ajax__tab_body       { border: 1px solid #a7f3d0; padding-top: 0; background: #ffffff; }
.Tab .ajax__tab_active .ajax__tab_tab   { color: #ffffff; background: linear-gradient(135deg,#14532d,#16a34a); height: 24px; border-radius: 6px 6px 0 0; }
.Tab .ajax__tab_active .ajax__tab_inner { color: #ffffff; padding-left: 12px; }
.Tab .ajax__tab_active .ajax__tab_outer { color: #ffffff; padding-right: 8px; }
.Tab .ajax__tab_hover .ajax__tab_tab    { color: #14532d; background: #d1fae5; height: 24px; border-radius: 6px 6px 0 0; }
.Tab .ajax__tab_hover .ajax__tab_inner  { color: #14532d; padding-left: 12px; }
.Tab .ajax__tab_hover .ajax__tab_outer  { color: #14532d; padding-right: 8px; }
.Tab .ajax__tab_tab   { color: #4a6550; background: #ecfdf5; height: 24px; border-radius: 6px 6px 0 0; }
.Tab .ajax__tab_inner { color: #4a6550; padding-left: 12px; }
.Tab .ajax__tab_outer { color: #4a6550; padding-right: 8px; margin-right: 3px; }

/* ===== COMBOBOX (AJAX Control Toolkit) ===== */
.WindowsStyle .ajax__combobox_inputcontainer .ajax__combobox_textboxcontainer input {
    margin: 0; border: 1px solid #a7f3d0 !important; border-right: 0 none;
    padding: 2px 0 0 5px; height: 22px; font-size: 12px; border-radius: 4px 0 0 4px;
}
.WindowsStyle .ajax__combobox_inputcontainer .ajax__combobox_buttoncontainer button {
    margin: 0; padding: 0; background-position: top left;
    border: 1px solid #a7f3d0; height: 24px; width: 24px;
    border-radius: 0 4px 4px 0; background-color: #d1fae5;
}
.WindowsStyle .ajax__combobox_itemlist {
    border-color: #a7f3d0; border-style: solid; font-size: 12px;
    border-radius: 0 0 6px 6px; box-shadow: 0 4px 14px rgba(0,0,0,.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .LeftLableColumns, .LeftTextColumns,
    .RightLableColumns, .RightTextColumns, .MidColumns {
        display: block; width: 100%;
    }
    .wrapper { padding: 0 4px; }
}

/* ===== INPUT BUTTONS (ASP.NET server controls) ===== */
input[type="submit"], input[type="button"], button {
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    img { opacity: .75; transition: opacity .5s ease-in-out; }
    img:hover { opacity: 1; }
}

/* ===== UTILITIES ===== */
.marginleft  { margin-left: 12px; }
.span1       { color: #374151; font-weight: 500; }
.span2       { color: #166534; font-weight: 700; }

.linkbutton {
    color: #166534;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}
.linkbutton:hover { color: #ca8a04; text-decoration: none; }

.FooterLink  { font-size: 11px; color: #6b7280; }
.FooterLabel { color: #16a34a; font-size: 13px; font-weight: 600; }

.wrapper     { margin: 0 auto; text-align: left; }
.style6      { }
.style0      { width: 0%; }
.style100    { width: 100%; }
.style80     { width: 80%; }
.style20     { width: 20%; }
.StlJustyfy  { text-align: justify; vertical-align: top; }
.tstyle      { border: 1px solid #d1fae5; }

.tblstyle    { background-color: #166534; }

/* ===== FORM LAYOUT CELLS ===== */
.LeftLableColumns {
    width: 17%;
    background: linear-gradient(90deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    height: 28px;
    vertical-align: middle;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
    white-space: nowrap;
}

.LeftLableColumnsForMenu {
    width: 15%;
    background: linear-gradient(90deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    height: 28px;
    vertical-align: middle;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
}

.LeftLableColumnsExtra {
    width: 17%;
    background: linear-gradient(90deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    height: 22px;
    vertical-align: middle;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    color: #065f46;
}

.RightLableColumns {
    width: 17%;
    background: linear-gradient(90deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    vertical-align: middle;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
    white-space: nowrap;
}

.RightTextColumns {
    width: 33%;
    background-color: #ffffff;
    border: 1px solid #d1fae5;
    height: 28px;
    vertical-align: middle;
    padding: 0 6px;
}

.LeftTextColumns {
    width: 33%;
    background-color: #ffffff;
    border: 1px solid #d1fae5;
    height: 28px;
    vertical-align: middle;
    padding: 0 6px;
}

.LeftTextColumnsForMenu {
    width: 35%;
    background-color: #ffffff;
    border: 1px solid #d1fae5;
    height: 28px;
    vertical-align: middle;
    padding: 0 6px;
}

.MidColumns {
    width: 0%;
    background-color: #f9fafb;
    height: 28px;
    vertical-align: middle;
}

/* ===== DATA GRID ===== */
mydatagrid, .mydatagrid {
    width: 100%;
    border: 1px solid #d1fae5;
    min-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border-spacing: 0;
}

.header {
    background: linear-gradient(90deg, #14532d, #166534);
    font-family: 'Inter', Arial, sans-serif;
    color: #ffffff;
    height: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 0 8px;
}

.rows {
    background-color: #ffffff;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 13px;
    color: #1f2937;
    min-height: 26px;
    text-align: left;
    transition: background-color .15s;
}
.rows:hover {
    background-color: #dcfce7;
    color: #14532d;
}

.mydatagrid a {
    background-color: transparent;
    padding: 4px 8px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: background .15s;
}
.mydatagrid a:hover {
    background-color: rgba(255,255,255,0.25);
    color: #ffffff;
}
.mydatagrid span {
    padding: 4px 8px;
    background-color: #ca8a04;
    color: #ffffff;
    border-radius: 4px;
    font-weight: 600;
}

.pager {
    background: linear-gradient(90deg, #166534, #16a34a);
    font-family: 'Inter', Arial, sans-serif;
    color: #ffffff;
    height: 32px;
    text-align: left;
    padding: 0 8px;
}

.mydatagrid td { padding: 5px 8px; border-bottom: 1px solid #f0fdf4; }
.mydatagrid th { padding: 6px 8px; }

/* ===== BUTTONS ===== */
.Button {
    background: linear-gradient(135deg, #166534, #16a34a);
    color: #ffffff;
    padding: 8px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 6px rgba(22,101,52,.35);
}
.Button:hover {
    background: linear-gradient(135deg, #14532d, #15803d);
    box-shadow: 0 4px 12px rgba(22,101,52,.45);
    transform: translateY(-1px);
}

/* ===== MISC ===== */
.modalBackground {
    background-color: rgba(0,0,0,0.55);
    filter: alpha(opacity=55);
    opacity: 0.55;
}

.popupMenu {
    position: absolute;
    visibility: hidden;
    background-color: #ffffff;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 4px 0;
    z-index: 9999;
}

.popupHover { background-color: #ecfdf5; }

.dragHandle {
    width: 6px;
    height: 12px;
    background: linear-gradient(180deg, #16a34a, #166534);
    cursor: move;
    border-radius: 2px;
}

.label {
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
    display: block;
}

.alternate    { border: 1px solid #d1fae5; width: 100%; text-align: left; }
.nonalternate { border: 1px solid #d1fae5; width: 100%; }

/* ===== INPUT CONTROLS GLOBAL REFRESH ===== */
input[type="text"], input[type="password"], select, textarea {
    border: 1px solid #a7f3d0 !important;
    border-radius: 4px !important;
    padding: 3px 6px !important;
    font-size: 13px !important;
    font-family: 'Inter', Arial, sans-serif !important;
    color: #1f2937 !important;
    background: #ffffff !important;
    transition: border-color .2s, box-shadow .2s !important;
    outline: none !important;
}
input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22,163,74,.15) !important;
}

/* Stripe alternate grid rows */
.mydatagrid tr:nth-child(even) td { background-color: #f0fdf4; }
.mydatagrid tr:nth-child(even):hover td { background-color: #dcfce7; }

/* =================================================================
   CARD LAYOUT — applies to ALL .aspx form pages automatically
   Every <table class="alternate"> becomes a floating white card
   with a sugarcane-green header strip, shadow, and hover rows.
================================================================= */

/* ── Card Container ── */
table.alternate {
    background: #ffffff !important;
    border: none !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 28px rgba(13,59,6,0.12), 0 1px 4px rgba(0,0,0,0.06) !important;
    margin: 12px 10px !important;
    overflow: hidden !important;
    width: calc(100% - 20px) !important;
}

/* ── Card Header (first row — page title) ── */
table.alternate tr:first-child td {
    background: linear-gradient(
        135deg,
        #0d3b06 0%,
        #14532d 40%,
        #1a6b3a 80%,
        #16a34a 100%
    ) !important;
    border: none !important;
    padding: 11px 18px !important;
    height: 44px !important;
    border-bottom: 3px solid #ca8a04 !important;
}
/* All children inside the header row (Label, span, etc.) */
table.alternate tr:first-child td *,
table.alternate tr:first-child td span,
table.alternate tr:first-child td label {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    font-family: 'Inter', Arial, sans-serif !important;
    letter-spacing: 0.6px !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25) !important;
}

/* ── Second row (thin accent bar — often empty spacer) ── */
table.alternate tr:nth-child(2) td.LeftLableColumnsExtra {
    background: linear-gradient(90deg, #fef9c3, #fef3c7) !important;
    border-top: none !important;
    border-bottom: 1px solid #fde68a !important;
    height: 5px !important;
    padding: 2px 0 !important;
}

/* ── Form rows: label cells ── */
table.alternate tr td.LeftLableColumns,
table.alternate tr td.RightLableColumns,
table.alternate tr td.LeftLableColumnsForMenu {
    background: linear-gradient(90deg, #ecfdf5, #d1fae5) !important;
    border: 1px solid #a7f3d0 !important;
    color: #0d3b06 !important;
    font-weight: 600 !important;
    font-family: 'Inter', Arial, sans-serif !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
    height: 30px !important;
    vertical-align: middle !important;
    white-space: nowrap;
}
/* ── Form rows: input cells ── */
table.alternate tr td.LeftTextColumns,
table.alternate tr td.RightTextColumns,
table.alternate tr td.LeftTextColumnsForMenu {
    background: #ffffff !important;
    border: 1px solid #d1fae5 !important;
    padding: 4px 8px !important;
    height: 30px !important;
    vertical-align: middle !important;
}
/* ── Mid spacer ── */
table.alternate tr td.MidColumns {
    background: #f8fffe !important;
    border: none !important;
    width: 6px !important;
}

/* ── Row hover (entire row) ── */
table.alternate tr:hover td.LeftLableColumns,
table.alternate tr:hover td.RightLableColumns {
    background: linear-gradient(90deg, #d1fae5, #bbf7d0) !important;
}
table.alternate tr:hover td.LeftTextColumns,
table.alternate tr:hover td.RightTextColumns {
    background: #f0fdf4 !important;
}

/* ── Validator / error row cells ── */
table.alternate tr td.LeftTextColumns span[id*="Validator"],
table.alternate tr td.RightTextColumns span[id*="Validator"] {
    color: #dc2626 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}

/* ── Button area rows (cells that span columns and contain buttons) ── */
table.alternate tr td[colspan] input[type="submit"],
table.alternate tr td[colspan] input[type="button"] {
    margin: 3px 4px !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-family: 'Inter', Arial, sans-serif !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    cursor: pointer !important;
    transition: filter .18s, transform .12s !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18) !important;
}
table.alternate tr td[colspan] input[type="submit"]:hover,
table.alternate tr td[colspan] input[type="button"]:hover {
    filter: brightness(1.12) !important;
    transform: translateY(-1px) !important;
}

/* ── GridView inside card ── */
table.alternate tr td[colspan] .mydatagrid {
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(13,59,6,0.08) !important;
    margin: 4px 0 !important;
}

/* ── Ensure Panel doesn't clip the card ── */
div[id*="Panel"] { overflow: visible !important; }

/* =================================================================
   CONTENT AREA BACKGROUND
================================================================= */
/* Wrap area background — subtle cane-field texture */
#ContentPlaceHolder3_ContentPlaceHolder4,
#ContentPlaceHolder3_ContentPlaceHolder1 {
    background:
        radial-gradient(ellipse at 95% 5%, rgba(202,138,4,0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 5% 95%, rgba(22,163,74,0.07) 0%, transparent 40%),
        #f0fdf4;
    min-height: 200px;
}
