/* Sonergy Team Dashboard — CSS */

:root {
    --blue: #1B5091;
    --blue-med: #2568B0;
    --blue-light: #E8F0FE;
    --dark: #0c1929;
    --gray: #7F8C8D;
    --gray-light: #ECF0F1;
    --green: #27AE60;
    --red: #E74C3C;
    --orange: #E67E22;
    --white: #FFFFFF;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --gold: #F7A51C;
    --gold-light: #FBBF24;
    --gold-glow: rgba(247,165,28,.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--dark);
    background: #F5F7FA;
    padding-bottom: 72px;
    min-height: 100vh;
}

a { color: var(--blue-med); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Top Nav ===== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 0 2rem;
    height: 56px;
    border-bottom: 1px solid #E0E0E0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-left { display: flex; align-items: center; }
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--blue);
    text-decoration: none;
}
.nav-logo { height: 28px; }
.nav-right { display: flex; align-items: center; gap: 1.2rem; }
.nav-link {
    font-size: 0.9rem;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
}
.nav-link:hover { color: var(--blue-med); text-decoration: none; }
.nav-link-muted { color: var(--gray); font-weight: 400; }

/* ===== Main Content ===== */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Flash Messages ===== */
.flash-messages { margin-bottom: 1.5rem; }
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.alert-error { background: #FDEDEC; color: var(--red); border: 1px solid #F5B7B1; }
.alert-success { background: #EAFAF1; color: var(--green); border: 1px solid #ABEBC6; }
.alert-info { background: var(--blue-light); color: var(--blue); border: 1px solid #AED6F1; }
.alert-warning { background: #FEF9E7; color: #B7950B; border: 1px solid #F9E79F; }

/* ===== Auth Pages (Login, Signup, Forgot, Reset) ===== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo { height: 48px; margin-bottom: 1rem; }
.auth-header h1 { font-size: 1.5rem; color: var(--blue); margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--gray); font-size: 0.9rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--dark); }
.form-input, input[type="email"], input[type="password"], input[type="text"], input[type="date"] {
    padding: 0.6rem 0.8rem;
    border: 1px solid #D5D8DC;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus, input:focus {
    border-color: var(--blue-med);
    box-shadow: 0 0 0 2px rgba(46,134,193,0.15);
}
.form-select {
    padding: 0.6rem 0.8rem;
    border: 1px solid #D5D8DC;
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--white);
}
.form-select-sm {
    padding: 0.3rem 0.5rem;
    border: 1px solid #D5D8DC;
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--white);
}
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}
.form-check { display: flex; align-items: center; gap: 0.4rem; }
.form-check label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; cursor: pointer; }
.inline-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.inline-action { display: inline-flex; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: linear-gradient(135deg, var(--gold), #e69500); color: var(--dark); font-weight: 600; }
.btn-success { background: var(--green); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-delete { background: transparent; color: var(--red); border: 1px solid var(--red); padding: 0.25rem 0.5rem; font-size: 0.85rem; line-height: 1; cursor: pointer; }
.btn-delete:hover { background: var(--red); color: var(--white); }
.btn-resend { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.btn-resend:hover { background: var(--blue); color: var(--white); }

/* ===== Dashboard ===== */
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { font-size: 1.6rem; color: var(--dark); }
.dashboard-subtitle { color: var(--gray); margin-top: 0.25rem; }

.stats-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-width: 120px;
}
.stat-number { font-size: 1.8rem; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 0.8rem; color: var(--gray); margin-top: 0.2rem; }

.section-title {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 600;
}
.section-desc { color: var(--gray); font-size: 0.9rem; margin-bottom: 1rem; margin-top: -0.5rem; }

/* ===== Service Cards ===== */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.service-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: var(--dark);
    transition: box-shadow 0.2s, transform 0.15s;
}
.service-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-1px);
    text-decoration: none;
}
.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.service-info { flex: 1; }
.service-info h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.service-info p { font-size: 0.85rem; color: var(--gray); }
.service-arrow { color: var(--gray); flex-shrink: 0; }

/* ===== Tool Cards (Task Management page) ===== */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.tool-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--dark);
    transition: box-shadow 0.2s, transform 0.15s;
    border: 2px solid transparent;
}
.tool-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
    border-color: var(--blue);
}
.tool-logo {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.tool-info { flex: 1; }
.tool-info h3 { font-size: 1.15rem; margin-bottom: 0.3rem; color: var(--dark); }
.tool-desc { font-size: 0.88rem; color: var(--gray); margin-bottom: 0.5rem; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tool-tag {
    font-size: 0.72rem;
    background: #e8f0fe;
    color: var(--blue);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
}
.tool-arrow { color: var(--gray); flex-shrink: 0; }
.tools-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.85rem;
    font-style: italic;
}
.tools-branding {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}
.tools-branding-logo { height: 36px; margin-bottom: 0.5rem; }
.tools-branding-name { font-size: 0.95rem; font-weight: 600; color: var(--dark); font-style: normal; margin: 0; }
.tools-branding-dept { font-size: 0.82rem; color: var(--gray); font-style: normal; margin: 0.15rem 0 0; }

/* ===== Admin ===== */
.admin-section { margin-bottom: 3rem; }
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}
.admin-card h3 { font-size: 1rem; color: var(--dark); margin-bottom: 1rem; }

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
    min-width: 750px;
}
.admin-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--gray-light);
    font-weight: 600;
    color: var(--gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
    word-break: break-word;
}
.row-inactive { opacity: 0.5; }
.actions-cell { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.actions-cell select { max-width: 90px; font-size: 0.8rem; }
.actions-cell .btn { white-space: nowrap; padding: 0.25rem 0.6rem; font-size: 0.78rem; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-admin { background: #EBF5FB; color: var(--blue); }
.badge-member { background: var(--gray-light); color: var(--gray); }
.badge-active { background: #EAFAF1; color: var(--green); }
.badge-inactive { background: #FDEDEC; color: var(--red); }
.badge-pending { background: #FEF9E7; color: var(--orange); }

/* ===== Shares ===== */
.shares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1rem;
}
.share-card { }
.share-header { margin-bottom: 0.75rem; }
.share-header h3 { margin-bottom: 0.25rem; }
.share-link { font-size: 0.8rem; color: var(--blue-med); }
.share-desc { font-size: 0.85rem; color: var(--gray); margin-bottom: 1rem; }
.share-form { display: flex; flex-direction: column; gap: 0.75rem; }
.share-divider { border-top: 1px solid #e8e8e8; margin: 1rem 0; }
.share-section-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray); margin-bottom: 0.25rem; }
.password-field { display: flex; gap: 0.4rem; align-items: center; }
.password-field .form-input { flex: 1; font-family: monospace; }
.btn-icon { background: none; border: 1px solid #d5d8dc; border-radius: 6px; padding: 6px 8px; cursor: pointer; color: var(--gray); display: flex; align-items: center; transition: all 0.2s; }
.btn-icon:hover { border-color: var(--blue); color: var(--blue); background: #f0f6fc; }
.share-message { min-height: 60px; resize: vertical; font-family: inherit; padding: 0.6rem 0.8rem; border: 1px solid #D5D8DC; border-radius: 6px; font-size: 0.9rem; }
.share-message:focus { border-color: var(--blue-med); box-shadow: 0 0 0 2px rgba(46,134,193,0.15); outline: none; }
.share-expiry-status { font-size: 0.82rem; padding: 0.4rem 0.8rem; border-radius: 6px; }
.share-expiry-status.active { background: #EAFAF1; color: var(--green); }
.share-expiry-status.expired { background: #FDEDEC; color: var(--red); font-weight: 600; }

/* ===== Shared Files Page ===== */
.sf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.sf-header h1 { font-size: 1.6rem; color: var(--dark); }
.sf-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.75rem 1.25rem;
}
.sf-profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}
.sf-profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.sf-profile-name { font-weight: 600; font-size: 0.9rem; color: var(--dark); }
.sf-profile-email { font-size: 0.78rem; color: var(--gray); }
.sf-profile-role { align-self: flex-start; margin-top: 2px; }

/* ===== Profile ===== */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

/* ===== Footer ===== */
.global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--white);
    border-top: 1px solid #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gray);
}
.footer-logo { height: 20px; opacity: 0.6; }
.footer-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.footer-company { font-weight: 600; color: var(--dark); font-size: 0.8rem; }
.footer-dept { font-size: 0.7rem; color: var(--gray); }

/* ===== Utilities ===== */
.text-muted { color: var(--gray); font-size: 0.85rem; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .main-content { padding: 1rem; }
    .auth-card { padding: 1.5rem; }
    .top-nav { padding: 0 1rem; }
    .nav-right { gap: 0.75rem; }
    .stats-bar { flex-direction: column; }
    .inline-form { flex-direction: column; align-items: stretch; }
    .form-row { flex-direction: column; }
    .shares-grid { grid-template-columns: 1fr; }
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 0.4rem; }
    .actions-cell { flex-direction: column; gap: 0.25rem; }
    .profile-grid { grid-template-columns: 1fr; }
}


/* Sonergy animated logo */
@keyframes spin-rays { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shine-pulse { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.75; } }

.sonergy-logo {
  display: inline-block;
  position: relative;
}
.sonergy-logo .sun-rays {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  animation: spin-rays 12s linear infinite;
  pointer-events: none;
}
.sonergy-logo .sun-rays g {
  animation: shine-pulse 2.5s ease-in-out infinite;
}
.sonergy-logo img {
  display: block;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}
.sonergy-logo-lg {
  width: 72px;
  height: 72px;
}
.sonergy-logo-lg img {
  width: 72px;
  height: 72px;
}
.sonergy-logo-md {
  width: 32px;
  height: 32px;
}
.sonergy-logo-md img {
  width: 32px;
  height: 32px;
}
.sonergy-logo-sm {
  width: 22px;
  height: 22px;
}
.sonergy-logo-sm img {
  width: 22px;
  height: 22px;
}
