/* ---------- Base reset ---------- */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f7fb;
    color: #111827;
}

/* ---------- Links ---------- */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Layout ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ---------- Topbar ---------- */
.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ---------- Brand / Logo ---------- */
.brand {
    display: flex;
    align-items: center;
}

/* ---------- Vidium Logo (BIG) ---------- */
.nav-logo {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    padding: 6px 8px;
    border-radius: 12px;
    line-height: 1;
}

.nav-logo:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.logo-img {
    height: 56px;
    width: auto;
    display: block;
}

/* ---------- Nav ---------- */
.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 6px 10px;
    border-radius: 8px;
    color: #111827;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background: #f3f4f6;
    text-decoration: none;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;

    /* micro-interactions */
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
    background: #f3f4f6;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.06);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    font-weight: 600;
    text-decoration: none;
    margin-right: 8px;

    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn-secondary:hover {
    background: #f3f4f6;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ---------- Toolbar ---------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* ---------- Status pill ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(0,0,0,0.06);
}

/* Draft */
.status-pill.status-draft {
    background: #fdd935;
    color: #222;
}

/* Confirmed */
.status-pill.status-confirmed {
    background: #4caf50;
    color: #fff;
}

.status-pill.status-cancelled {
    background: #ffb3b3;
    color: #511;
}

/* In rent */
.status-pill.status-in_rent {
    background: #dcfce7;
    color: #14532d;
}

/* Closed */
.status-pill.status-closed {
    background: #9e9e9e;
    color: #fff;
    opacity: 0.95;
}

/* ---------- Tables ---------- */
.list-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.list-table th,
.list-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
}

.list-table th {
    background: #f9fafb;
    font-size: 13px;
    color: #374151;
}

.list-table tr:last-child td {
    border-bottom: 0;
}

/* ---------- Auth (Login) Page ---------- */

/* subtle animated gradient background */
@keyframes authBgShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-page {
    min-height: 100vh;

    /* layered gradient: calm + “brand-ish” */
    background:
        radial-gradient(1200px 600px at 20% 10%, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0) 55%),
        radial-gradient(900px 500px at 85% 20%, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0) 55%),
        linear-gradient(120deg, #f5f7fb, #f0f9ff, #f5f7fb);
    background-size: 200% 200%;
    animation: authBgShift 12s ease-in-out infinite;

    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    padding: 24px;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 34px 30px 38px;
    text-align: center;

    /* glass-ish */
    border: 1px solid rgba(229, 231, 235, 0.7);
    backdrop-filter: blur(10px);

    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10);
}

.auth-logo {
    margin-bottom: 18px;
}

.auth-logo img {
    height: 78px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.auth-title {
    margin: 0 0 22px;
    font-size: 22px;
    font-weight: 850;
    letter-spacing: 0.01em;
}

.auth-field {
    text-align: left;
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #374151;
}

.auth-field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);

    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-field input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.auth-error {
    background: rgba(254, 226, 226, 0.95);
    color: #991b1b;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.auth-btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 12px;
}

/* ---------- Animations (card + logo entrance) ---------- */
@keyframes authCardIn {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
        box-shadow: 0 0 0 rgba(0,0,0,0);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10);
        filter: blur(0);
    }
}

@keyframes authLogoPop {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.90);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* very subtle logo pulse (once per ~5s) */
@keyframes authLogoPulse {
    0%, 84% {
        transform: scale(1);
    }
    88% {
        transform: scale(1.035);
    }
    92% {
        transform: scale(1);
    }
    96% {
        transform: scale(1.018);
    }
    100% {
        transform: scale(1);
    }
}

.auth-animate {
    animation: authCardIn 560ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.auth-logo-animate {
    animation: authLogoPop 560ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
    animation-delay: 90ms;
}

.auth-logo-pulse {
    /* separate animation channel to not conflict with entrance animation */
}

.auth-logo-pulse img {
    transform-origin: center center;
    animation: authLogoPulse 5s ease-in-out infinite;
    animation-delay: 1.2s;
}

/* ---------- Accessibility: disable motion if user prefers ---------- */
@media (prefers-reduced-motion: reduce) {
    .auth-page {
        animation: none !important;
        background-size: auto !important;
    }

    .auth-animate,
    .auth-logo-animate,
    .auth-logo-pulse img,
    .btn,
    .btn-secondary,
    .auth-field input {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        box-shadow: none !important;
    }
}
/* ===========================
   CABINET PAGE
=========================== */

.cabinet-page {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cabinet-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.cabinet-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.cabinet-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #22c55e);
    color: white;
    font-size: 28px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cabinet-profile-info {
    flex: 1;
}

.cabinet-title {
    margin: 0 0 12px;
    font-size: 26px;
}

.cabinet-user-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px 20px;
    font-size: 14px;
    color: #374151;
}

.cabinet-role {
    margin-left: auto;
}

.role-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    background: #e5e7eb;
}

.role-superadmin { background: #ede9fe; color: #5b21b6; }
.role-manager { background: #e0f2fe; color: #0369a1; }
.role-s_engineer { background: #dcfce7; color: #166534; }
.role-engineer { background: #fef9c3; color: #92400e; }

.cabinet-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

/* === STATS === */

.cabinet-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: linear-gradient(135deg, #f9fafb, #ffffff);
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.stat-value {
    font-size: 26px;
    font-weight: 900;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
}

/* === EVENTS === */

.cabinet-section-title {
    margin: 0 0 16px;
    font-size: 20px;
}

.cabinet-subtitle {
    margin: 20px 0 8px;
    font-size: 14px;
    font-weight: 700;
}

.cabinet-subtitle-muted {
    color: #6b7280;
}

.role-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e5e7eb;
}

.role-muted {
    opacity: 0.6;
}

.list-table-muted {
    opacity: 0.75;
}


/* ---------- Notifications dropdown ---------- */
.notif-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-bell{
  position: relative;
}

.notif-dot{
  position:absolute;
  top:-2px;
  right:-6px;
  width:10px;
  height:10px;
  border-radius:999px;
  background: transparent;
  border: 2px solid transparent;
}

.notif-dot.is-on{
  background: #ef4444;
  border-color: #ffffff;
  animation: notifPulse 1.1s ease-in-out infinite;
}

@keyframes notifPulse{
  0%{ transform: scale(1); opacity: 0.9; }
  50%{ transform: scale(1.25); opacity: 1; }
  100%{ transform: scale(1); opacity: 0.9; }
}

.notif-panel{
  display:none;
  position:absolute;
  right:0;
  top: calc(100% + 10px);
  width: 360px;
  max-width: calc(100vw - 24px);
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  overflow:hidden;
  z-index: 9999;
}

.notif-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 12px;
  border-bottom:1px solid #eef2f7;
  background: #f9fafb;
}

.notif-title{
  font-weight: 800;
  font-size: 14px;
}

.notif-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.notif-link{
  background: transparent;
  border:0;
  padding: 6px 8px;
  border-radius: 10px;
  cursor:pointer;
  font-weight: 700;
  font-size: 12px;
}
.notif-link:hover{ background:#eef2f7; }

.notif-body{
  max-height: 420px;
  overflow:auto;
}

.notif-empty{
  padding: 14px;
  color:#6b7280;
  font-size: 13px;
}

.notif-item{
  padding: 12px;
  border-bottom:1px solid #eef2f7;
}
.notif-item:last-child{ border-bottom:0; }

.notif-item.unread{
  background: rgba(239,68,68,0.06);
}

.notif-item-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.notif-item-title{
  font-weight: 800;
  font-size: 13px;
}

.notif-del{
  border:0;
  background: transparent;
  cursor:pointer;
  padding: 4px 6px;
  border-radius: 10px;
}
.notif-del:hover{ background:#eef2f7; }

.notif-item-msg{
  margin-top: 6px;
  color:#374151;
  font-size: 12px;
}

.notif-item-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
  margin-top: 10px;
}

.notif-mark{
  border:1px solid #e5e7eb;
  background:#ffffff;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 800;
  cursor:pointer;
  font-size: 12px;
}
.notif-mark:hover{ background:#f3f4f6; }

.notif-open{
  border:1px solid #e5e7eb;
  background:#ffffff;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 800;
  cursor:pointer;
  font-size: 12px;
  text-decoration:none;
}
.notif-open:hover{ background:#f3f4f6; }
