/* ========================================
   TIbestSolutions - Admin Panel CSS
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 1.6; }

/* === Login Page === */
.login-body {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { height: 70px; margin-bottom: 15px; }
.admin-login-card h2 { color: #1e3a5f; margin-bottom: 25px; font-size: 1.5rem; }
.back-link { display: block; margin-top: 20px; color: #888; font-size: 13px; }
.back-link:hover { color: #1e3a5f; }

/* === Admin Layout === */
.admin-body { background: #f0f2f5; }
.admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    overflow-y: auto;
    z-index: 100;
    transition: width 0.3s;
}
.admin-sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header img { height: 40px; }
.sidebar-header span { font-weight: 700; font-size: 14px; }
.sidebar-nav { padding: 10px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    position: relative;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-nav a.active {
    background: rgba(212,168,67,0.15);
    color: #ffd700;
    border-right: 3px solid #d4a843;
}
.sidebar-nav a i { width: 20px; text-align: center; }
.sidebar-nav .badge {
    margin-left: auto;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.sidebar-divider { border-top: 1px solid rgba(255,255,255,0.08); margin: 10px 0; }
.logout-link:hover { color: #dc3545 !important; }

.admin-main {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s;
}
.admin-main.expanded { margin-left: 0; }

.admin-topbar {
    background: #fff;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    padding: 5px;
}
.admin-user { color: #555; font-size: 14px; }
.admin-user i { color: #1e3a5f; margin-right: 5px; }

.admin-content { padding: 25px; }

/* === Common Components === */
.page-title {
    font-size: 1.6rem;
    color: #1a1a2e;
    margin-bottom: 25px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 15px; color: #333; }
.card-header h3 i { color: #d4a843; margin-right: 8px; }
.card-body { padding: 20px; }

/* Stat Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 4px solid;
}
.stat-blue { border-left-color: #1e3a5f; }
.stat-green { border-left-color: #28a745; }
.stat-orange { border-left-color: #d4a843; }
.stat-red { border-left-color: #dc3545; }
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.stat-blue .stat-icon { background: rgba(30,58,95,0.1); color: #1e3a5f; }
.stat-green .stat-icon { background: rgba(40,167,69,0.1); color: #28a745; }
.stat-orange .stat-icon { background: rgba(212,168,67,0.1); color: #d4a843; }
.stat-red .stat-icon { background: rgba(220,53,69,0.1); color: #dc3545; }
.stat-info h3 { font-size: 1.5rem; color: #1a1a2e; line-height: 1.2; }
.stat-info p { color: #888; font-size: 13px; }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    background: #f8f9fa;
    padding: 10px 15px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    border-bottom: 2px solid #eee;
}
.admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.admin-table tr:hover { background: #fafafa; }
.unread-row { background: #f0f8ff !important; }
.table-thumb {
    width: 50px; height: 35px;
    object-fit: cover;
    border-radius: 4px;
}
.table-thumb-placeholder {
    width: 50px; height: 35px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}
.actions { white-space: nowrap; }

/* Badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.status-published { background: #d4edda; color: #155724; }
.status-draft { background: #f0f0f0; color: #666; }
.badge-cat { background: #e8f0fe; color: #1e3a5f; padding: 3px 8px; border-radius: 3px; font-size: 12px; }
.badge-views { color: #888; font-size: 13px; }
.badge-views i { margin-right: 3px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: inherit;
}
.btn-primary { background: #1e3a5f; color: #fff; }
.btn-primary:hover { background: #16304f; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-outline { background: #f0f0f0; color: #555; }
.btn-outline:hover { background: #e0e0e0; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 30px; font-size: 15px; }
.btn-block { display: block; width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
    color: #555;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    background: #fff;
    color: #333;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e3a5f;
}
.form-group textarea { resize: vertical; }
.form-group input[type="file"] { padding: 8px; }
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: auto; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.form-actions { margin-top: 20px; }
.text-muted { color: #888; }
small.text-muted { font-size: 12px; display: block; margin-top: 4px; }

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }

/* Progress bars */
.progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
}
.progress-item > span:first-child { width: 80px; color: #555; }
.progress-bar {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e3a5f, #d4a843);
    border-radius: 4px;
    min-width: 2px;
}
.progress-count { color: #888; font-size: 12px; width: 40px; text-align: right; }

/* Comparison */
.comparison { display: flex; gap: 20px; }
.comp-item { text-align: center; flex: 1; padding: 15px; background: #f8f9fa; border-radius: 8px; }
.comp-label { display: block; font-size: 12px; color: #888; margin-bottom: 5px; }
.comp-value { display: block; font-size: 1.5rem; font-weight: 700; color: #1a1a2e; }
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-center { text-align: center; }

/* List items */
.list-items { }
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.list-item:last-child { border-bottom: none; }
.list-item strong { display: block; font-size: 13px; color: #333; }
.list-item small { font-size: 12px; }

/* Message detail */
.message-detail { }
.message-field {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.message-field label { font-weight: 600; color: #888; min-width: 80px; }
.message-body {
    padding: 20px;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.8;
    white-space: pre-wrap;
}
.message-actions { display: flex; gap: 10px; margin-top: 15px; }

/* Responsive */
@media (max-width: 1024px) {
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .admin-sidebar { width: 0; overflow: hidden; }
    .admin-sidebar.collapsed { width: 250px; overflow: auto; }
    .admin-main { margin-left: 0; }
    .admin-main.expanded { margin-left: 250px; }
    .stats-cards { grid-template-columns: 1fr; }
    .comparison { flex-direction: column; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px; }
}
