/* ============================================================
   admin_a_style.css
   รวม: IMC Admin Base + Magazine Admin Panel
   ============================================================ */

a, .nav-item, a.nav-link { font-family:'anuphan' !important; }

/* PADDING MARGIN //////////////////////////////////////////// */
.pd-0  { padding: 0 !important; }
.pd-15 { padding-left: 15px !important; padding-right: 15px !important; }
.pd-20 { padding: 20px !important; }
.pd-30 { padding: 30px !important; }
.pl-10 { padding-left: 10px !important; }
.pl-15 { padding-left: 15px !important; }
.pl-20 { padding-left: 20px !important; }
.pl-25 { padding-left: 25px !important; }
.pl-35 { padding-left: 35px !important; }
.mg-0  { margin: 0 !important; }
.mg-15 { margin-left: 15px !important; margin-right: 15px !important; }
.mg-30 { margin: 30px !important; }
.pt-0  { padding-top: 0px !important; }
.pt-3  { padding-top: 3px !important; }
.pt-5  { padding-top: 5px !important; }
.pt-10 { padding-top: 10px !important; }
.pt-20 { padding-top: 20px !important; }
.pt-30 { padding-top: 30px !important; }
.pt-40 { padding-top: 40px !important; }
.pt-50 { padding-top: 50px !important; }
.pt-60 { padding-top: 60px !important; }
.pt-110 { padding-top: 110px !important; }
.pb-5  { padding-bottom: 5px !important; }
.pb-10 { padding-bottom: 10px !important; }
.pb-20 { padding-bottom: 20px !important; }
.pb-30 { padding-bottom: 30px !important; }
.pb-40 { padding-bottom: 40px !important; }
.pb-50 { padding-bottom: 50px !important; }
.pb-60 { padding-bottom: 60px !important; }
.mt-0  { margin: 0px !important; }
.mt-5  { margin-top: 5px !important; }
.mt-10 { margin-top: 10px !important; }
.mt-15 { margin-top: 15px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-30 { margin-top: 30px !important; }
.mt-40 { margin-top: 40px !important; }
.mt-50 { margin-top: 50px !important; }
.mt-60 { margin-top: 60px !important; }
.mt-120 { margin-top: 120px !important; }
.mb-0  { margin-bottom: 0px !important; }
.mb-5  { margin-bottom: 5px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-15 { margin-bottom: 15px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-30 { margin-bottom: 30px !important; }
.mb-40 { margin-bottom: 40px !important; }
.mb-50 { margin-bottom: 50px !important; }
.mb-60 { margin-bottom: 60px !important; }

/* FONT SIZE ///////////////////////////////////////////////// */
.font-10 { font-size: 10px !important; line-height: 1.4 !important; font-weight: 600; }
.font-12 { font-size: 12px !important; line-height: 1.4 !important; font-weight: 600; }
.font-14 { font-size: 14px !important; line-height: 1.4 !important; font-weight: 600; }
.font-16 { font-size: 16px !important; font-weight: 600; }
.font-18 { font-size: 18px !important; line-height: 1.4 !important; font-weight: 600; }
.font-20 { font-size: 20px !important; line-height: 1.4 !important; font-weight: 600; }
.font-22 { font-size: 22px !important; line-height: 1.4 !important; font-weight: 600; }
.font-24 { font-size: 24px !important; line-height: 1 !important; }
.font-26 { font-size: 26px !important; line-height: 1 !important; }
.font-28 { font-size: 28px !important; line-height: 1 !important; }
.font-30 { font-size: 30px !important; line-height: 1 !important; }
.font-32 { font-size: 32px !important; line-height: 1 !important; }
.font-34 { font-size: 34px !important; line-height: 1 !important; }
.font-36 { font-size: 36px !important; line-height: 1 !important; }
.font-38 { font-size: 38px !important; line-height: 1 !important; }

/* BASE ////////////////////////////////////////////////////// */
body, p {
    color: #000000 !important;
    font-weight: 400 !important;
    background: #ffffff;
}
h1, h2, h3, h4, h5, h6 { font-weight: 400 !important; }
h1 { font-size: 28px !important; }
h2 { font-size: 24px !important; }
h3 { font-size: 22px !important; }
h4 { font-size: 20px !important; }
h5 { font-size: 18px !important; }
h6 { font-size: 14px !important; }
a       { color: #000; }
a:hover { color: #000; }

/* UTILS ///////////////////////////////////////////////////// */
.hide { display: none !important; }
.img  { max-width: 100%; border-radius: 5px; }
.img-responsive { width: 100%; }
.w-50 { width: 50%; }
.pull-right { float: right; }
.div-center { display: block; margin: auto; }
.flex-center { display: flex; justify-content: center; }
.text-center-column { display: flex; flex-direction: column; justify-content: center; }
.flex-center-column  { display: flex; justify-content: center; }

.spacer-20 { height: 20px; clear: both; width: 100%; }
.spacer-30 { height: 30px; clear: both; width: 100%; }
.spacer-60 { height: 60px; clear: both; width: 100%; }

/* FORMS (base) ////////////////////////////////////////////// */
.form-control { height: calc(2.3em + 0.75rem + 2px); }
.form-control:disabled,
.form-control[readonly] { background-color: #fff; opacity: 1; }
.dropzone { min-height: 300px !important; }

/* SIDEBAR (Dastyle base) //////////////////////////////////// */
.dark-sidenav {
    background-position: center center;
    background-size: cover;
    background-repeat: repeat;
    background-color: rgba(0,0,0,0.04);
}

/* BUTTONS (base) /////////////////////////////////////////// */
.btn-outline-secondary {
    color: #868e96;
    background-color: transparent;
    background-image: none;
    border-color: #868e96;
}
.btnxc {
    display: inline-block;
    padding: .25rem .5rem;
    margin: 3px;
    font-size: 16px;
    cursor: pointer;
}

/* MISC base ///////////////////////////////////////////////// */
.datepost   { margin-top: -15px; }
.anther_ma  { margin: 1px; }
.set_process { margin: 0px 7px 0px 0px; }
.messaf     { display: none; }
.progress   { width: 100%; }
.fa_p       { margin-right: 20px; border: 0px; z-index: 9999; margin-bottom: 2px; margin-top: 0px; }
.p_run_div  { margin-top: -7px; border-radius: 0px; padding: 0px; margin-bottom: 8px; display: none; }
.btnxc_r    { margin-left: 0px; display: none; }
.del-img    { z-index: 9999; float: right; text-align: right; top: 0px; right: 0px; margin-top: -10px; margin-right: -10px; cursor: pointer; }

.posts_article {
    background-color: #333;
    background-position: 50%;
    background-size: cover;
    margin-bottom: 2px;
    padding-bottom: 100%;
}
.more-photos { cursor: pointer !important; }
.more-photos:after { right: 3px !important; bottom: 0px !important; }
.bluess { width: 100%; margin: 10px; }
.suggested-posts-article { display: inline-block; }

/* MODAL /////////////////////////////////////////////////// */
@media (min-width: 576px) {
    .modal-dialog { max-width: 800px; margin: 1.75rem auto; }
}

/* POPUP /////////////////////////////////////////////////// */
.divpopup {
    display: none;
    position: fixed;
    background: #00000057;
    z-index: 9999;
    margin: auto;
}

/* ANIMATION //////////////////////////////////////////////// */
.animated {
    background-repeat: no-repeat;
    background-position: left top;
    -webkit-animation-duration: 0.5s;
    animation-duration: 0.5s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}
.fadeInTop { -webkit-animation-name: fadeInTop; animation-name: fadeInTop; }
@-webkit-keyframes fadeInTop {
    0%   { opacity: 0; -webkit-transform: translateY(420px); }
    100% { opacity: 1; -webkit-transform: translateY(0px); }
}
@keyframes fadeInTop {
    0%   { opacity: 0; transform: translateY(420px); }
    100% { opacity: 1; transform: translateY(0px); }
}

/* FAQ ACCORDION //////////////////////////////////////////// */
#accordionExample-faq .card-header h5 button::before { left: 20px; top: 7px; }
#accordionExample-faq .card-header h5 button.collapsed::before {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
    font-size: 10px;
    content: "\f062";
    font-family: 'Font Awesome 5 Free' !important;
}

/* TINYMCE ////////////////////////////////////////////////// */
.tox-notification,
.tox-notifications-container { display: none !important; }
.tox-notification__icon,
.tox-notification__body       { display: none !important; }
.tox .tox-notification--in    { opacity: 0 !important; }
.mce-content-body .color-red  { color: #C40C1F !important; }

/* SWAL ///////////////////////////////////////////////////// */
.swal2-close {
    z-index: 2;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: -1.2em;
    padding: 0;
    overflow: hidden;
    transition: color .1s, box-shadow .1s;
    border: none;
    border-radius: 5px;
    background: 0 0;
    color: #ccc;
    font-family: monospace;
    font-size: 2.5em;
    cursor: pointer;
    justify-self: end;
}

/* FORM CONTENT ///////////////////////////////////////////// */
.form-content .form-items { max-width: 70% !important; }
.close-queue { position: absolute; top: 12px; right: 37.5%; }

/* TOPBAR RESPONSIVE //////////////////////////////////////// */
@media (max-width: 767.98px) {
    .topbar .creat-btn { display: block !important; }
}


/* ============================================================
   MAGAZINE ADMIN PANEL
   ใช้กับ admin_magazine.php + body files
   ============================================================ */

/* Layout /////////////////////////////////////////////////// */
.mag-wrap { display: flex; min-height: 100vh; }

/* Sidebar ////////////////////////////////////////////////// */
.mag-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.mag-sidebar-logo {
    padding: 20px 18px 16px;
    border-bottom: 1px solid #2e2e2e;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mag-sidebar-logo i    { color: #c0272d; font-size: 18px; }
.mag-sidebar-logo span { color: #c0272d; }
.mag-sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.mag-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #bbb;
    font-size: 13px;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.mag-sidebar-nav a i           { width: 16px; text-align: center; }
.mag-sidebar-nav a:hover        { background: #2e2e2e; color: #fff; text-decoration: none; }
.mag-sidebar-nav a.active       { background: #c0272d; color: #fff; }
.mag-sidebar-section {
    padding: 10px 18px 4px;
    font-size: 11px;
    color: #555;
    letter-spacing: .8px;
    text-transform: uppercase;
}
.mag-sidebar-footer { padding: 14px 18px; border-top: 1px solid #2e2e2e; }
.mag-sidebar-user   { display: flex; align-items: center; gap: 8px; color: #888; font-size: 13px; }
.mag-sidebar-user i { font-size: 22px; color: #555; }

/* Main ///////////////////////////////////////////////////// */
.mag-main     { margin-left: 230px; flex: 1; display: flex; flex-direction: column; }
.mag-topbar   {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.mag-topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mag-topbar-back {
    color: #888;
    font-size: 14px;
    line-height: 1;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 5px 8px;
    text-decoration: none;
}
.mag-topbar-back:hover  { background: #e5e5e5; color: #1a1a1a; text-decoration: none; }
.mag-topbar-right       { display: flex; align-items: center; gap: 12px; }
.mag-topbar-date        { font-size: 13px; color: #888; }
.mag-content            { padding: 24px; }

/* Alert //////////////////////////////////////////////////// */
.mag-alert         { display: flex; align-items: center; gap: 8px; padding: 12px 24px; font-size: 13px; }
.mag-alert-success { background: #d4edda; color: #1a7c4f; border-bottom: 1px solid #b6e8cf; }

/* Stat Cards /////////////////////////////////////////////// */
.mag-stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.mag-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    border: 1px solid #e5e5e5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.mag-stat-card:hover      { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.mag-stat-card::before    { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--card-accent, #e5e5e5); border-radius: 10px 10px 0 0; }
.mag-stat-card.ac-blue    { --card-accent: #3b5bdb; }
.mag-stat-card.ac-green   { --card-accent: #1a7c4f; }
.mag-stat-card.ac-orange  { --card-accent: #e07b00; }
.mag-stat-card.ac-red     { --card-accent: #c0272d; }
.mag-stat-card.ac-purple  { --card-accent: #7c3aed; }
.mag-stat-card.ac-teal    { --card-accent: #0891b2; }
.mag-stat-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.mag-stat-value { font-size: 26px; font-weight: 700; color: #1a1a1a; line-height: 1; }
.mag-stat-sub   { font-size: 12px; color: #888; margin-top: 4px; }
.mag-stat-icon  { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.mag-stat-icon.ic-blue   { background: #f0f4ff; color: #3b5bdb; }
.mag-stat-icon.ic-green  { background: #f0faf5; color: #1a7c4f; }
.mag-stat-icon.ic-orange { background: #fff8f0; color: #e07b00; }
.mag-stat-icon.ic-red    { background: #fff0f0; color: #c0272d; }
.mag-stat-icon.ic-purple { background: #f8f0ff; color: #7c3aed; }
.mag-stat-icon.ic-teal   { background: #f0f9ff; color: #0891b2; }
.mag-stat-icon.ic-gray   { background: #f5f5f5; color: #555; }

/* Trend badge */
.mag-trend      { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 20px; margin-top: 4px; }
.mag-trend.up   { background: #f0faf5; color: #1a7c4f; }
.mag-trend.down { background: #fff0f0; color: #c0272d; }
.mag-trend.flat { background: #f5f5f5; color: #888; }

/* Panel //////////////////////////////////////////////////// */
.mag-panel      { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.mag-panel-head {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mag-panel-subtitle { font-size: 12px; color: #888; font-weight: 400; }
.mag-panel-body     { padding: 20px; }

/* Table //////////////////////////////////////////////////// */
.mag-table-wrap { overflow-x: auto; }
.mag-table      { width: 100%; border-collapse: collapse; font-size: 13px; }
.mag-table thead th { background: #fafafa; color: #888; font-weight: 500; font-size: 12px; padding: 10px 14px; text-align: left; border-bottom: 1px solid #e5e5e5; white-space: nowrap; }
.mag-table tbody td { padding: 12px 14px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.mag-table tbody tr:last-child td { border-bottom: none; }
.mag-table tbody tr:hover { background: #fafafa; }

/* Badges /////////////////////////////////////////////////// */
.mag-badge            { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.mag-badge-success    { background: #e8f5e9; color: #1a7c4f; }
.mag-badge-warning    { background: #fff8e1; color: #b07d00; }
.mag-badge-info       { background: #e3f2fd; color: #0277bd; }
.mag-badge-secondary  { background: #f5f5f5; color: #555; }
.mag-badge-purple     { background: #f3e8ff; color: #7c3aed; }
.mag-badge-blue       { background: #eff6ff; color: #2563eb; }
.mag-badge-danger     { background: #fee2e2; color: #b91c1c; }

/* Buttons ////////////////////////////////////////////////// */
.mag-btn           { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-family: inherit; cursor: pointer; border: none; font-weight: 500; transition: background .15s, opacity .15s; text-decoration: none; }
.mag-btn:hover     { text-decoration: none; opacity: .9; }
.mag-btn-primary   { background: #c0272d; color: #fff; }
.mag-btn-success   { background: #1a7c4f; color: #fff; }
.mag-btn-secondary { background: #f5f5f5; color: #333; border: 1px solid #e5e5e5; }
.mag-btn-outline   { background: transparent; color: #888; border: 1px solid #e5e5e5; }
.mag-btn-danger    { background: #fee2e2; color: #b91c1c; }
.mag-btn-sm        { padding: 5px 10px; font-size: 12px; }

/* Filter Bar /////////////////////////////////////////////// */
.mag-filter-bar { display: flex; gap: 8px; padding: 14px 20px; flex-wrap: wrap; border-bottom: 1px solid #f0f0f0; }
.mag-filter-bar input,
.mag-filter-bar select { height: 34px; padding: 0 10px; border: 1px solid #e5e5e5; border-radius: 6px; font-size: 13px; font-family: inherit; background: #fff; color: #1a1a1a; }
.mag-filter-bar input       { min-width: 180px; }
.mag-filter-bar input:focus,
.mag-filter-bar select:focus { outline: none; border-color: #c0272d; }

/* Forms //////////////////////////////////////////////////// */
.mag-form-group       { margin-bottom: 14px; }
.mag-form-group label { display: block; font-size: 12px; color: #555; font-weight: 500; margin-bottom: 5px; }
/* .mag-form-control ใช้ร่วมกับ .form-control ของ Dastyle — override เฉพาะ magazine page */
.mag-main .form-control {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.mag-main .form-control:focus { outline: none; border-color: #c0272d; }

/* Pagination /////////////////////////////////////////////// */
.mag-pagination     { display: flex; gap: 4px; align-items: center; padding: 14px 20px; }
.mag-pagination a,
.mag-pagination span { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; font-size: 13px; border: 1px solid #e5e5e5; background: #fff; color: #333; }
.mag-pagination a:hover   { border-color: #c0272d; color: #c0272d; text-decoration: none; }
.mag-pagination .active   { background: #c0272d; color: #fff; border-color: #c0272d; }
.mag-pagination .disabled { color: #ccc; cursor: default; }

/* Detail /////////////////////////////////////////////////// */
.mag-detail-grid  { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.mag-detail-row   { display: flex; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.mag-detail-label { width: 130px; flex-shrink: 0; font-size: 12px; color: #888; padding-top: 1px; }
.mag-detail-value { flex: 1; font-size: 13px; color: #1a1a1a; }
.mag-map-link     { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #3b5bdb; }

/* Chart //////////////////////////////////////////////////// */
.mag-chart-wrap      { padding: 20px; position: relative; }
.mag-chart-container { height: 280px; }

/* Promo //////////////////////////////////////////////////// */
.mag-promo-grid      { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.mag-promo-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mag-promo-stats     { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.mag-promo-stat      { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 18px 20px; text-align: center; }
.mag-promo-stat .val { font-size: 24px; font-weight: 700; color: #c0272d; }
.mag-promo-stat .lbl { font-size: 12px; color: #888; margin-top: 4px; }

/* Responsive /////////////////////////////////////////////// */
@media (max-width: 1100px) { .mag-stat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px) {
    .mag-sidebar          { width: 200px; }
    .mag-main             { margin-left: 200px; }
    .mag-detail-grid,
    .mag-promo-grid       { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .mag-sidebar          { display: none; }
    .mag-main             { margin-left: 0; }
    .mag-stat-grid        { grid-template-columns: 1fr 1fr; }
}