/* ==============================================
   Admin Portal Stylesheet (Full Width Mode)
   ============================================== */
:root {
    --portal-primary: #004b87;
    --portal-primary-light: #007bff;
    --portal-bg: #f4f7f6;
    --portal-sidebar-width: 280px;
}

body { background: var(--portal-bg); margin: 0; }

.portal-wrapper {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: linear-gradient(-45deg, #004b87, #007bff, #00b4d8, #004b87);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ล็อกอินการ์ด */
.login-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(25px);
    border-radius: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    padding: 60px 50px;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(255,255,255,0.8);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideUpFade { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.portal-title { text-align: center; color: #004b87; font-size: 2.2em; font-weight: 700; margin-bottom: 10px; }
.portal-subtitle { text-align: center; color: #666; margin-bottom: 30px; font-size: 1.1em; }

.login-error-box {
    background: #fff2f2; color: #d32f2f; padding: 12px 20px; border-radius: 10px;
    margin-bottom: 25px; font-size: 0.95em; text-align: center; border: 1px solid #ffcdd2;
}

.login-form-wrapper form { display: flex; flex-direction: column; gap: 20px; }
.form-group label { font-weight: 600; color: #333; margin-bottom: 8px; display: block; font-size: 0.95em; }
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%; padding: 16px 20px; border-radius: 14px; border: 2px solid #e1e8ed;
    background: #f8f9fa; font-family: 'Prompt', sans-serif; font-size: 1em; color: #333; transition: all 0.3s ease;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none; border-color: #007bff; background: #fff; box-shadow: 0 0 0 5px rgba(0, 123, 255, 0.15);
}
.login-remember { display: flex; align-items: center; font-size: 0.95em; color: #555; }
.login-remember label { margin: 0; font-weight: 400; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.login-remember input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #007bff; }

.btn-custom-login {
    width: 100%; padding: 18px; background: linear-gradient(135deg, #004b87 0%, #007bff 100%);
    color: white; border: none; border-radius: 14px; font-family: 'Prompt', sans-serif;
    font-size: 1.15em; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.25); margin-top: 10px;
}
.btn-custom-login:hover {
    transform: translateY(-3px); box-shadow: 0 15px 25px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #003366 0%, #0056b3 100%);
}

/* ==============================================
   แดชบอร์ดแบบขยายเต็มจอ (Full Width Layout)
   ============================================== */
.dashboard-container {
    width: 100%; 
    max-width: 100%; /* ขยายเต็มความกว้างหน้าจอ */
    min-height: 90vh; 
    background: #ffffff;
    border-radius: 0; /* เอาความโค้งมุมจอออกเพื่อให้เต็มตา */
    box-shadow: none;
    display: flex; 
    overflow: hidden; 
    margin: 0;
}
.dashboard-sidebar {
    width: var(--portal-sidebar-width); 
    background: #1e293b; 
    color: #fff;
    display: flex; 
    flex-direction: column; 
    padding: 30px 20px;
    flex-shrink: 0;
}
.sidebar-brand {
    font-size: 1.25em; font-weight: 700; color: #fff; margin-bottom: 40px;
    padding-left: 10px; display: flex; align-items: center; gap: 10px;
}
.sidebar-brand span { color: #38bdf8; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: 15px; padding: 14px 18px;
    color: #94a3b8; text-decoration: none; font-weight: 500; border-radius: 12px; transition: all 0.3s ease;
}
.sidebar-menu li a svg { width: 20px; height: 20px; fill: currentColor; transition: 0.3s; }
.sidebar-menu li a:hover, .sidebar-menu li.active a { background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
.sidebar-menu li.menu-logout { margin-top: auto; }
.sidebar-menu li.menu-logout a { color: #f87171; }
.sidebar-menu li.menu-logout a:hover { background: rgba(248, 113, 113, 0.1); color: #ef4444; }

.dashboard-main { flex-grow: 1; display: flex; flex-direction: column; background: #f8fafc; }
.dashboard-topbar {
    height: 80px; background: #ffffff; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between; padding: 0 40px;
}
.topbar-welcome { font-size: 1.1em; font-weight: 600; color: #334155; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.btn-home-link {
    text-decoration: none; background: #e2e8f0; color: #334155;
    padding: 8px 16px; border-radius: 8px; font-weight: 500; font-size: 0.95em; transition: 0.3s;
}
.btn-home-link:hover { background: #cbd5e1; }

.dashboard-content { padding: 40px; overflow-y: auto; }
.content-header { margin-bottom: 30px; }
.content-header h2 { font-size: 1.8em; color: #1e293b; margin: 0 0 5px 0; }
.content-header p { color: #64748b; margin: 0; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
.quick-card {
    background: #ffffff; border-radius: 16px; padding: 30px; text-decoration: none;
    color: #1e293b; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid #e2e8f0;
    transition: all 0.3s ease; display: flex; align-items: center; gap: 20px;
}
.quick-card svg { width: 40px; height: 40px; fill: var(--portal-primary); flex-shrink: 0; transition: 0.3s; }
.quick-card-info h3 { margin: 0 0 5px 0; font-size: 1.15em; font-weight: 600; }
.quick-card-info p { margin: 0; font-size: 0.9em; color: #64748b; }
.quick-card:hover {
    transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0, 75, 135, 0.1);
    border-color: var(--portal-primary-light); color: var(--portal-primary);
}
.quick-card:hover svg { transform: scale(1.1); fill: var(--portal-primary-light); }

@media (max-width: 992px) {
    .dashboard-container { flex-direction: column; }
    .dashboard-sidebar { width: 100%; padding: 20px; }
    .sidebar-menu { flex-direction: row; flex-wrap: wrap; }
    .sidebar-menu li.menu-logout { margin-top: 0; }
    .dashboard-topbar { padding: 0 20px; }
    .dashboard-content { padding: 20px; }
}