/* ============================================================
   CSS custom properties
   ============================================================ */
:root {
    --input-padding-y:     .375rem;
    --input-padding-x:     .75rem;
    --input-font-size:     1rem;
    --input-line-height:   1.5;
    --input-color:         #495057;
    --input-bg:            #fff;
    --input-border-color:  #ced4da;
    --input-border-radius: .25rem;
    --input-readonly-bg:   #e9ecef;

    --btn-padding-y:       .375rem;
    --btn-padding-x:       .75rem;
    --btn-font-size:       1rem;
    --btn-border-radius:   .25rem;
    --btn-primary-bg:      #007bff;
    --btn-primary-hover:   #0069d9;
    --btn-secondary-bg:    #6c757d;
    --btn-secondary-hover: #5a6268;
    --btn-danger-bg:       #dc3545;
    --btn-danger-hover:    #c82333;
    --btn-success-bg:      #28a745;
    --btn-success-hover:   #218838;
}

body {
	margin: 10px !important;
	font-size: 15px;
	background-color: #f0ede8;
	line-height: 1.5;
	font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #0f172a;
}
a:link {
	text-decoration: none;
	font-weight: 600;
	color: #1d4ed8;
}
a:visited {
	text-decoration: none;
	font-weight: 600;
	color: #1d4ed8;
}
a:active {
	text-decoration: none;
	font-weight: 600;
}
a:hover {
	color: #1e3a8a;
	text-decoration: underline;
	font-weight: 600;
}
p {
	margin: 3px;
}

hr {
	margin-top: 0.5em;
	margin-bottom: 0.5em;
	margin-left: auto;
	margin-right: auto;
	border: none;
	border-top: 1px solid #999;
}

h1 {
	font-weight: 700;
	border-bottom: 2px solid #3b82f6;
	margin-top: 5px;
	margin-bottom: 5px;
	display: inline-block;
	font-size: 1.4em;
	color: #0f172a;
}
h2 {
	font-weight: 700;
	border-bottom: 2px solid #3b82f6;
	margin-top: 5px;
	margin-bottom: 10px;
	display: inline-block;
	font-size: 1.2em;
	color: #0f172a;
}
h4 {
	font-weight: 700;
	border-bottom: 2px solid #3b82f6;
	margin-top: 0px;
	margin-bottom: 12px;
	display: inline-block;
	font-size: 1.1em;
	color: #0f172a;
}

/* ============================================================
   Collapsible nav column
   ============================================================ */
#nav-column {
    width: 175px;
}

#nav-column.nav-collapsed {
    width: 28px;
    gap: 0;
}

#nav-column.nav-collapsed .leftnav,
#nav-column.nav-collapsed #nav-logo {
    display: none;
}

#nav-toggle {
    display: block;
    width: 100%;
    padding: 5px 0;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #123d7a 0%, #1a56a0 55%, #3080d0 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 2px 8px rgba(0,0,0,0.5);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

#nav-toggle:hover {
    background: linear-gradient(135deg, #1a4f94 0%, #2265c0 55%, #4494e8 100%);
    color: #ffffff;
    text-decoration: none;
}

#nav-column.nav-collapsed #nav-toggle {
    min-height: 48px;
    font-size: 14px;
}

.leftnav {
	font-size: 14px;
	padding: 2px;
	min-height: 500px;
	box-sizing: border-box;
	background: linear-gradient(135deg, #123d7a 0%, #1a56a0 55%, #3080d0 100%);
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 16px rgba(0,0,0,0.9);
	border-radius: 12px;
}

.leftnav A:link {
	color: #cbd5e1;
}
.leftnav A:visited {
	color: #cbd5e1;
}
.leftnav A:active {
	text-decoration: none;
}
.leftnav A:hover {
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
}

.leftnav ul {
	list-style-type: none;
	margin-top: 8px;
	margin-left: 0px;
	margin-right: 0px;
	padding-left: 4px;
	padding-right: 0px;
}

.leftnav li {
	margin-bottom: 1px;
	margin-left: 0px;
	margin-right: 6px;
	padding: 2px 6px;
	border-radius: 6px;
	transition: background-color 0.15s;
}

.leftnav li:hover {
	background-color: rgba(255, 255, 255, 0.08);
}

.middle {
	flex: 1;
	padding: 16px;
	min-height: 500px;
	box-sizing: border-box;
	background-color: #e8e3db;
	border: 1px solid #d9d2c8;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
	border-radius: 12px;
}

/* ============================================================
   Tables
   ============================================================ */
table {
	border-spacing: 0;
	border-collapse: collapse;
	font-size: 13px;
}

th, td {
	border: none;
	border-bottom: 1px solid #d0cbc3;
	border-left: 1px solid #e8e4de;
	padding: 6px 8px;
	color: #1a1a1a;
	text-align: left;
	vertical-align: middle;
}

th:first-child, td:first-child {
	border-left: none;
}

tbody tr:hover {
	background-color: rgba(0, 0, 0, 0.04);
}

th {
	background-color: transparent;
	font-weight: 600;
	color: #777;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.04em;
	border-bottom: 2px solid #b8b0a4;
}

/* ============================================================
   Form inputs
   ============================================================ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
    padding: var(--input-padding-y) var(--input-padding-x);
    font-size: var(--input-font-size);
    font-weight: 400;
    line-height: var(--input-line-height);
    color: var(--input-color);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border-color);
    border-radius: var(--input-border-radius);
    box-sizing: border-box;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

td input[type="text"],
td input[type="number"],
td input[type="email"],
td select,
td textarea {
    padding: 2px 4px;
    font-size: 0.9em;
    border-radius: 3px;
}

input[readonly],
input:read-only {
    background-color: var(--input-readonly-bg);
    cursor: default;
}

/* ============================================================
   Buttons
   ============================================================ */
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    font-family: inherit;
    font-size: var(--btn-font-size);
    line-height: 1.5;
    padding: var(--btn-padding-y) var(--btn-padding-x);
    border: 1px solid var(--btn-secondary-bg);
    border-radius: var(--btn-border-radius);
    background-color: var(--btn-secondary-bg);
    color: #fff;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
    text-decoration: none;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
    background-color: var(--btn-secondary-hover);
    border-color: var(--btn-secondary-hover);
    color: #fff;
    text-decoration: none;
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: .25rem;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    text-decoration: none;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
    text-decoration: none;
}

.btn-danger {
    color: #fff;
    background-color: var(--btn-danger-bg);
    border-color: var(--btn-danger-bg);
}
.btn-danger:hover {
    color: #fff;
    background-color: var(--btn-danger-hover);
    border-color: var(--btn-danger-hover);
    text-decoration: none;
}

.btn-success {
    color: #fff;
    background-color: var(--btn-success-bg);
    border-color: var(--btn-success-bg);
}
.btn-success:hover {
    color: #fff;
    background-color: var(--btn-success-hover);
    border-color: var(--btn-success-hover);
    text-decoration: none;
}

.btn.btn-sm {
    padding: .125rem .45rem;
    font-size: .8rem;
    border-radius: 3px;
}

a.btn:link, a.btn:visited, a.btn:hover {
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 10px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #fff;
}
.alert-success {
    background-color: #16a34a;
    border-color: #15803d;
}
.alert-warning {
    background-color: #d97706;
    border-color: #b45309;
}
.alert-danger {
    background-color: #dc2626;
    border-color: #b91c1c;
}

/* ============================================================
   Utility classes
   ============================================================ */
.text_fail {
	border: 1px solid #ef4444;
	color: #ef4444;
	padding: 2px;
}

.text_success {
	color: #16a34a;
	font-weight: 600;
}

.text-muted   { color: #64748b; }
.text-danger  { color: #dc3545; }
.text-success { color: #28a745; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }

.mt-1 { margin-top:    .25rem; }
.mt-2 { margin-top:    .5rem;  }
.mt-3 { margin-top:    1rem;   }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem;  }
.mb-3 { margin-bottom: 1rem;   }
.small, small { font-size: .875em; }
