/* =====================================================================
   Agrisnet modern theme
   Loaded at the END of header_model.php so it applies to every public
   page and wins over the older inline header styles. Markup is unchanged.
   ===================================================================== */
:root {
    --g-900: #0b3a24;
    --g-800: #0f5132;
    --g-700: #146c43;
    --g-600: #198754;
    --g-100: #e6f4ec;
    --g-50:  #f3faf6;
    --ink:   #17241d;
    --ink-2: #44554c;
    --ink-3: #74867c;
    --line:  #dde8e1;
    --bg:    #f5f7f6;
    --gold:  #c9a227;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(16, 40, 28, .06);
    --shadow:    0 1px 2px rgba(16, 40, 28, .05), 0 10px 28px rgba(16, 40, 28, .08);
    --shadow-lg: 0 18px 40px rgba(16, 40, 28, .14);
}

/* ---------- base ---------- */
html body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Open Sans', 'Mukta Malar', 'Noto Sans Tamil', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
html body p { line-height: 1.7; }
html body a { color: var(--g-700); transition: color .15s ease; }
html body a:hover { color: var(--g-900); text-decoration: none; }
html body h1, html body h2, html body h3, html body h4, html body h5 { color: var(--ink); letter-spacing: -.005em; }
::selection { background: #cfeedd; }
html body :focus-visible { outline: 3px solid #f2c94c; outline-offset: 2px; }

/* ---------- top utility bar ---------- */
html body .header_info {
    background: var(--g-900);
    padding: 4px 0;
    font-size: 13px;
}
html body .header_info .social a {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff !important;
    margin-right: 6px;
    transition: background .15s ease, transform .15s ease;
}
html body .header_info .social a:hover { background: rgba(255, 255, 255, .22); transform: translateY(-1px); }
html body .header_info .social a i { margin: 0 !important; font-size: 13px; }
html body .users_view_customized a {
    color: #d8eadf !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 4px 10px;
}
html body .users_view_customized a:hover { color: #fff !important; background: rgba(255, 255, 255, .1); }

/* ---------- title strip ---------- */
html body .header_top {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 0 10px;
    box-shadow: var(--shadow-sm);
}
html body .head-Agrisnet {
    color: var(--g-800);
    font-weight: 800;
    letter-spacing: .06em;
    margin-bottom: 2px;
}
html body .tn-department-title-one { color: #3c2f86; font-weight: 700; margin: 0; }
html body .tn-department-title-two { color: var(--ink-2); font-weight: 600; margin: 0; }
html body .tn-logo img { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .12)); }

/* ---------- main menu ---------- */
html body .wrapper.sticky,
html body .wrapper nav,
html body nav {
    background: linear-gradient(90deg, var(--g-900) 0%, var(--g-800) 45%, var(--g-700) 100%);
}
html body .wrapper.sticky { box-shadow: 0 8px 22px rgba(11, 58, 36, .22); z-index: 50; }
/* the band itself carries the gradient; the <nav> inside is transparent and sizes to its links */
html body .wrapper.sticky nav {
    background: transparent !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 6px 10px !important;
    box-shadow: none;
}
@media (min-width: 993px) {
    html body .wrapper.sticky nav .content { margin: 0 auto !important; }
}
html body .content .links > li > a,
html body .content .links > li > label,
html body .content .links li a.desktop-link {
    color: #fff !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 13px;
    transition: background .15s ease;
}
html body .content .links > li:hover > a,
html body .content .links > li:hover > label,
html body .content .links > li > a:focus-visible {
    background: rgba(255, 255, 255, .14);
}
/* dropdowns: white cards */
html body .content .links ul {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    border-top: 3px solid var(--gold);
    min-width: 260px;
}
@media (min-width: 993px) {
    html body .content .links > li > ul { width: 300px !important; max-height: 70vh; overflow-y: auto; }
    html body .content .links > li > ul li { width: 100% !important; }
}
html body .content .links ul li a {
    color: var(--ink) !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: 9px;
    padding: 9px 12px;
    display: block;
    text-align: left;
    line-height: 1.4;
}
html body .content .links ul li a:hover { background: var(--g-100); color: var(--g-800) !important; }
html body .menu-icon { color: #fff !important; }

/* ---------- floating accessibility panel ---------- */
html body .float-sm .fl-fl { border-radius: 12px 0 0 12px; box-shadow: var(--shadow); }

/* ---------- page containers / headings ---------- */
html body .featurette-heading,
html body h2.featurette-heading,
html body .headings,
html body h3.headings {
    font-weight: 800;
    color: var(--g-900);
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 18px;
}
html body .featurette-heading::after,
html body .headings::after {
    content: "";
    display: block;
    width: 56px; height: 4px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--g-600), var(--gold));
    margin: 10px auto 0;
}
html body .headings::after { margin-left: 0; }
html body .graybg { background: transparent; }

/* ---------- cards ---------- */
html body .card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    background: #fff;
}
html body .card-header,
html body .card-header:first-child,
html body .card-header.bg-success {
    background: linear-gradient(90deg, var(--g-800), var(--g-600)) !important;
    color: #fff !important;
    border-bottom: 0;
    font-weight: 700;
    letter-spacing: .01em;
    padding: 12px 18px;
}
html body .card-header a, html body .card-header b { color: #fff !important; }
html body .card-body { padding: 18px; }

/* ---------- breadcrumbs ---------- */
html body .breadcrumb {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 16px;
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
}
html body .breadcrumb-item.active { color: var(--ink-3); }

/* ---------- tables ---------- */
html body .table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    font-size: 14px;
}
html body .table thead th,
html body .table thead td,
html body .table thead tr {
    background: var(--g-800) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, .15) !important;
    font-weight: 700;
    vertical-align: middle;
}
html body .table td, html body .table th { border-color: var(--line); vertical-align: middle; }
html body .table-striped tbody tr:nth-of-type(odd) { background: var(--g-50); }
html body .table-hover tbody tr:hover,
html body .table tbody tr:hover { background: #e9f6ef; }
html body .dataTables_wrapper .dataTables_filter input,
html body .dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 5px 10px;
}
html body .page-item.active .page-link { background: var(--g-700); border-color: var(--g-700); }
html body .page-link { color: var(--g-700); border-radius: 8px; margin: 0 2px; }

/* ---------- buttons / forms ---------- */
html body .btn { border-radius: 10px; font-weight: 600; }
html body .btn-success, html body .btn-primary {
    background: var(--g-700);
    border-color: var(--g-700);
    box-shadow: 0 6px 14px rgba(20, 108, 67, .2);
}
html body .btn-success:hover, html body .btn-primary:hover { background: var(--g-800); border-color: var(--g-800); }
html body .form-control {
    border: 1.5px solid var(--line);
    border-radius: 10px;
    min-height: 40px;
}
html body .form-control:focus { border-color: var(--g-600); box-shadow: 0 0 0 3px rgba(25, 135, 84, .15); }
html body .img-thumbnail { border-radius: 12px; border-color: var(--line); }

/* ---------- home: carousel + news blocks ---------- */
html body #myCarousel { border-bottom: 0; }
html body #myCarousel .carousel-indicators li { width: 10px; height: 10px; border-radius: 50%; }
html body .welcome .card { border-radius: var(--radius); }
html body .important-links-home {
    border-radius: 12px;
    padding: 8px 6px;
    transition: background .15s ease;
}
html body .important-links-home:hover { background: var(--g-50); }
html body .view-all-link, html body .view-more a {
    display: inline-block;
    background: var(--g-700);
    color: #fff !important;
    border-radius: 999px;
    padding: 5px 16px;
    font-weight: 700;
    font-size: 13px;
}
html body .gallery-img img { border-radius: 12px; }
html body .section-aj { border-radius: 20px; box-shadow: var(--shadow); }

/* ---------- footer ---------- */
html body footer.site-footer {
    background: radial-gradient(120% 140% at 0% 0%, #145c3a 0%, var(--g-900) 60%);
    border-top: 4px solid var(--gold);
}
html body footer.site-footer h5::after {
    content: ""; display: block; width: 34px; height: 3px; border-radius: 99px;
    background: var(--gold); margin-top: 8px;
}

/* =====================================================================
   New home sections (officials, X.com feed, schemes box)
   ===================================================================== */
.am-section { margin: 28px auto; }
.am-kicker {
    display: flex; align-items: center; gap: 10px;
    color: var(--g-700); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.am-kicker::before { content: ""; width: 34px; height: 2px; background: var(--gold); }
.am-title { font-size: 26px; font-weight: 800; color: var(--ink); margin: 6px 0 18px; }

/* key officials */
.am-officials {
    background: linear-gradient(180deg, #eef4f1 0%, #f7faf8 100%);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px 22px 26px;
}
.am-off-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.am-off {
    position: relative;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 26px 18px 18px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.am-off::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, var(--g-700), var(--gold));
}
.am-off::after {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 120px; z-index: 0;
    background: linear-gradient(180deg, #e3f1ea 0%, rgba(255, 255, 255, 0) 100%);
}
.am-off > * { position: relative; z-index: 1; }
.am-off:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.am-photo {
    width: 116px; height: 116px; border-radius: 50%;
    border: 5px solid #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
    object-fit: cover; background: #e8efeb;
}
.am-initials {
    width: 116px; height: 116px; border-radius: 50%;
    border: 5px solid #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--g-700), var(--g-900));
    color: #fff; font-size: 34px; font-weight: 800; letter-spacing: .02em;
}
.am-off h4 { font-size: 16px; font-weight: 800; margin: 16px 0 10px; color: var(--ink); line-height: 1.35; }
.am-off .am-desig { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0 0 16px; flex: 1; }
.am-contact {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--g-50); border: 1px solid var(--line); border-radius: 10px;
    padding: 9px 10px; font-size: 13px; font-weight: 700; color: var(--g-800) !important;
    word-break: break-all;
}
.am-contact + .am-contact { margin-top: 8px; }
.am-contact i { margin: 0 !important; color: var(--g-700); }
.am-contact:hover { background: var(--g-100); }

/* widgets row */
.am-widgets { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.am-box {
    background: #fff; border-radius: 16px; box-shadow: var(--shadow);
    border: 2px solid var(--box, var(--g-700)); overflow: hidden;
    display: flex; flex-direction: column;
}
.am-box-head {
    background: var(--box, var(--g-700)); color: #fff;
    padding: 12px 18px; font-size: 19px; font-weight: 800;
    display: flex; align-items: center; gap: 10px;
}
.am-box-head svg { width: 20px; height: 20px; }
.am-box.x { --box: #3b2a7e; }
.am-box.schemes { --box: #a3218a; }

/* X.com tabs */
.am-tabs { display: flex; gap: 6px; padding: 10px 10px 0; background: #f6f4fb; border-bottom: 1px solid #e3def2; }
.am-tabs button {
    border: 1px solid #d9d2ee; border-bottom: 0; background: var(--box); color: #fff;
    border-radius: 10px 10px 0 0; padding: 8px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.am-tabs button.on { background: #fff; color: #3b2a7e; }
.am-feed { height: 430px; overflow-y: auto; padding: 10px; background: #fff; }
.am-feed-note { padding: 18px; color: var(--ink-3); font-size: 14px; text-align: center; }
.am-feed-note a { font-weight: 700; }

/* schemes box */
.am-schemes { list-style: none; margin: 0; padding: 8px 18px; flex: 1; }
.am-schemes li { border-bottom: 1px solid #e6e2ea; }
.am-schemes li:last-child { border-bottom: 0; }
.am-schemes a {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 4px; color: var(--ink) !important; font-weight: 700; font-size: 15px; line-height: 1.45;
}
.am-schemes a:hover { color: #a3218a !important; }
.am-schemes a::before {
    content: ""; flex: none; width: 0; height: 0;
    border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #e8501d;
}
.am-schemes small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.am-more { text-align: center; padding: 0 0 14px; }
.am-more a {
    display: inline-block; background: #3b2a7e; color: #fff !important; font-weight: 700;
    padding: 5px 16px; border-radius: 6px; font-size: 14px;
}

@media (max-width: 991px) {
    .am-off-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .am-widgets { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .am-off-grid { grid-template-columns: 1fr; }
    .am-title { font-size: 21px; }
    .am-officials { padding: 16px 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .am-off, .am-off:hover { transition: none; transform: none; }
}

/* X.com fallback card (shown when X does not render the timeline for the visitor) */
.am-xcard { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 18px; gap: 4px; }
.am-xlogo { width: 64px; height: 64px; border-radius: 50%; background: #0f1419; color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.am-xcard b { font-size: 17px; color: var(--ink); }
.am-xcard span { color: var(--ink-3); font-size: 14px; }
.am-xcard p { color: var(--ink-2); margin: 10px 0 14px; font-size: 14px; }
.am-xbtn { background: #3b2a7e; color: #fff !important; border-radius: 999px; padding: 9px 20px; font-weight: 700; font-size: 14px; }
.am-xbtn:hover { background: #2c1f60; }

/* ---------- phones / small tablets ---------- */
@media (max-width: 992px) {
    /* compact menu band: just the menu button */
    html body .wrapper .menu-icon { line-height: 46px !important; height: 46px; display: block; }
    html body .wrapper.sticky nav { padding: 2px 12px !important; }
    html body .wrapper.sticky nav .content { margin-top: 0 !important; }
    /* opened mobile menu: readable list on white */
    /* opened menu drops down under the bar (keeps the close button visible) and sits above the page */
    html body .wrapper.sticky { z-index: 1000; }
    html body .wrapper.sticky nav { position: relative; }
    html body nav #show-menu:checked ~ .content .links {
        position: absolute !important; top: 100% !important; left: 0 !important; right: 0;
        width: 100% !important; height: auto !important; max-height: 78vh; overflow-y: auto;
        background: #fff; border-radius: 0 0 16px 16px; box-shadow: var(--shadow-lg);
        padding: 8px 10px 14px !important; z-index: 1001;
    }
    html body nav #show-menu:checked ~ .content .links li { border-bottom: 1px solid var(--line); }
    html body nav #show-menu:checked ~ .content .links ul { box-shadow: none; border-top: 0; padding: 0 0 0 10px; min-width: 0; }
    html body nav #show-menu:checked ~ .content .links > li > a,
    html body nav #show-menu:checked ~ .content .links > li > label { color: var(--ink) !important; }
}
@media (max-width: 767px) {
    /* top bar: one compact row */
    html body .header_info { padding: 6px 0; }
    html body .header_info .flex-nav_bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
    html body .users_view_customized { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
    html body .users_view_customized a { font-size: 11.5px !important; padding: 2px 6px; line-height: 1.5; white-space: nowrap; }
    html body .users_view_customized a i { font-size: 11px; }
    html body .users_view_customized { flex-wrap: wrap; }
    html body .users_view_customized a::before { display: none !important; }
    /* slider: no empty band under the picture */
    html body #myCarousel, html body #myCarousel .carousel-inner, html body #myCarousel .carousel-item { height: 220px !important; min-height: 0 !important; }
    html body #myCarousel .carousel-item img { height: 220px !important; max-height: 220px; width: 100%; object-fit: cover; }
}

/* ---------- desktop menu alignment ----------
   Items never shrink or break mid-label, the dropdown arrow stays on the same line,
   and when space runs out whole items wrap onto a second centred row. */
@media (min-width: 993px) {
    html body .wrapper.sticky nav .content { max-width: 1440px !important; width: 100% !important; }
    html body .wrapper.sticky nav .content .links {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center;
        gap: 2px 4px;
        width: 100%;
        margin: 0 auto;
    }
    html body .wrapper.sticky nav .content .links > li { flex: 0 0 auto !important; width: auto !important; }
    html body .wrapper.sticky nav .content .links > li > a {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        white-space: nowrap !important;
        line-height: 1.3 !important;
        padding: 9px 12px !important;
    }
    /* arrow sits right after the text, vertically centred */
    html body .wrapper.sticky nav .content .links > li > a.dropdown-toggle::after,
    html body .wrapper.sticky nav .content .links > li > a.desktop-link::after {
        margin: 0 !important;
        vertical-align: middle;
        position: static !important;
        display: inline-block;
    }
}

/* ---------- Hon'ble Chief Minister photo: top-right of the title strip ---------- */
html body .header_top .hdr-has-cm { position: relative; }
html body .hdr-cm {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; gap: 12px; flex-direction: row-reverse; text-align: right;
}
html body .hdr-cm img {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    border: 3px solid #fff; box-shadow: 0 0 0 3px var(--gold), 0 6px 16px rgba(0, 0, 0, .18);
}
html body .hdr-cm-text b { display: block; font-size: 14px; font-weight: 800; color: var(--g-900); line-height: 1.3; }
html body .hdr-cm-text span { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
/* photo only; keep the titles clear of it */
@media (min-width: 992px) {
    html body .hdr-has-cm > .row { padding-right: 104px; }
}
@media (max-width: 991px) { html body .hdr-cm { display: none; } }         /* phones / tablets: no room */

/* X.com box: "open the selected account on X" bar + fully clickable fallback card */
.am-xbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 14px; background: #fff; border-bottom: 1px solid #ece8f6;
    font-size: 13.5px; font-weight: 700; color: #3b2a7e !important;
}
.am-xbar:hover { background: #f6f3fd; }
.am-xbar-go { background: #3b2a7e; color: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; }
a.am-xcard { color: inherit !important; text-decoration: none !important; border-radius: 14px; margin: 6px; transition: background .15s ease; }
a.am-xcard:hover { background: #f6f3fd; }
a.am-xcard:hover .am-xbtn { background: #2c1f60; }

/* ---------- Officers Corner dropdown: grouped two-column panel ---------- */
html body .content .links ul li a,
html body .content .links ul li { font-family: 'Open Sans', 'Mukta Malar', 'Noto Sans Tamil', system-ui, sans-serif !important; }
html body .content .links ul.dd-officers .dd-head {
    font-size: 11.5px !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--g-700); padding: 10px 12px 4px; line-height: 1.3; list-style: none; cursor: default;
    text-align: left !important;
}
html body .content .links ul.dd-officers .dd-item a {
    display: flex !important; align-items: center; gap: 10px;
    padding: 8px 10px !important; border-radius: 10px; font-size: 13.5px !important; font-weight: 600;
    color: var(--ink) !important; background: transparent !important; box-shadow: none !important; text-align: left;
}
html body .content .links ul.dd-officers .dd-item a i {
    flex: none; width: 30px; height: 30px; margin: 0 !important; border-radius: 8px;
    display: grid; place-items: center; font-size: 13px;
    background: var(--g-100); color: var(--g-700);
}
html body .content .links ul.dd-officers .dd-item a:hover { background: var(--g-50) !important; color: var(--g-800) !important; }
html body .content .links ul.dd-officers .dd-item a:hover i { background: var(--g-700); color: #fff; }
html body .content .links ul.dd-officers .dd-item a::after {          /* opens in a new tab */
    content: "\2197"; margin-left: auto; font-size: 12px; color: var(--ink-3); opacity: 0; transition: opacity .15s;
}
html body .content .links ul.dd-officers .dd-item a:hover::after { opacity: 1; }

@media (min-width: 993px) {
    html body .content .links > li > ul.dd-officers {
        width: 560px !important; max-height: none; overflow: visible;
        left: auto !important; right: 0 !important;
        display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; column-gap: 8px;
        padding: 10px !important;
    }
    html body .content .links > li > ul.dd-officers > li { width: auto !important; }
    /* left column: department logins (heading + 6); right column: billing + other portals */
    html body .content .links > li > ul.dd-officers > li:nth-child(-n+7) { grid-column: 1; }
    html body .content .links > li > ul.dd-officers > li:nth-child(n+8) { grid-column: 2; }
}
@media (max-width: 992px) {
    html body nav #show-menu:checked ~ .content .links ul.dd-officers .dd-head { padding-left: 4px; }
    html body nav #show-menu:checked ~ .content .links ul.dd-officers li { border-bottom: 0 !important; }
}
