/* ================================
   SONIT SECRET VAULT – GLOBAL CSS
================================ */

:root {
  --bg: #0b0b0b;
  --card: #151515;
  --border: #262626;
  --text: #eaeaea;
  --muted: #9b9b9b;
  --red: #e30613;
  --radius: 12px;
  --shadow: 0 15px 40px rgba(0,0,0,.6);
  --transition: all .25s ease;
}

/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  background: radial-gradient(circle at top, #121212, var(--bg));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
}


/* CARD */
.vault-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* TITLES */
h2 {
  text-align: center;
  margin-bottom: 24px;
  font-weight: 600;
}

/* FORM */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input {
  background: #0e0e0e;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(227,6,19,.4);
}

/* BUTTON */
button {
  background: var(--red);
  border: none;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

button:hover {
  filter: brightness(1.1);
}

/* LINKS */
a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

a:hover {
  color: var(--red);
}

/* DASHBOARD */
.vault-list {
  margin-top: 20px;
}

.vault-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.vault-item:hover {
  background: #1b1b1b;
}

/* PASSWORD VIEW */
.password-box {
  background: #0e0e0e;
  border: 1px dashed var(--border);
  padding: 14px;
  border-radius: 8px;
  font-family: monospace;
  text-align: center;
  margin: 15px 0;
}

/* ERROR */
.error {
  color: #ff5a5a;
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
}

/* TOP ACTIONS */
.top-actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
/* ================================
   APPLICATION GRID
================================ */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.app-card {
  background: #121212;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.app-card:hover {
  background: #1a1a1a;
  transform: translateY(-2px);
}

.app-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.app-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.app-actions a {
  font-size: 14px;
}

.app-delete {
  background: none;
  border: none;
  color: #ff5a5a;
  cursor: pointer;
  font-size: 14px;
}
/* ================================
   FULL-WIDTH VAULT LAYOUT
================================ */

.vault-wrapper {
  width: 100%;
  padding: 60px 80px;
}

.vault-header {
  max-width: 420px;
  margin: 0 auto 40px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

/* Grid now spans page */
.app-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* Bigger square cards */
.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

.app-name {
  font-size: 20px;
  font-weight: 600;
}

.app-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-actions a {
  font-size: 14px;
}

.app-delete {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
}
.app-card ul {
  list-style: disc;
}

.app-card li {
  margin-bottom: 4px;
}
button {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  filter: brightness(1.1);
}
/* ================================
   FINAL MOBILE FIX (<= 640px)
================================ */
@media (max-width: 640px) {

  /* Stop any centering tricks */
  body {
    display: block;
  }

  /* Page padding */
  .vault-wrapper {
    padding: 16px 14px 32px;
  }

  /* Header becomes normal card */
  .vault-header {
    max-width: 100%;
    margin: 0 0 20px 0;
    padding: 18px;
  }

  /* Force SINGLE COLUMN */
  .app-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* Cards look like mobile tiles */
  .app-card {
    padding: 16px;
    border-radius: 14px;
    min-height: auto;
  }

  .app-name {
    font-size: 17px;
    margin-bottom: 6px;
  }

  /* Vault preview text tighter */
  .app-card ul {
    margin-top: 8px;
    padding-left: 14px;
  }

  .app-card li {
    font-size: 13px;
    line-height: 1.4;
  }

  /* Stack actions vertically */
  .app-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
  }

  .app-actions a,
  .app-delete {
    font-size: 15px;
  }

  /* Buttons easier to tap */
  button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
  }

  input {
    font-size: 16px; /* prevents iOS zoom */
  }
}
.center-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
/* ================================
   STANDARD PAGE CONTAINER
   (for app_view, view, add, edit)
================================ */
.page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

/* On mobile, normal flow */
@media (max-width: 640px) {
  .page {
    padding: 20px 14px;
    justify-content: flex-start;
  }
}

.trusted-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:16px;
}
.trusted-card{
    border:1px solid rgba(255,255,255,0.15);
    padding:14px;
    border-radius:12px;
}
@media(max-width:768px){
    .trusted-grid{ grid-template-columns:1fr; }
}
.log-card{
    border:1px solid rgba(255,255,255,0.1);
    padding:12px;
    border-radius:10px;
    margin-bottom:10px;
}
.risk-high{color:#ff4d4d;font-weight:bold;}
.risk-medium{color:#ffb347;}
.risk-safe{color:#5bd97f;}

.profile-wrapper {
    max-width: 1200px;
    margin: auto;
}
.logs-grid {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:16px;
}

@media(max-width:768px){
    .logs-grid {
        grid-template-columns:1fr;
    }
}

.pagination{
    margin-top:20px;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.pagination a{
    padding:6px 12px;
    border-radius:6px;
    background:#222;
    text-decoration:none;
    color:#fff;
    font-size:13px;
}

.pagination a.active-page{
    background:#e30613;
    font-weight:bold;
}
