/* =========================================================================
   Frontend Stylesheet — Professional Retro
   Layout: flexbox 2-column (#sidebar / #content)
   Box markup: .head > h1 , .bgdiv > .cont|.cont_link > (menu) , .foot|.foot_linked
   ========================================================================= */

/* ---------- Reset & base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Segoe UI", "Noto Sans", "DejaVu Sans", Arial, Helvetica, sans-serif;
    line-height: 1.55;
    color: #2d3436;
    background: #1a1f25;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(200, 155, 60, 0.03) 0%, transparent 60%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #3b82c4;
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: #1a5a96;
    text-decoration: underline;
}

h1, h2, h3 { font-weight: 600; }

img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */
header {
    background: linear-gradient(135deg, #141e2a 0%, #1b2a3a 30%, #243447 70%, #1b2a3a 100%);
    color: #d5dfe8;
    padding: 0;
    border-bottom: 3px solid #c89b3c;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 10;
}
header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(200, 155, 60, 0.6) 20%, rgba(200, 155, 60, 0.8) 50%, rgba(200, 155, 60, 0.6) 80%, transparent 100%);
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Logo ---------- */
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #f5d89a 0%, #c89b3c 40%, #d4a843 60%, #a8862e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-star {
    font-size: 1.1rem;
    color: #c89b3c;
    filter: drop-shadow(0 0 4px rgba(200, 155, 60, 0.6));
    animation: sparkle 3s ease-in-out infinite;
}
.logo-star:last-child {
    animation-delay: 1.5s;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(200, 155, 60, 0.9)); }
}

.logo-sub {
    font-size: 0.7rem;
    color: #8899aa;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-left: 6px;
    padding-top: 4px;
}

/* ---------- Header nav ---------- */
header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
}

header nav a {
    color: #b0c4de;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
}
header nav a:hover {
    color: #fff;
    text-decoration: none;
    border-bottom-color: #c89b3c;
    text-shadow: 0 0 8px rgba(200, 155, 60, 0.3);
}

/* ---------- Header login form ---------- */
header .login-form {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

header .login-form input[type="text"],
header .login-form input[type="password"] {
    padding: 5px 8px;
    border: 1px solid #2a3a4a;
    border-radius: 4px;
    background: #f0f3f5;
    color: #2d3436;
    font-size: 0.82rem;
    width: 110px;
}

header .login-form input[type="submit"] {
    padding: 5px 12px;
    border: 1px solid #8a7028;
    border-radius: 4px;
    background: linear-gradient(180deg, #d4a843 0%, #b8912e 100%);
    color: #1a1400;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
header .login-form input[type="submit"]:hover {
    background: linear-gradient(180deg, #e0b84d 0%, #c8a038 100%);
    box-shadow: 0 0 8px rgba(200, 155, 60, 0.4);
}

.header-login-links {
    display: flex;
    gap: 10px;
    font-size: 0.82rem;
}
.header-login-links a { color: #b0c4de; }
.header-login-links a:hover { color: #fff; }

/* ---------- Main layout ---------- */
.layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    gap: 16px;
    flex: 1;
    width: 100%;
}

/* ---------- Sidebar ---------- */
aside#sidebar {
    width: 210px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Content ---------- */
main#content {
    flex: 1;
    min-width: 0;
    /*
    background: #f7f8fa;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    */
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ---------- Content boxes (center + sidebar) ---------- */
.head {
    background: linear-gradient(135deg, #2c4a6e 0%, #1e3554 100%);
    border-bottom: 2px solid #c89b3c;
    padding: 10px 16px;
    border-radius: 5px 5px 0 0;
}
.head h1 {
    font-size: 0.92rem;
    color: #ffffff;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.bgdiv {
    background: #f7f8fa;
}

.cont {
    padding: 16px 20px;
    color: #2d3436;
    line-height: 1.65;
}
.cont p { margin: 0 0 10px 0; }

.foot,
.foot_linked {
    height: 3px;
    background: linear-gradient(90deg, #2c4a6e 0%, #c89b3c 50%, #2c4a6e 100%);
    border-radius: 0 0 5px 5px;
}

/* ---------- Section box in main content ---------- */
section.box {
    margin: 0 0 8px 0;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    background: #f7f8fa;
}
.cont_link {
    background: #232d38;
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2e3d4d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s ease;
}

.cont_link .head {
    background: linear-gradient(135deg, #2c4a6e 0%, #1e3554 100%);
    border-radius: 5px 5px 0 0;
}

.cont_link nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cont_link nav a {
    display: block;
    padding: 10px 14px;
    color: #a0b8cc;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
    position: relative;
}
.cont_link nav a:last-child { border-bottom: none; }
.cont_link nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e8f0f8;
    padding-left: 20px;
    text-decoration: none;
}
.cont_link nav a:active {
    background: rgba(255, 255, 255, 0.08);
}

.cont_link > a {
    display: block;
    padding: 10px 14px;
    color: #a0b8cc;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.cont_link > a:last-child { border-bottom: none; }
.cont_link > a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e8f0f8;
    padding-left: 20px;
    text-decoration: none;
}
.cont_link > a:active {
    background: rgba(255, 255, 255, 0.08);
}

.foot,
.foot_linked {
    height: 3px;
    background: linear-gradient(90deg, #2c4a6e 0%, #c89b3c 50%, #2c4a6e 100%);
}

/* ---------- Footer ---------- */
footer {
    background: linear-gradient(135deg, #141e2a 0%, #1b2a3a 30%, #243447 70%, #1b2a3a 100%);
    color: #8899aa;
    border-top: 3px solid #c89b3c;
    padding: 14px 24px;
    font-size: 0.8rem;
    text-align: center;
    margin-top: auto;
}
footer a { color: #a0b8cc; transition: color 0.15s; }
footer a:hover { color: #f5d89a; }

/* ---------- Tables ---------- */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    font-size: 0.9rem;
}
table td,
table th {
    border: 1px solid #dde1e6;
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
}
table th {
    background: #e8ecf0;
    color: #1e3554;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
table tr:nth-child(even) td {
    background: #f0f2f5;
}
table tr:hover td {
    background: #e2ecf5;
}

/* ---------- Forms ---------- */
form { margin: 0; }

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    padding: 7px 10px;
    border: 1px solid #bcc4cc;
    border-radius: 4px;
    background: #fff;
    color: #2d3436;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82c4;
    box-shadow: 0 0 0 3px rgba(59, 130, 196, 0.2);
}

textarea { width: 100%; }

input[type="submit"],
button,
.btn {
    padding: 8px 18px;
    border: 1px solid #8a7028;
    border-radius: 4px;
    background: linear-gradient(180deg, #d4a843 0%, #b8912e 100%);
    color: #1a1400;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
input[type="submit"]:hover,
button:hover,
.btn:hover {
    background: linear-gradient(180deg, #e0b84d 0%, #c8a038 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
input[type="submit"]:active,
button:active,
.btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

label {
    display: inline-block;
    min-width: 140px;
    font-weight: 600;
    color: #1e3554;
    font-size: 0.88rem;
}

/* ---------- Fieldset styling ---------- */
fieldset {
    border: 1px solid #dde1e6;
    border-radius: 5px;
    padding: 0;
    margin: 12px 0;
}
legend {
    font-weight: 600;
    color: #1e3554;
    padding: 0 8px;
    font-size: 0.92rem;
}

/* ---------- Misc helpers ---------- */
.clear { clear: both; }

hr {
    border: none;
    border-top: 1px solid #dde1e6;
    margin: 14px 0;
}

ul, ol {
    margin: 8px 0 8px 22px;
}

.error,
.alert {
    color: #c0392b;
    font-weight: 600;
}

.success {
    color: #1a7a2e;
    font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .layout {
        flex-direction: column;
    }
    aside#sidebar {
        width: 100%;
    }
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
