﻿/* === activity_log.css === */
/* Extracted from activity_log.html */

/* تخصيصات بسيطة خاصة بصفحة سجل النشاطات
       بقية التنسيقات من style.css الموحد */
    :root {
      --primary-color: #6366f1;
      --primary-hover: #4f46e5;
      --primary-light: #eef2ff;
      --success-color: #16a34a;
      --warning-color: #f59e0b;
      --danger-color: #ef4444;
      --text-muted: #64748b;
      --border-color: #e2e8f0;
      --card-bg: #ffffff;
      --light-bg: #f8fafc;
      --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    }

[data-theme="dark"] {
  --bg:#0f172a; --card:#1e293b; --border:#334155; --text:#f1f5f9; --muted:#94a3b8;
  --light-bg:#0f172a; --border-color:#334155; --text-color:#f1f5f9; --text-muted:#94a3b8;
  --dark-color:#f1f5f9; --primary-light:rgba(99,102,241,.1); --card-bg:#1e293b;
}
body {
      font-family: "Cairo", Arial, sans-serif;
      background: var(--light-bg);
    }

    .page-content {
      padding: 24px;
    }

    .page-header {
      margin-bottom: 16px;
    }

    .page-header-title {
      font-size: 22px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px;
      color: #1f2937;
      margin-bottom: 4px;
    }

    .page-header-subtitle {
      font-size: 13px;
      color: var(--text-muted);
      line-height: 1.7;
    }

    .card {
      background: var(--card-bg);
      border-radius: 14px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
      padding: 14px 16px;
      margin-bottom: 16px;
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      gap: 8px;
    }

    .card-title {
      font-size: 15px;
      font-weight: 700;
      color: #111827;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .card-subtitle {
      font-size: 12px;
      color: var(--text-muted);
    }

    .filters-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-top: 8px;
      margin-bottom: 6px;
    }

    @media (max-width: 1024px) {
      .filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 640px) {
      .filters-grid {
        grid-template-columns: minmax(0, 1fr);
      }
      .page-content {
        padding: 16px;
      }
    }

    .form-label {
      font-size: 12px;
      font-weight: 600;
      margin-bottom: 3px;
      display: block;
      color: #374151;
    }

    .form-control {
      width: 100%;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      padding: 7px 9px;
      font-family: inherit;
      font-size: 13px;
      background: #ffffff;
      transition: 0.2s;
    }

    .form-control:focus {
      outline: none;
      border-color: var(--primary-color);
      box-shadow: 0 0 0 2px rgba(99,102,241,0.18);
    }

    .btn {
      border-radius: 999px;
      padding: 7px 14px;
      font-size: 13px;
      font-weight: 600;
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: 0.2s;
      font-family: inherit;
    }

    .btn-primary {
      background: var(--primary-color);
      color: #fff;
    }

    .btn-primary:hover {
      background: var(--primary-hover);
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(99,102,241,0.25);
    }

    .btn-secondary {
      background: #e5e7eb;
      color: #111827;
    }

    .btn-secondary:hover {
      background: #d1d5db;
    }

    .btn-ghost {
      background: transparent;
      color: #4b5563;
      border: 1px solid #e5e7eb;
      border-radius: 999px;
    }

    .btn-ghost:hover {
      background: #f3f4f6;
    }

    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    .filters-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      justify-content: flex-start;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .muted {
      font-size: 12px;
      color: var(--text-muted);
    }

    .table-wrapper {
      border-radius: 10px;
      border: 1px solid var(--border-color);
      overflow: auto;
      max-height: 480px;
      background: #ffffff;
      margin-top: 8px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 800px;
      font-size: 12px;
    }

    thead th {
      position: sticky;
      top: 0;
      background: var(--bg);
      color: #fff;
      padding: 8px 10px;
      text-align: right;
      font-weight: 600;
      white-space: nowrap;
    }

    tbody td {
      padding: 7px 9px;
      border-bottom: 1px solid #f1f5f9;
      vertical-align: middle;
    }

    tbody tr:nth-child(even) td {
      background: #f9fafb;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
    }

    .badge-success {
      background: #dcfce7;
      color: #166534;
    }

    .badge-danger {
      background: #fee2e2;
      color: #b91c1c;
    }

    .badge-info {
      background: #e0f2fe;
      color: #075985;
    }

    .badge-muted {
      background: #e5e7eb;
      color: #374151;
    }

    .log-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 4px;
      font-size: 12px;
      color: var(--text-muted);
    }

    .log-summary span {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .summary-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      display: inline-block;
    }

    .dot-success { background: #22c55e; }
    .dot-error   { background: #ef4444; }
    .dot-total   { background: #6b7280; }

    .pagination {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      font-size: 12px;
      color: var(--text-muted);
    }

    .pagination-buttons {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .page-size-select {
      width: auto;
      padding-inline: 8px;
      padding-block: 4px;
      border-radius: 999px;
      border: 1px solid var(--border-color);
      font-size: 12px;
      font-family: inherit;
      background: #fff;
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      display: inline-block;
      margin-left: 3px;
    }

    .status-ok { background:#16a34a; }
    .status-err{ background:#ef4444; }

/* =========================================
   Timeline Layout (Modern SaaS Theme)
========================================= */
.card-header.d-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.tags-wrapper, .tabs-wrapper {
    margin-right: -10px;
}

.nav-tabs {
    list-style: none;
    display: flex;
    gap: 15px;
    padding: 0;
    margin: 0;
}

.nav-tabs .nav-item {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tabs .nav-item:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

.nav-tabs .nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-tabs .nav-item.active .badge-light {
    background: white;
    color: var(--primary-color);
}

.nav-tabs .nav-item.error-tab:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.nav-tabs .nav-item.error-tab.active {
    background: #ef4444;
    color: white;
}

.badge-light {
    background: #e5e7eb;
    color: #374151;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.2s;
}

/* Timeline Core */
.timeline-container {
    padding: 20px 10px;
    /* Optional constraints if you want a max-height */
}

/* Empty State */
.timeline-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-size: 14px;
}

.timeline-group {
    display: flex;
    margin-bottom: 25px;
}

.timeline-date-col {
    width: 100px;
    flex-shrink: 0;
    text-align: right;
    padding-left: 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.timeline-date-col .timeline-month {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.timeline-events-col {
    flex-grow: 1;
    position: relative;
    padding-right: 20px;
    border-right: 2px solid #e5e7eb; /* The main vertical line */
}

/* Event Item */
.timeline-event-item {
    position: relative;
    margin-bottom: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Node Icon on the vertical line */
.timeline-node {
    position: absolute;
    right: -31px; /* adjust based on padding and border */
    top: 15px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-node i, .timeline-node svg, .timeline-node span {
    font-size: 10px;
    color: var(--primary-color);
}

/* Special Nodes */
.timeline-node.success { border-color: #22c55e; color: #22c55e; }
.timeline-node.error { border-color: #ef4444; color: #ef4444; }
.timeline-node.login { border-color: #3b82f6; color: #3b82f6; }
.timeline-node.create { border-color: #10b981; color: #10b981; }

.timeline-node.success span { color: #22c55e; }
.timeline-node.error span { color: #ef4444; }

/* Timeline Card Content */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.event-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13.5px;
    line-height: 1.4;
}

.event-title b {
    color: var(--primary-color);
}

.event-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: 15px; /* RTL */
}

/* Sub-row with Tags */
.event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.event-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.event-tag {
    background: #e5e7eb;
    color: #4b5563;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

.status-Resolved, .status-success {
    background: #dcfce7;
    color: #16a34a;
}

.status-In_work, .status-info {
    background: #fef3c7;
    color: #d97706;
}

.status-Open, .status-error {
    background: #fee2e2;
    color: #dc2626;
}

@media (max-width: 768px) {
    .timeline-group {
        flex-direction: column;
    }
    .timeline-date-col {
        width: 100%;
        text-align: right;
        padding-left: 0;
        margin-bottom: 10px;
        font-size: 15px;
    }
    .timeline-events-col {
        border-right: none;
        padding-right: 10px;
        border-left: 2px solid #e5e7eb; /* shift line to left for RTL mobile if wanted, or just hide */
    }
    .timeline-node {
        display: none; /* simple mobile view */
    }
}