/* =========================================================
   Karana Alla – Single Modern Stylesheet (Layout A)
   Sidebar left, main content right, dark background
   ========================================================= */

/* ---------- Design tokens ---------- */

:root {
    --bg-body: #020617;
    --bg-surface: #0b1120;
    --bg-surface-alt: #030712;
    --bg-sidebar: #020617;

    --accent: #22c55e;
    --accent-strong: #4ade80;
    --accent-soft: rgba(34, 197, 94, 0.16);

    --border-subtle: rgba(148, 163, 184, 0.35);
    --border-soft: rgba(15, 23, 42, 0.8);

    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --text-soft: #6b7280;

    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.7);

    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-pill: 999px;

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 sans-serif;
}

/* ---------- Global base / background ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(56, 189, 248, 0.06) 0, transparent 55%),
        radial-gradient(circle at bottom, rgba(129, 140, 248, 0.10) 0, transparent 60%),
        var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
}

/* some pages wrap with .main_page */
.main_page {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    color: var(--text-main);
}

/* basic links */

a,
a:link,
a:visited {
    color: var(--accent-strong);
    text-decoration: none;
    transition: color 0.12s ease, text-shadow 0.12s ease;
}

a:hover {
    color: #bbf7d0;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* ---------- Outer page shell ---------- */

#bg-wrapper {
    min-height: 100vh;
    padding: 13px 0 19px;
    box-sizing: border-box;
    background: transparent;
}

#wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 8px 12px 14px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-soft);
}

/* ---------- Header / logo / top search ---------- */

#header {
    max-width: 1600px;
    margin: 0 auto 14px;
    padding: 5px 9px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
    background: transparent;
}

#logo img {
    max-height: 52px;
    width: auto;
}

/* global search bar in header */

#global_search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

#global_search #qq {
    min-width: 230px;
    padding: 3px 6px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}

#global_search #qq::placeholder {
    color: var(--text-soft);
}

#global_search input[type="submit"],
#global_search button {
    padding: 3px 7px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(34, 197, 94, 0.85);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #022c22;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

#global_search input[type="submit"]:hover,
#global_search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.4);
    filter: brightness(1.03);
}

/* ---------- Main layout: sidebar + main column ---------- */

#cols {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-top: 8px;
}

/* sidebar */

.side_menu {
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 12px;
    align-self: flex-start;
}

.side_menu table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.96);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.side_menu td {
    border: none;
}

/* sidebar section headings */

.menuh {
    padding: 6px 12px;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.22), rgba(15, 23, 42, 1));
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(30, 64, 175, 0.6);
}

/* sidebar links */

.menu_item {
    padding: 0;
}

.menu_item li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu_item a {
    display: block;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--text-muted);
    border-left: 3px solid transparent;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease,
        padding-left 0.12s ease;
}

.menu_item a:hover {
    background: rgba(15, 23, 42, 0.9);
    border-left-color: var(--accent);
    color: #f9fafb;
    padding-left: 12px;
}

/* main column */

#col-main {
    flex: 1 1 auto;
    min-width: 0;
}

#col-main-inner,
#col-main-inner-2,
#col-main-inner-3 {
    width: 100%;
}

/* main content card */

#col-main-inner-3 {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    padding: 8px 8px 10px;
    box-sizing: border-box;
}

/* page titles */

.page_title,
#title h1,
#title h2 {
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: 0.02em;
}

/* generic body text */

.page-content,
#body,
#body p {
    color: var(--text-main);
}

.page-content p,
#body p {
    margin: 0 0 8px;
    color: var(--text-muted);
}

/* ---------- Forms / inputs ---------- */

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.96);
    color: var(--text-main);
    padding: 3px 6px;
    font-size: 13px;
    outline: none;
}

textarea {
    border-radius: var(--radius-md);
    min-height: 80px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-soft);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.55);
}

/* buttons */

button,
input[type="submit"],
input[type="button"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 7px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #022c22;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.35);
}

/* ---------- Tables (lists, search results, pets, etc.) ---------- */

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    color: var(--text-main);
}

table th,
table td {
    padding: 3px 4px;
    text-align: left;
    border-bottom: 1px solid rgba(31, 41, 55, 0.85);
}

table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.9));
}

table tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.55);
}

table tr:nth-child(odd) td {
    background: rgba(15, 23, 42, 0.25);
}

table tr:hover td {
    background: var(--accent-soft);
}

/* ---------- DataTables look ---------- */

.dataTables_wrapper {
    font-size: 13px;
    color: var(--text-main);
}

.dataTables_filter input {
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.96);
    color: var(--text-main);
}

.dataTables_paginate a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px !important;
    margin-left: 4px;
    border-radius: var(--radius-pill) !important;
    border: 1px solid transparent !important;
    font-size: 12px;
    color: var(--text-soft) !important;
}

.dataTables_paginate a:hover {
    border-color: var(--border-subtle) !important;
    color: var(--text-main) !important;
    background: rgba(15, 23, 42, 0.96) !important;
}

.dataTables_paginate a.current {
    border-color: var(--accent) !important;
    background: var(--accent-soft) !important;
    color: var(--accent-strong) !important;
}

/* ---------- Footer ---------- */

.site-footer,
#copyright {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.9);
    color: var(--text-soft);
    font-size: 12px;
    text-align: right;
}

/* ---------- Misc / utility ---------- */

.clear {
    clear: both;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    #header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #cols {
        flex-direction: column;
    }

    .side_menu {
        width: 100%;
        position: static;
    }

    .side_menu table {
        border-radius: var(--radius-md);
    }
}

@media (max-width: 640px) {
    #wrapper {
        padding: 14px 12px 20px;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }

    #global_search #qq {
        min-width: 0;
        width: 100%;
    }
}
