:root {
    --primary-color: rgba(255, 255, 255, 0.753);
    --secondary-color: #285854;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    display: flex; 
    background-color: #f4f4f4;
}

.logo {
    margin: 10px 0px 20px 0px;
    height: 54px;
    width: 190px;
}

/* sanu menu - lai stav smuki kreisaja mala un nekustas */
.sidebar {
    width: 250px;
    height: 100vh;
    background-color: var(--secondary-color);
    color: white;
    position: fixed; 
    padding: 20px;
    display: flex;
    vertical-align: top;
    flex-direction: column;
}

.sidebar h2 {
    font-size: 24px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 10px;
}

.sidebar a {
    display: block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 15px 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* kad uzbrauc ar peli vai kad lapa ir aktiva */
.sidebar a:hover, 
.sidebar a.active {
    background-color: rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

.user-info {
    position: absolute;
    bottom: 20px;
    font-size: 14px;
    color: var(--primary-color);
}

/* labas puses liela satura dala */
.main-content {
    margin-left: 290px;
    padding: 40px;
    width: 100%;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    color: var(--secondary-color);
    padding: 20px;
    border-bottom: 3px solid #ccc;
    margin-bottom: 20px;
}

/* --- paša tabulas kaste un lines --- */
table {
    width: 100%;
    background: white;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

/* --- pogu izkartojums tabulas mala --- */
.darbibas-pogas {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    height: 100%;
    box-sizing: border-box;
}

.btn-add { 
    background-color: #27ae60; 
    color: white; 
    border: none;
    border-radius: 4px;
    padding: 10px 20px; 
    cursor: pointer; 
}

.btn-edit { 
    background-color: #f1c40f; 
    color: #333;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    padding: 6px 12px; 
    cursor: pointer; 
    display: inline-block;
}

.btn-delete { 
    background-color: #e74c3c; 
    color: white; 
    text-decoration: none;
    border: none;
    border-radius: 4px;
    padding: 6px 12px; 
    cursor: pointer; 
    display: inline-block;
}

/* --- krasainie statusu kluci --- */
.status-box {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    border-radius: 4px;
    text-align: center;
    min-width: 90px;
    transition: transform 0.2s ease, opacity 0.2s ease; /* gluds kad uzbrauc ar peli */
}

/* kad uzbrauc virsu statusa kastei */
.status-box:hover {
    transform: scale(1.05);
    opacity: 0.9;
    cursor: pointer;
}

/* zila krasa -> Aktivs */
.status-active {
    background-color: rgb(0, 162, 255);
}

/* zala krasa -> Pardots */
.status-sold {
    background-color: green;
}

/* oranza krasa -> Follow-up */
.status-follow {
    background-color: orange;
}

/* sarkana krasa -> Sledzam sadarbibu */
.status-sledzam {
    background-color: red;
}

/* peleka krasa -> ja statuss ir tuks un nav nekas izvelets */
.status-none {
    background-color: grey;
}

/* --- majas bilde tabula --- */
.tabulas-bilde {
    width: 50px;
    height: 50px;
    object-fit: cover;     
    border-radius: 4px;    
    box-shadow: 0 1px 3px rgba(0,0,0,0.15); 
    cursor: pointer;       
    transition: transform 0.2s ease; 
}

/* kad uzbrien uz bildites ar peli */
.tabulas-bilde:hover {
    transform: scale(1.08);
}

/* --- formas balta kaste kad pievieno jaunu lead --- */
.form-container {
    max-width: 500px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="number"],
.form-container select,
.textarea-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: inherit;
    background-color: #fafafa;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-container input:focus,
.form-container select:focus,
.textarea-field:focus {
    border-color: var(--secondary-color);
    background-color: #fff;
    outline: none;
}

.form-container input[type="file"] {
    display: block;
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
}

.form-container .btn-add {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-align: center;
    box-sizing: border-box;
}

.form-container .btn-add:hover {
    background-color: #219653;
}

.form-container .btn-add:active {
    transform: scale(0.99);
}

.btn-cancel {
    display: block;
    text-align: center;
    color: #7f8c8d;
    text-decoration: none;
    margin-top: 15px;
    font-size: 14px;
    transition: color 0.2s;
}

.btn-cancel:hover {
    color: #333;
}

.textarea-field {
    resize: vertical;
    min-height: 80px;
}

/* izrakstisanas poga pasaa sidebar apaksa */
.sidebar .btn-logout {
    margin-top: auto;
    margin-bottom: 40px;
    
    background-color: rgba(231, 76, 60, 0.2); 
    color: #ffffff; 
    border: 1px solid rgba(231, 76, 60, 0.4);
    font-weight: bold;
    text-align: center;
}

.sidebar .btn-logout:hover {
    background-color: rgb(189, 92, 92);
    color: #ffffff; 
}



/* --- kastes centreshana tiesi prieks login.php --- */

body:has(.login-container) {
    display: flex ;
    justify-content: center ;
    align-items: center ;
    
    position: fixed ;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    background-color: var(--secondary-color);
}

/* baltais login logs pa vidu */
.login-container {
    width: 100%;
    height: 100%;
    max-height: 410px;
    max-width: 670px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 60px 60px 40px 60px;
    background-color: white;
    box-shadow: 0px 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.login-container .form-group {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.login-container .form-group label {
    text-align: center;
    width: 100%;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fff;
}

/* liela ienaksana poga */
.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

/* crm sistema virsraksts login kastes augsa */
.login-container h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 28px;
}

.login-error{
    color: red;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin-top: 5px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 320px;
}